climate_ref.doctor.checks.data
#
Checks over the data a deployment has ingested.
These look for the conditions that make a solve quietly do the wrong thing rather than fail: reference data that no diagnostic can reach, reference data that is missing so its diagnostics never run, obs4REF data ingested under the obs4MIPs source type, obs4REF data that obs4MIPs has since published, datasets whose files cover the same period twice, and diagnostics the ingested data cannot solve at all.
check_duplicate_coverage(context)
#
Find datasets holding more than one file for the same period.
This happens when the same dataset is ingested from two collections at the same version:
the files merge into one dataset because they share an instance_id,
and every diagnostic reading it then sees the overlapping period twice.
The obs4REF registry and the obs4MIPs archive both carry several datasets, so ingesting both triggers it.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
context
|
DoctorContext
|
The deployment to check. |
required |
Returns:
| Type | Description |
|---|---|
list[Finding]
|
One finding per dataset with overlapping files. |
Source code in packages/climate-ref/src/climate_ref/doctor/checks/data.py
check_misfiled_obs4ref(context)
#
Find obs4REF data that was ingested as obs4MIPs.
Earlier releases ingested the obs4REF collection this way, and it still solves. The cost is that the catalog no longer shows which datasets came from the registry and which from the archive, and a later obs4MIPs publication cannot take over from it.
A dataset counts as obs4REF when its files sit under an obs4REF directory,
which is how the registry lays them out.
Carrying a source_id the registry also carries is not enough,
because the four datasets published to both archives are legitimately ingested as obs4MIPs.
The file's own activity_id is stamped from the source type at ingest,
so only the ingest-time warning can use it.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
context
|
DoctorContext
|
The deployment to check. |
required |
Returns:
| Type | Description |
|---|---|
list[Finding]
|
One finding per misfiled dataset, all sharing the one remedy. |
Source code in packages/climate-ref/src/climate_ref/doctor/checks/data.py
check_missing_reference_data(context)
#
Find reference datasets the enabled diagnostics require but which are not ingested.
An unmet reference requirement is silent: the diagnostic simply plans no executions, so a deployment can look healthy while producing nothing for whole diagnostics.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
context
|
DoctorContext
|
The deployment to check. |
required |
Returns:
| Type | Description |
|---|---|
list[Finding]
|
One finding per required dataset that is not ingested. |
Source code in packages/climate-ref/src/climate_ref/doctor/checks/data.py
check_overlapping_registries(context)
#
Report datasets that more than one registry carries.
Fetching both copies is what produces the duplicate coverage that check_duplicate_coverage finds,
so this is the warning before the error.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
context
|
DoctorContext
|
The deployment to check. |
required |
Returns:
| Type | Description |
|---|---|
list[Finding]
|
One finding per dataset carried by more than one registry. |
Source code in packages/climate-ref/src/climate_ref/doctor/checks/data.py
check_superseded_obs4ref(context)
#
Find obs4REF datasets that lose to an ingested obs4MIPs copy.
The solver takes the newest version, and the obs4MIPs copy on a tie, so these rows are never used. This is the signal that a dataset can be dropped from the obs4REF registry.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
context
|
DoctorContext
|
The deployment to check. |
required |
Returns:
| Type | Description |
|---|---|
list[Finding]
|
One finding per superseded obs4REF dataset. |
Source code in packages/climate-ref/src/climate_ref/doctor/checks/data.py
check_unreachable_source_types(context)
#
Find data ingested under a source type that no enabled diagnostic asks for.
The solver only matches a requirement against its own source type and its declared fallbacks, so data ingested under a type nothing asks for is never selected.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
context
|
DoctorContext
|
The deployment to check. |
required |
Returns:
| Type | Description |
|---|---|
list[Finding]
|
One finding per source type that holds data nothing asks for. |
Source code in packages/climate-ref/src/climate_ref/doctor/checks/data.py
check_unsolvable_diagnostics(context)
#
Find enabled diagnostics that the ingested data cannot solve at all.
This runs the solver against the ingested catalogs, diagnostic by diagnostic, so it catches everything the narrower checks do not:
- a filter no dataset matches
- a constraint no group satisfies
- a source type nothing was ingested under
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
context
|
DoctorContext
|
The deployment to check. |
required |
Returns:
| Type | Description |
|---|---|
list[Finding]
|
One finding per diagnostic with no executions. |