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

feat: add default variable schema for qc test #44

Merged
merged 2 commits into from
Jan 15, 2025
Merged
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
13 changes: 10 additions & 3 deletions atmos_validation/schemas/parameter_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@
from .dim_constants import get_acceptable_dims_from_parameter_key


class DefaultVariable(BaseModel):
"""Describes a default variable for a QC Test."""

name: str
description: str = Field(default="")
value: Union[int, float, Tuple, str]
unit_description: str = Field(default="")


class QCTest(BaseModel):
"""Describes a test to be run on a given parameter. QC tests are defined by metocean.
The default parameters are configured by those with admins access.
Expand All @@ -14,9 +23,7 @@ class QCTest(BaseModel):
test_id: str = Field(default_factory=lambda: uuid.uuid4().hex)
long_name: str = Field(default="")
metocean_pkg_ref: str = Field(default="") # standard_name field
default_variables: List[Tuple[str, str, Union[int, float, Tuple], str]] = Field(
default_factory=list
)
default_variables: List[DefaultVariable] = Field(default_factory=list)
description: str = Field(default="")


Expand Down
Loading