Deltares / imod-python

🐍🧰 Make massive MODFLOW models
https://deltares.github.io/imod-python/
MIT License
17 stars 3 forks source link

Model checks #74

Open Manangka opened 5 years ago

Manangka commented 5 years ago

In GitLab by @Huite on Jun 20, 2019, 18:05

After a short discussion with Martijn, we came up with a general checking "framework":

In general however, we can only spot conceptual errors after an initial (steady-state heads) run. We might be able to write a few functions to facilitate analysis of these outputs (e.g. plots of where the velocities are highest, distributions of velocities, etc.).

Manangka commented 5 years ago

In GitLab by @Huite on Jul 1, 2019, 11:14

I've made a start with these checks in a0f55e3f4717f3e626182e405d2db7106e147d61

I've tested them quickly with a model. Seems to be going okay.

TODO:

There's one part which I'm wondering about, whether to constrain input types. My feeling now is that we shouldn't, since it goes against Python's duck typing. The type hints (#65) should provide sufficient info. What's interesting is that you can, if you want to, directly provide (string) paths to the Packages. These will get written into the runfile without having to load the data. It's a bit risky, so it shouldn't be used in general, but I can think of cases where it's convenient. The package checks will fail on this now: you cannot compare a numpy array of type string with an integer to check if it's positive -- So maybe add an exception for specifically for strings?

Thinking a little further: we might use arrays of pathlib.Path instead. Currently, you'd have to do some figuring out how to set the paths properly, from the ultimate working directory. We could simplify this by resolving the relative paths. You'd have to introspect the arrays (check dtype = 'O' first), then check the first element, maybe. The benefit is that paths have to be provided as Pathlib.path, giving more specificity than just a basic string (which is a valid input for many parameters).

Manangka commented 4 years ago

In GitLab by @visr on Oct 28, 2019, 14:15

unassigned @visr