FileGenerator¶
-
class
managers.operatorsTranscribe.metadata_filegenerator.FileGenerator¶ Available Methods:
Method name Method type forfile()class method get_modelID()static method get_username()static method get_testdescription()static method get_labelname()static method get_institution()static method -
classmethod
forfile(chosenmodel=None, simtime=None, vtest=None, username=None, labname=None, institutename=None)¶ Creates the NWB formatted metadata for an intended file to be saved.
Keyword Arguments:
Key Value type chosenmodelinstantiated model simtimedatetime.datetime when simulation started vtest(optional)instantiated validation CerebUnittestusername(optional)string labname(optional)string institutename(optional)string Returned value: It is a dictionary of the form
{ "session_description": string; "identifier": string, "session_start_time": datetime, "experimenter": string, "experiment_description": string, "session_id": string, "lab": string, "institution": string }
NOTE:
vtestis not given for raw stimulation of the chosenmodel- http://pynwb.readthedocs.io/en/latest/pynwb.file.html#pynwb.file.NWBFile
Use case:
>> fg = FileGenerator()>> model = Xyz()For simulation without validation test
>> filemd = fg.forfile(chosenmodel = model)For simulation with validation test
>> vtest = SomeTest()>> filemd = fg.forfile(chosenmodel=model, simtime=datetime.datetime.now(), test=vtest, username='john', labname='hbp brain sim lab', institute='CNRS-UNIC')
-
static
get_institution(instname)¶ Returns the string “no institution was provided” if the argument is
Noneotherwise it returns the attribute the argument (a string) itself.Note: The argument should be the name of the institute.
-
static
get_labname(labname)¶ Returns the string “no lab name was provided” if the argument is
Noneotherwise it returns the attribute the argument (a string) itself.Note: The argument should be the name of the laboratory.
-
static
get_modelID(model)¶ Try extracting the
uuidattribute value of the model and return it or return"no_model_uuid".Argument: The instantiated model is passed into this function.
-
static
get_testdescription(test)¶ Returns the string “raw simulation without running any CerebUnit test” if the argument is
Noneotherwise it returns the attribute.descriptionof the argument.Note: The argument should be the test metadata.
-
static
get_username(username)¶ Returns the username (also argument passed as a string) or returns “anonymous” if argument is
None.
-
classmethod