-
Notifications
You must be signed in to change notification settings - Fork 10
Converting MFP CSV to YAML schedule #111
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
Changes from 15 commits
5c5bf9a
40c7ff9
366dede
d046444
e3199fa
d9fe46a
7dc9bd7
a79433c
11332f8
ad54992
66adb18
2672afa
a370641
b87d944
eba08b8
c0a52ac
526d2af
c51043d
f3daaa7
4c59420
b67b15d
6f63cd4
222df85
c94567b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,6 +12,7 @@ dependencies: | |
| - pip | ||
| - pyyaml | ||
| - copernicusmarine >= 2 | ||
| - openpyxl >= 3.1.5 | ||
|
|
||
| # linting | ||
| - pre-commit | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,3 +9,5 @@ class InstrumentType(Enum): | |
| CTD = "CTD" | ||
| DRIFTER = "DRIFTER" | ||
| ARGO_FLOAT = "ARGO_FLOAT" | ||
| XBT = "XBT" | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,20 +38,19 @@ def _check_lon_lat_domain(self) -> Self: | |
| raise ValueError("minimum_depth must be less than maximum_depth") | ||
| return self | ||
|
|
||
|
|
||
| class TimeRange(BaseModel): | ||
| """Defines the temporal boundaries for a space-time region.""" | ||
|
|
||
| start_time: datetime | ||
| end_time: datetime | ||
| start_time: datetime | None = None | ||
| end_time: datetime | None = None | ||
|
|
||
| @model_validator(mode="after") | ||
| def _check_time_range(self) -> Self: | ||
| if not self.start_time < self.end_time: | ||
| raise ValueError("start_time must be before end_time") | ||
| if self.start_time and self.end_time: | ||
| if not self.start_time < self.end_time: | ||
| raise ValueError("start_time must be before end_time") | ||
| return self | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @VeckoTheGecko @ammedd
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see. I thought that pydantic would have a way of disabling validation during the initialisation of the object, but looking further at the documentation its looking that that isn't possible ... . Longterm it would be good to have |
||
|
|
||
|
|
||
| class SpaceTimeRegion(BaseModel): | ||
| """An space-time region with spatial and temporal boundaries.""" | ||
|
|
||
|
|
||
iuryt marked this conversation as resolved.
Show resolved
Hide resolved
|
Uh oh!
There was an error while loading. Please reload this page.