input4mips_validation.cvs.license#
input4mips_validation.cvs.license
#
License CV handling
For validation, see validation.
LICENSE_FILENAME: str = 'input4MIPs_license.json'
module-attribute
#
Default name of the file in which the license CV is saved
LicenseEntriesUnstructured: TypeAlias = dict[str, dict[str, str]]
module-attribute
#
Form into which license entries are serialised for the CVs
LicenseEntries
#
Helper container for handling license entries
Source code in src/input4mips_validation/cvs/license.py
entries: tuple[LicenseEntry, ...] = field()
class-attribute
instance-attribute
#
License entries
license_ids: tuple[str, ...]
property
#
License IDs found in the list of entries
Returns:
| Type | Description |
|---|---|
The `license_id`'s found in the list of entries
|
|
__getitem__(key)
#
Get LicenseEntry by its name
We return the license entry whose license matches key.
Source code in src/input4mips_validation/cvs/license.py
__iter__()
#
LicenseEntry
#
A single license entry
Source code in src/input4mips_validation/cvs/license.py
LicenseValues
#
Values defined by a license
Source code in src/input4mips_validation/cvs/license.py
convert_license_entries_to_unstructured_cv(license_entries)
#
Convert a LicenseEntries to the raw CV form
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
license_entries
|
LicenseEntries
|
License entries |
required |
Returns:
| Type | Description |
|---|---|
Raw CV data
|
|
Source code in src/input4mips_validation/cvs/license.py
convert_unstructured_cv_to_license_entries(unstructured)
#
Convert the raw CV data to a LicenseEntries
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
unstructured
|
LicenseEntriesUnstructured
|
Unstructured CV data |
required |
Returns:
| Type | Description |
|---|---|
License entries
|
|
Source code in src/input4mips_validation/cvs/license.py
load_license_entries(raw_cvs_loader, filename=LICENSE_FILENAME)
#
Load the license 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
|
LICENSE_FILENAME
|
Returns:
| Type | Description |
|---|---|
Loaded license entries
|
|