taucmdr.model.project module¶
Project data model.
A project collects multiple Target, Application, and Measurement
configurations in a single container. Selecting one of each forms a new Experiment.
Each application of the Experiment generates a new Trial record along with
some performance data (profiles, traces, etc.).
- class taucmdr.model.project.Project(record)[source]¶
Bases:
ModelProject data controller.
- _attributes = {'applications': {'collection': <class 'taucmdr.model.application.Application'>, 'description': 'applications used by this project', 'via': 'projects'}, 'experiment': {'description': 'the current experiment', 'model': <class 'taucmdr.model.experiment.Experiment'>}, 'experiments': {'collection': <class 'taucmdr.model.experiment.Experiment'>, 'description': 'experiments formed from this project', 'via': 'project'}, 'init_options': {'description': 'options passed to initialize command', 'type': 'string'}, 'measurements': {'collection': <class 'taucmdr.model.measurement.Measurement'>, 'description': 'measurements used by this project', 'via': 'projects'}, 'name': {'description': 'project name', 'primary_key': True, 'type': 'string', 'unique': True}, 'targets': {'collection': <class 'taucmdr.model.target.Target'>, 'description': 'targets used by this project', 'via': 'projects'}}¶
- _key_attribute = 'name'¶
- associations = {'applications': (<class 'taucmdr.model.application.Application'>, 'projects'), 'experiments': (<class 'taucmdr.model.experiment.Experiment'>, 'project'), 'measurements': (<class 'taucmdr.model.measurement.Measurement'>, 'projects'), 'targets': (<class 'taucmdr.model.target.Target'>, 'projects')}¶
(Controller, str) tuples keyed by attribute name defining attribute associations.
- attributes = {'applications': {'collection': <class 'taucmdr.model.application.Application'>, 'description': 'applications used by this project', 'via': 'projects'}, 'experiment': {'description': 'the current experiment', 'model': <class 'taucmdr.model.experiment.Experiment'>}, 'experiments': {'collection': <class 'taucmdr.model.experiment.Experiment'>, 'description': 'experiments formed from this project', 'via': 'project'}, 'init_options': {'description': 'options passed to initialize command', 'type': 'string'}, 'measurements': {'collection': <class 'taucmdr.model.measurement.Measurement'>, 'description': 'measurements used by this project', 'via': 'projects'}, 'name': {'description': 'project name', 'primary_key': True, 'type': 'string', 'unique': True}, 'targets': {'collection': <class 'taucmdr.model.target.Target'>, 'description': 'targets used by this project', 'via': 'projects'}}¶
Model attributes.
- classmethod controller(storage=<taucmdr.cf.storage.storage_dispatch.ProjectStorageDispatch object>)[source]¶
- experiment()[source]¶
Gets the currently selected experiment configuration.
- Returns:
The current experiment
- Return type:
- Raises:
ExperimentSelectionError – No experiment currently selected.
- key_attribute = 'name'¶
Name of an attribute that serves as a unique identifier.
- name = 'Project'¶
Name of the model.
- property prefix¶
- references = {(<class 'taucmdr.model.experiment.Experiment'>, 'project')}¶
(Controller, str) tuples listing foreign models referencing this model.
- class taucmdr.model.project.ProjectController(model_cls, storage, context=None)[source]¶
Bases:
ControllerProject data controller.
- create(data)[source]¶
Atomically store a new record and update associations.
Invokes the on_create callback after the data is recorded. If this callback raises an exception then the operation is reverted.
- delete(keys)[source]¶
Delete recorded data and update associations.
- The behavior depends on the type of keys:
Record.ElementIdentifier: delete the record with that element identifier.
dict: delete all records with attributes matching keys.
list or tuple: delete all records matching the elements of keys.
bool(keys) == False: raise ValueError.
Invokes the on_delete callback after the data is deleted. If this callback raises an exception then the operation is reverted.
- Parameters:
keys (dict) – Attributes to match.
keys – Fields or element identifiers to match.