|
carputils
Doxygen code documentation for the python framework controlling openCARP
|
Utilities for generating and managing metadata in bundles. More...
Functions | |
| def | load_metadata_file (exp_dir, bundle_dir) |
| Creates an object containing metadata provided by the user in the file exp_dir/codemeta.json, or in bundle_dir/codemeta.json (in this order) and merge it with the metadata template. More... | |
| def | check_critical_fields (metadata_obj) |
| Raise warnings if metadata template fields were not filled by the user. More... | |
| def | autopopulate_template (metadata_obj) |
| Automatically fills some fields in metadata object. More... | |
| def | autopopulate_authors_names (metadata_obj) |
| Create full name of the authors from 'given_name' and 'family_name' fields. More... | |
| def | autopopulate_date (metadata_obj) |
| Fills 'date' and 'publication_year' fields in metadata. More... | |
| def | add_env_metadata (metadata_obj) |
| Adds to an existing metadata object the environment metadata included by default in the bundle. More... | |
| def | add_exp_name (metadata_obj, exp_name) |
| Adds the experiment name to the metadata object if not defined in metadata. More... | |
| def | add_command_line (metadata_obj, exp_filename) |
| Adds the command line that should be used to run the same experiment to a metadata object. More... | |
| def | analyze_metadata (metadata_obj) |
| Analyzes the metadata and trigger warnings in case some critical metadata is missing. More... | |
| def | get_opencarp_git_hash () |
| Get the git hash of the openCARP version. More... | |
| def | get_latest_opencarp_version () |
| Get the latest version of openCARP. More... | |
Variables | |
| string | METADATA_FILE = 'codemeta.json' |
| string | METADATA_TPL_FILE = 'codemeta.json.tpl' |
Utilities for generating and managing metadata in bundles.
| def carputils.bundle.metadata.add_command_line | ( | metadata_obj, | |
| exp_filename | |||
| ) |
Adds the command line that should be used to run the same experiment to a metadata object.
metadata_obj :
Object containng metadata
| def carputils.bundle.metadata.add_env_metadata | ( | metadata_obj | ) |
Adds to an existing metadata object the environment metadata included by default in the bundle.
metadata_obj :
an object containing metadata.
| def carputils.bundle.metadata.add_exp_name | ( | metadata_obj, | |
| exp_name | |||
| ) |
Adds the experiment name to the metadata object if not defined in metadata.
metadata_obj :
the object containing metadata
| def carputils.bundle.metadata.analyze_metadata | ( | metadata_obj | ) |
Analyzes the metadata and trigger warnings in case some critical metadata is missing.
metadata_obj :
Object containing metadata
| def carputils.bundle.metadata.autopopulate_authors_names | ( | metadata_obj | ) |
Create full name of the authors from 'given_name' and 'family_name' fields.
If no name is given for the first author, it is autopopulated with the user data in carputils settings file. It also fills the 'rights_holder' field with the names of the authors.
metadata_obj :
object containing metadata
| def carputils.bundle.metadata.autopopulate_date | ( | metadata_obj | ) |
Fills 'date' and 'publication_year' fields in metadata.
metadata_obj :
object containing metadata
| def carputils.bundle.metadata.autopopulate_template | ( | metadata_obj | ) |
Automatically fills some fields in metadata object.
metadata_obj :
object containing metadata
| def carputils.bundle.metadata.check_critical_fields | ( | metadata_obj | ) |
Raise warnings if metadata template fields were not filled by the user.
| def carputils.bundle.metadata.get_latest_opencarp_version | ( | ) |
Get the latest version of openCARP.
| def carputils.bundle.metadata.get_opencarp_git_hash | ( | ) |
Get the git hash of the openCARP version.
| def carputils.bundle.metadata.load_metadata_file | ( | exp_dir, | |
| bundle_dir | |||
| ) |
Creates an object containing metadata provided by the user in the file exp_dir/codemeta.json, or in bundle_dir/codemeta.json (in this order) and merge it with the metadata template.
If these files don't exist, metadata template is loaded.
| exp_dir | str directory where to find the metadata file. |
| string carputils.bundle.metadata.METADATA_FILE = 'codemeta.json' |
| string carputils.bundle.metadata.METADATA_TPL_FILE = 'codemeta.json.tpl' |