input4mips_validation.cvs#
| Sub-package | Description |
|---|---|
| activity_id | Activity ID CV handling |
| author | Definition of an author of a dataset. |
| cvs | Data model of the controlled vocabularies (CVs) |
| drs | Data reference syntax data model |
| exceptions | Exceptions related to CVs |
| institution_id | Institution ID CV handling |
| license | License CV handling |
| loading | Loading of CVs from a given source |
| loading_raw | Tools for loading the raw CVs |
| source_id | Source ID CV handling |
input4mips_validation.cvs
#
Controlled vocabularies (CVs) handling
Input4MIPsCVs
#
Data model of input4MIPs' CVs
Source code in src/input4mips_validation/cvs/cvs.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 | |
DRS: DataReferenceSyntax
instance-attribute
#
Data reference syntax used with these CVs
activity_id_entries: ActivityIDEntries
instance-attribute
#
Activity ID entries
institution_ids: tuple[str, ...]
instance-attribute
#
Recognised institution IDs
license_entries: LicenseEntries
instance-attribute
#
License entries
raw_loader: RawCVLoader
instance-attribute
#
Object used to load the raw CVs
source_id_entries: SourceIDEntries
instance-attribute
#
Source ID entries
validate_activity_id(value)
#
Validate that a value of activity ID is valid
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
str
|
Value to validate |
required |
Raises:
| Type | Description |
|---|---|
ValueNotAllowedByCVsError
|
The provided value is not allowed by the CVs |
Source code in src/input4mips_validation/cvs/cvs.py
validate_contact(value, source_id)
#
Validate that a value of contact is valid
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
str
|
Value to validate |
required |
source_id
|
str
|
Source ID value This is required because the source ID defines what the expected value of contact is. |
required |
Raises:
| Type | Description |
|---|---|
ValueInconsistentWithCVsError
|
The provided value is not the correct value according to the CVs
and the value of |
Source code in src/input4mips_validation/cvs/cvs.py
validate_source_version(value, source_id)
#
Validate that a value of source version is valid
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
str
|
Value to validate |
required |
source_id
|
str
|
Source ID value This is required because the source ID defines what the expected value of source_version is. |
required |
Raises:
| Type | Description |
|---|---|
ValueInconsistentWithCVsError
|
The provided value is not the correct value according to the CVs
and the value of |
Source code in src/input4mips_validation/cvs/cvs.py
load_cvs(cv_source=None, **kwargs)
#
Load CVs
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cv_source
|
None | str | Path
|
String identifying the source of the CVs. For full details of possible options, see
|
None
|
kwargs
|
Any
|
Passed through to
|
{}
|
Returns:
| Type | Description |
|---|---|
Input4MIPsCVs
|
Loaded CVs |