ghg_forcing_for_cmip.validation#
In this module the validation schemes are stored
used to validate columns in the created dataframe after scraping of data
Classes:
| Name | Description |
|---|---|
EODataRow |
Validates a single row of satellite data. |
GroundDataRow |
Validates a single row of ground station data (NOAA/AGAGE). |
Functions:
| Name | Description |
|---|---|
compute_discrepancy_collocated |
Compute rmse per site code in collocated data |
validate_eo_dataframe |
Iterate over DataFrame rows and validates them against the Pydantic model. |
validate_gb_dataframe |
Iterate over DataFrame rows and validates them against the Pydantic model. |
EODataRow #
Bases: BaseModel
Validates a single row of satellite data.
Methods:
| Name | Description |
|---|---|
validate_year_le_now |
Validate year is not in the future |
Source code in src/ghg_forcing_for_cmip/validation.py
validate_year_le_now
classmethod
#
Validate year is not in the future
Source code in src/ghg_forcing_for_cmip/validation.py
GroundDataRow #
Bases: BaseModel
Validates a single row of ground station data (NOAA/AGAGE).
Methods:
| Name | Description |
|---|---|
validate_year_le_now |
Validate year is not in the future |
Source code in src/ghg_forcing_for_cmip/validation.py
validate_year_le_now
classmethod
#
Validate year is not in the future
Source code in src/ghg_forcing_for_cmip/validation.py
compute_discrepancy_collocated #
Compute rmse per site code in collocated data
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
d
|
DataFrame
|
data frame with collocated data |
required |
gas
|
str
|
either "ch4" or "co2" |
required |
measure
|
str
|
either "rmse" or "dcor"; rmse: stands for root mean squared error d_cor: refers to the correlation difference (1-cor) |
required |
Returns:
| Type | Description |
|---|---|
DataFrame
|
dataframe with measure information |
Source code in src/ghg_forcing_for_cmip/validation.py
validate_eo_dataframe #
validate_eo_dataframe(df: DataFrame) -> None
Iterate over DataFrame rows and validates them against the Pydantic model.
Source code in src/ghg_forcing_for_cmip/validation.py
validate_gb_dataframe #
validate_gb_dataframe(df: DataFrame) -> None
Iterate over DataFrame rows and validates them against the Pydantic model.