… load a convention from a local YAML file?#

Yes you can. To demonstrate this, let’s take a convention file, which comes with the h5RDMtoolbox

import h5rdmtoolbox as h5tbx
from h5rdmtoolbox import tutorial
yaml_filename = tutorial.get_standard_attribute_yaml_filename()

cv = h5tbx.convention.Convention.from_yaml(yaml_filename)
h5tbx.use(cv)
using("h5rdmtoolbox-tutorial-convention")

The convention requires a standard name table. It comes with a default one, but let’s also load a local one:

snt_yaml_filename = tutorial.get_standard_name_table_yaml_file()
with h5tbx.File(data_type='experimental', contact=h5tbx.__author_orcid__,
               standard_name_table=snt_yaml_filename) as h5:
    snt = h5.standard_name_table
    c = h5.contact
    h5.dump()
    • contact: ORCID logohttps://orcid.org/0000-0001-8729-0482
    • data_type: experimental
    • standard_name_table: {"name": "Test", "institution": "my_institution", "contact": "https://orcid.org/0000-0001-8729-04...