Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend cdm lite #40

Merged
merged 2 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 9 additions & 15 deletions cdsobs/cdm/lite.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,22 +60,16 @@
"fg_depar@body",
"an_depar@body",
"fg_depar@offline",
"uncertainty_type1",
"uncertainty_value1",
"uncertainty_units1",
"uncertainty_type2",
"uncertainty_value2",
"uncertainty_units2",
"uncertainty_type3",
"uncertainty_value3",
"uncertainty_units3",
"uncertainty_type4",
"uncertainty_value4",
"uncertainty_units4",
"uncertainty_type5",
"uncertainty_value5",
"uncertainty_units5",
]
# Add uncetainty numbered vars programatycally, as they are to many to add by hand to
# the list
number_of_uncertainty_types = 17
uncertainty_numbered_vars = [
f"{unc_var}{n}"
for n in range(number_of_uncertainty_types + 1)
for unc_var in ["uncertainty_value", "uncertainty_type", "uncertainty_units"]
]
optional_variable_names += uncertainty_numbered_vars
auxiliary_variable_names = [
"total_uncertainty",
"positive_total_uncertainty",
Expand Down
7 changes: 2 additions & 5 deletions cdsobs/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import yaml
from pydantic_core.core_schema import ValidationInfo

from cdsobs.cdm.tables import DEFAULT_CDM_TABLES_TO_USE
from cdsobs.utils.exceptions import ConfigError, ConfigNotFound
from cdsobs.utils.types import LatTileSize, LonTileSize, TimeTileSize

Expand Down Expand Up @@ -123,11 +124,7 @@ class DatasetConfig(pydantic.BaseModel):
reader: AvailableReaders | dict[
str, AvailableReaders
] = "cdsobs.ingestion.readers.sql.read_header_and_data_tables"
available_cdm_tables: List[str] = [
"header_table",
"observations_table",
"station_configuration",
]
available_cdm_tables: List[str] = DEFAULT_CDM_TABLES_TO_USE
reader_extra_args: Optional[dict[str, str]] = None
ingestion_db: str = "main"
read_with_spatial_batches: bool = False
Expand Down
Loading