-
Notifications
You must be signed in to change notification settings - Fork 4
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
#369: Support the old style external forcings file #471
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @priscavdsluis : your new additions of yesterday look good.
I did an overall review, please see my suggestions for some minor changes here and there.
@@ -425,66 +455,73 @@ def validate_operand(cls, value): | |||
|
|||
@root_validator(skip_on_failure=True) | |||
def validate_forcing(cls, values): | |||
def alias(field_key: str): | |||
return cls.__fields__[field_key].alias | |||
class Field: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Somewhat confusing name, because this is not the pydantic Field
, maybe rename to _Field
, or LocalField
or CheckField
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
raise ValueError(error) | ||
|
||
only_allowed_when(ifrctype, quantity, ExtOldQuantity.FrictionCoefficient) | ||
only_allowed_when(averagingtype, method, 6) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only_allowed_when(averagingtype, method, 6) | |
only_allowed_when(averagingtype, method, ExtOldMethod.Averaging) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done for each check
|
||
only_allowed_when(ifrctype, quantity, ExtOldQuantity.FrictionCoefficient) | ||
only_allowed_when(averagingtype, method, 6) | ||
only_allowed_when(relativesearchcellsize, method, 6) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only_allowed_when(relativesearchcellsize, method, 6) | |
only_allowed_when(relativesearchcellsize, method, ExtOldMethod.Averaging) |
only_allowed_when(ifrctype, quantity, ExtOldQuantity.FrictionCoefficient) | ||
only_allowed_when(averagingtype, method, 6) | ||
only_allowed_when(relativesearchcellsize, method, 6) | ||
only_allowed_when(extrapoltol, method, 5) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only_allowed_when(extrapoltol, method, 5) | |
only_allowed_when(extrapoltol, method, ExtOldMethod.InterpolateTime) |
only_allowed_when(averagingtype, method, 6) | ||
only_allowed_when(relativesearchcellsize, method, 6) | ||
only_allowed_when(extrapoltol, method, 5) | ||
only_allowed_when(percentileminmax, method, 6) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only_allowed_when(percentileminmax, method, 6) | |
only_allowed_when(percentileminmax, method, ExtOldMethod.Averaging) |
Co-authored-by: Arthur van Dam <arthurvd@gmail.com>
…ltares/HYDROLIB-core into feat/369-support-old-ext-file
""" |
SpatiallyVaryingWeather = 3 | ||
"""3. Spatially varying weather""" | ||
SpatiallyVaryingWindPressure = 3 | ||
"""3. Spatially varying wind and pressure""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a difference between windpressure and wind & pressure?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a difference between windpressure and wind & pressure?
I don't know what windpressure is. This file type here contains three fields: wind (with two vector components) and one airpressure.
@priscavdsluis: Testing current branch status results in correct old extfile with several meteo parameters (airpressure, wind, charnock, solarradiation) and initial conditions (salinity and temperature). So successful test. |
from hydrolib.core.dflowfm.extold.parser import Parser | ||
from hydrolib.core.dflowfm.extold.serializer import Serializer | ||
from hydrolib.core.dflowfm.polyfile.models import PolyFile | ||
from hydrolib.core.dflowfm.tim.models import TimModel | ||
|
||
|
||
class TracerQuantity(str, Enum): | ||
HEADER = """ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you copy paste this from somewhere? 😄
Do you want me to review this header as well? Or, since it is just a header, let the users report any issues with it (if they find any).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes this one was provided by @veenstrajelmer, but we will probably update it to a more recent one or change it such that it conforms to our own implementation.
Tested again and still works successfully |
sourcemask, filetype, valid_dependency_value="4 or 6" | ||
) | ||
|
||
if ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's have a very short discussion if this works as intented. It always confuses me 😊
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nevermind, this should work! 😊
@priscavdsluis After a conversation yesterday, I discovered the quantity |
…ltares/HYDROLIB-core into feat/369-support-old-ext-file
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
@priscavdsluis @tim-vd-aardweg Tested and all works now |
Fixes #369