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

Issue #1222 validation context #1226

Merged

Conversation

JoerivanEngelen
Copy link
Contributor

@JoerivanEngelen JoerivanEngelen commented Sep 17, 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 Remove WriteContext from public API #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

  • Links to correct issue
  • Update changelog, if changes affect users
  • PR title starts with Issue #nr, e.g. Issue #737
  • Unit tests were added
  • If feature added: Added/extended example

@JoerivanEngelen JoerivanEngelen changed the base branch from master to imod5_converter_feature_branch September 17, 2024 15:51
@JoerivanEngelen JoerivanEngelen marked this pull request as ready for review September 18, 2024 09:51
Copy link

sonarcloud bot commented Sep 18, 2024

Copy link
Collaborator

@Manangka Manangka left a 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):
Copy link
Collaborator

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

@JoerivanEngelen JoerivanEngelen merged commit 46c2e85 into imod5_converter_feature_branch Sep 18, 2024
6 checks passed
@JoerivanEngelen JoerivanEngelen deleted the issue_#1222_ValidationContext branch September 18, 2024 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create ValidateContext
2 participants