Indivo DataModels
Bases: object
Imports a python module and extracts all Indivo Fact subclasses.
Reads in an SDML model definition and generates Indivo Fact subclasses.
Detects whether a directory is a properly-formatted datamodel.
This is true if:
dir_path MUST be an absolute path for this to work. Returns a tuple of (valid_p, fileroot, ext), where valid_p is True if the format is valid, fileroot is the name of the file containing the model definition (without the extention), and ext is the extension. If no such file exists, returns (False, None, None). Returns the first valid definition format.
A generator for iterating over all valid datamodels below toplevel_dir.
At each step, returns a tuple of (class_name, class), where class is a subclass of indivo.models.Fact corresponding to a datamodel.
If a model.py file fails to produce such a class, this function will silently skip it.
Processes extra options included in an extra.py file for a data model.
Looks for indivo.data_models.DataModelOptions classes and attaches them to the data model
Load all datamodels under directory into module.
Options processing and loading for Indivo medical data models.
Bases: object
Defines optional extra functionality for Indivo datamodels.
To add options to a datamodel, subclass this class and override its attributes.
Currently available options are:
Apply these options to a data model class.
Attaches custom serializers and field validators.
True if these options should be applied to data_model_class.
Right now, does cls.model_class_name match data_model_class.__name__?