input4mips_validation.cvs.source_id#
| Sub-package | Description |
|---|---|
| values | Source ID values definition |
input4mips_validation.cvs.source_id
#
Source ID CV handling
For validation, see validation.
SOURCE_ID_FILENAME: str = 'input4MIPs_source_id.json'
module-attribute
#
Default name of the file in which the source ID CV is saved
SourceIDEntriesUnstructured: TypeAlias = dict[str, dict[str, str]]
module-attribute
#
Form into which source ID entries are serialised for the CVs
SourceIDEntries
#
Helper container for handling source ID entries
Source code in src/input4mips_validation/cvs/source_id/__init__.py
entries: tuple[SourceIDEntry, ...] = field()
class-attribute
instance-attribute
#
Source ID entries
source_ids: tuple[str, ...]
property
#
Source IDs found in the list of entries
Returns:
| Type | Description |
|---|---|
The `source_id`'s found in the list of entries
|
|
__getitem__(key)
#
Get SourceIDEntry by its name
We return the SourceIDEntry
whose source_id matches key.
Source code in src/input4mips_validation/cvs/source_id/__init__.py
__iter__()
#
SourceIDEntry
#
A single source ID entry
Source code in src/input4mips_validation/cvs/source_id/__init__.py
SourceIDValues
#
Values defined by a source ID
Source code in src/input4mips_validation/cvs/source_id/values.py
authors: Union[tuple[Author, ...], None] = None
class-attribute
instance-attribute
#
Author(s) of the dataset
contact: str
instance-attribute
#
Email addresses to contact in case of questions about the file
further_info_url: str
instance-attribute
#
URL where further information about the file/data in the file can be found
institution_id: str
instance-attribute
#
ID of the institute that created the file
license_id: Union[str, None] = None
class-attribute
instance-attribute
#
ID of the license that applies to this dataset
mip_era: str
instance-attribute
#
The MIP era to which this file belong
source_version: str
instance-attribute
#
The version of the file, as defined by the source
convert_source_id_entries_to_unstructured_cv(source_id_entries)
#
Convert SourceIDEntries to the raw CV form
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source_id_entries
|
SourceIDEntries
|
Source ID entries |
required |
Returns:
| Type | Description |
|---|---|
Raw CV data
|
|
Source code in src/input4mips_validation/cvs/source_id/__init__.py
convert_unstructured_cv_to_source_id_entries(unstructured)
#
Convert the raw CV data to a SourceIDEntries
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
unstructured
|
SourceIDEntriesUnstructured
|
Unstructured CV data |
required |
Returns:
| Type | Description |
|---|---|
Source ID entries
|
|
Source code in src/input4mips_validation/cvs/source_id/__init__.py
load_source_id_entries(raw_cvs_loader, filename=SOURCE_ID_FILENAME)
#
Load the source_id entries in the CVs
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
raw_cvs_loader
|
RawCVLoader
|
Loader of raw CVs data. |
required |
filename
|
str
|
Name of the file from which to load the CVs. Passed to
|
SOURCE_ID_FILENAME
|
Returns:
| Type | Description |
|---|---|
Loaded source ID entries
|
|