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

Create ValidateContext #1222

Closed
JoerivanEngelen opened this issue Sep 17, 2024 · 0 comments · Fixed by #1226
Closed

Create ValidateContext #1222

JoerivanEngelen opened this issue Sep 17, 2024 · 0 comments · Fixed by #1226
Assignees

Comments

@JoerivanEngelen
Copy link
Contributor

#1211 introduced some extra settings to the WriteContext. @Manangka mentioned these are getting kind of outside the scope of this object. The WriteContext docstring mentions it is used for writing options, but validation options upon writing were not its intention.

It is probably good to separate the validation settings into a separate context ValidationContext.

@github-project-automation github-project-automation bot moved this to 📯 New in iMOD Suite Sep 17, 2024
@JoerivanEngelen JoerivanEngelen self-assigned this Sep 17, 2024
JoerivanEngelen added a commit that referenced this issue Sep 18, 2024
Fixes #1222

# Description
- Add a ``ValidationContext`` dataclass
- Add a ``_validation_context`` attribute to ``Modflow6Simulation``;
this replaces the ``_is_from_imod5`` attribute.
- The ``ValidationContext`` contains an attribute for strict well
checks, turned on by default. This is set to False when calling
``from_imod5`` or for split simulations.
- Adds a ``_to_mf6_pkg`` method in a similar design as proposed in
#1223, this to preserve public API.
- Refactor ``WriteContext``, to make it a dataclass again. I had to
ignore type annotation for ``write_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.
- Use jit for examples run, this speeds them up considerably. The
examples ran into a TimeOut on TeamCity, and this reduces the change of
that happening again.

# Checklist
<!---
Before requesting review, please go through this checklist:
-->

- [x] Links to correct issue
- [x] Update changelog, if changes affect users
- [x] PR title starts with ``Issue #nr``, e.g. ``Issue #737``
- [ ] Unit tests were added
- [ ] **If feature added**: Added/extended example
@github-project-automation github-project-automation bot moved this from 🧐 In Review to ✅ Done in iMOD Suite Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

1 participant