-
Notifications
You must be signed in to change notification settings - Fork 6
Issue #1222 validation context #1226
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
Issue #1222 validation context #1226
Conversation
…defaults accordingly
|
Manangka
left a comment
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.
This cleans things up neatly!
| use_absolute_paths: bool = False | ||
| write_directory: Path = None # type: ignore | ||
|
|
||
| def __post_init__(self): |
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.
Nice. Didn't know about this method



Fixes #1222
Description
ValidationContextdataclass_validation_contextattribute toModflow6Simulation; this replaces the_is_from_imod5attribute.ValidationContextcontains an attribute for strict well checks, turned on by default. This is set to False when callingfrom_imod5or for split simulations._to_mf6_pkgmethod in a similar design as proposed in RemoveWriteContextfrom public API #1223, this to preserve public API.WriteContext, to make it a dataclass again. I had to ignore type annotation forwrite_directory, otherwise MyPy would throw errors. The whole property shebang presumably started with MyPy throwing errors. Reverting it back to a dataclass reduces the lines of code considerably, which makes it more maintainable.Checklist
Issue #nr, e.g.Issue #737