ModelLibrary¶
- class romancal.datamodels.library.ModelLibrary(init, asn_exptypes=None, asn_n_members=None, on_disk=False, temp_directory=None, **datamodels_open_kwargs)[source]¶
Create a new ModelLibrary based on the provided “init”.
- Parameters:
init (str or Path or list (of DataModels)) – If a string or Path this should point to a valid association file. If a list of models consider continuing to use the list instead of making a library (the list will be more efficient and easier to use).
asn_exptypes (list of str, optional) – List of “exptypes” to load from the “init” value. Any association member with a “exptype” that matches (case insensitive) a value in this list will be available through the library.
asn_n_members (int, optional) – Number of association members to include in the library. This filtering will occur after “asn_exptypes” is applied. By default all members will be included.
on_disk (bool, optional, default=False) – When enabled, keep the models in the library “on disk”, writing out temporary files when the models are “shelved”. This option is only compatible with models loaded from an association (not a list of models).
temp_directory (str or Path, optional) – The temporary directory in which to store models when “on_disk” is enabled. By default a
tempfile.TemporaryDirectory
will be created in the working directory.**datamodels_open_kwargs (dict) – Keyword arguments that will provided to
_datamodels_open
when models are opened.
- property crds_observatory¶
Return the name of the observatory as a string
- Returns:
observatory
- Return type:
str