Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add Github template for pull requests #737

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

Closed
JoerivanEngelen opened this issue Jan 10, 2024 · 0 comments · Fixed by #758
Closed

Add Github template for pull requests #737

JoerivanEngelen opened this issue Jan 10, 2024 · 0 comments · Fixed by #758

Comments

@JoerivanEngelen
Copy link
Contributor

JoerivanEngelen commented Jan 10, 2024

It would be helpful to introduce a template for PRs with a checklist of things to consider/include. This would help avoiding some common mistakes developers make (including myself). For example in about half of the merged PRs, we forget to update the changelog with relevant info for the user, which then has to be added later.

Things to include in the the checklist/definition of done:

  • Link to issue
  • Description of changes broadly made and how they are going to fix the issue
  • Update changelog, if changes are relevant to the users (e.g. bugfix, API changes, changes in behaviour)
  • PR title starts with issue number, like #737
@JoerivanEngelen JoerivanEngelen moved this to 🤝 Accepted in iMOD Suite Jan 10, 2024
@JoerivanEngelen JoerivanEngelen moved this from 🤝 Accepted to 🧐 In Review in iMOD Suite Jan 19, 2024
@github-project-automation github-project-automation bot moved this from 🧐 In Review to ✅ Done in iMOD Suite Jan 22, 2024
github-merge-queue bot pushed a commit that referenced this issue Jan 22, 2024
Fixes #767

# Description
The GitLab pipeline is no longer needed and is removed in this commit

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

- [x] Links to correct issue
- [ ] 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-merge-queue bot pushed a commit that referenced this issue Jan 24, 2024
Fixes #774 

# Description
Build in #760 fails for
test_rasterio_ascii

``test_rasterio_ascii`` doesn't work for GDAL 3.8.3 compared to 3.7.3. 

Previously it was tested if files are exactly identical. This defeats
the purpose, more important is that GDAL can read the file and
interprets the file equal as if it were written with GDAL. Replacing
``assert_equal_content`` with the changes fixes things.

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

- [x] Links to correct issue
- [ ] Update changelog, if changes affect users
- [x] PR title starts with ``Issue #nr``, e.g. ``Issue #737``
- [x] Unit tests were added
- [ ] **If feature added**: Added/extended example
github-merge-queue bot pushed a commit that referenced this issue Jan 24, 2024
…ightly build (#771)

Fixes #748

# Description
The unit tests and examples were failing when run against the latest
MODFLOW6 nightly. This is caused by a change on the MODFLOW6 side were
any gwf-gwt exchanges has to have an actual existing file (even though
it is emty).
The precious behaviour was that just mentioning the gwf-gwt exchanges in
the nam file was enough.

This commit adds the gwfgwt package. It uses the same logic as the
gwfgwf exchanges in terms of how it is written to disk.
Any common methods between the different type of exchanges has been
moved to the newly created ExchangeBase class

**Note**
I didn't add any unit tests for the simulation class. The reason for
this is twofold:
- I moved code around, no major functional changes
- We have to refactor they way the gwf-gwt exchanges are being created
the moment we start working on the multimodel support for gwt, making
any unit tests I add obsolete

# 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``
- [x] Unit tests were added
- [ ] **If feature added**: Added/extended example
github-merge-queue bot pushed a commit that referenced this issue Jan 26, 2024
Fixes #779

# Description
This commit rotates the TeamCity token in the pipeline scripts

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

- [x] Links to correct issue
- [ ] 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-merge-queue bot pushed a commit that referenced this issue Jan 26, 2024
Fixes #757

# Description
This commit adds a nightly pipeline.
The goal of the nightly pipeline is to build or repository against the
latest development branch of MODFLOW.
This will allow us to catch breaking changes early on.

The pipeline file has been refactored to prevent code duplication. This
has been accomplished by using templates.
The new nightly pipeline is added as a new subproject of the main
project

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

- [x] 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
github-merge-queue bot pushed a commit that referenced this issue Jan 29, 2024
Fixes #785

Due to a recent refactor of the pipeline a trigger is missing from the
pipeline script. As a result builds are not started automatically.
This commit restores the trigger

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

- [x] Links to correct issue
- [ ] 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-merge-queue bot pushed a commit that referenced this issue Jan 29, 2024
Fixes #746

# Description
Fixes the slice_model function to slice transport models as well. 
Includes changes to the Advection package. The advection scheme
parameter is set by the constructors of derived types of advection.
Trying to reinitialize the derived type throws an error, as its
construction method doesn't expect arguments. As a pragmatic solution,
the constructor methods now get a ``**ignored`` argument to ignore these
kwargs.


- [x] Links to correct issue
- [ ] Update changelog, if changes affect users
- [x] PR title starts with ``Issue #nr``, e.g. ``Issue #737``
- [x] Unit tests were added
- [ ] **If feature added**: Added/extended example
github-merge-queue bot pushed a commit that referenced this issue Jan 31, 2024
Fixes #783

This commit fixes all remaining MyPy errors in the mf6 module

The PR is split in several commits, each commit contains a certain file
in which the mypy errors are fixes or exist of a type of error that
crosses multiple files. I suggest reviewing this PR commit by commit.

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

- [x] Links to correct issue
- [ ] 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-merge-queue bot pushed a commit that referenced this issue Jan 31, 2024
…tation (#794)

Fixes #793
This commit fixes all warnings and errors produced during the creation
of the documentation

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

- [x] Links to correct issue
- [ ] 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
luitjansl added a commit that referenced this issue Feb 1, 2024
Fixes #788  and #789 

# Description
now adds split models to the solution group (ims) that the source model
belonged to.
When writing a split simulation with flow and transport, gwfgwt
exchanges are created. The models are connected based on type and
domain.

# Checklist

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

---------

Co-authored-by: Joeri van Engelen <[email protected]>
github-merge-queue bot pushed a commit that referenced this issue Feb 2, 2024
Fixes #809

This commit updates the dependencies of the project.
There are some issues with the latest dask packag,s which isn;t playing
nice with raterio, and with the pytest package, which has issues with
pytest-cases. I've pinned both packages to a version that doesn't cause
any issue.
Further there has been an update of black which results in a new
formatting rule being applied.

Hopefully this is the last time we have to update manually as the
pipeline script to do this automatically is almost done

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

- [x] Links to correct issue
- [ ] 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-merge-queue bot pushed a commit that referenced this issue Feb 2, 2024
…dencies to the latest version (#804)

Fixes #795

This commit adds a pipeline that periodically updates the project
dependencies.
It runs every sunday at 15:00. When changes are found a new update
branch is pushed and a PR is created.

The created PR in turn will trigger the normal build pipeline so all the
regular checks are run against this branch.
If any of the tests fail they should be fixes as part of the created PR

Reviewers are automatically assigned in this case that are @luitjansl
and @JoerivanEngelen

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

- [x] Links to correct issue
- [ ] 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
Manangka added a commit that referenced this issue Feb 2, 2024
…dencies to the latest version (#804)

Fixes #795

This commit adds a pipeline that periodically updates the project
dependencies.
It runs every sunday at 15:00. When changes are found a new update
branch is pushed and a PR is created.

The created PR in turn will trigger the normal build pipeline so all the
regular checks are run against this branch.
If any of the tests fail they should be fixes as part of the created PR

Reviewers are automatically assigned in this case that are @luitjansl
and @JoerivanEngelen

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

- [x] Links to correct issue
- [ ] 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-merge-queue bot pushed a commit that referenced this issue Feb 5, 2024
Fixes #813

# Description
<!---
Thanks for opening a PR!

Please add your description here of changes made and how they are going
to
resolve the linked issue 
-->

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

- [x] Links to correct issue
- [ ] 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
luitjansl added a commit that referenced this issue Feb 5, 2024
Fixes #765 

# Description
creates gwtgwt exchange packages when splitting a simulation that
contains 1 or more transport models. A gwtgwt package is created per
partition boundary and per transport model. (while the geometry
constants are the same for all transport models, the options in the
gwtgwt file are specific to single transport models. However, for now,
these settings are not set; this will be the topic of #747
Also adds tests.

 Checklist

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

---------

Co-authored-by: Joeri van Engelen <[email protected]>
github-merge-queue bot pushed a commit that referenced this issue Feb 5, 2024
Fixes #816 

This commit adds a MyPy build step to the build pipeline.
It will run as part of the regular build as well for the nightly build
Both the mypy_report as the regular mypy commands are called. The first
command produces a report that can be displayed in teamcity the same way
unit tests are. The second command will also give an output to the build
log

- [x] Links to correct issue
- [ ] 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-merge-queue bot pushed a commit that referenced this issue Feb 5, 2024
Fixes #805 

# Description
Validation of concentrations was missing for the DRN, WEL, and EVT
package. This PR:
* Adds validation schemata to the DRN and EVT
* Adds ``AnyNodataSchema``
* Validate if ``Well`` has no nodata for certain variables.

I was struggling a bit with the linting/formatting it appears that we
are running both ``black `` as well as ``ruff`` which causes changes.

# 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``
- [x] Unit tests were added
- [ ] **If feature added**: Added/extended example
JoerivanEngelen added a commit that referenced this issue Feb 5, 2024
Fixes #798 

When we split a simulation of both flow and transport models, the ssm
package of the transport simulation is re-generated after splitting,
because not every flow boundary will be present in every partition.


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

---------

Co-authored-by: Joeri van Engelen <[email protected]>
github-merge-queue bot pushed a commit that referenced this issue Feb 5, 2024
Fixes #763

# Description
<!---
Thanks for opening a PR!

Please add your description here of changes made and how they are going
to
resolve the linked issue 
-->

* Remove dev dependencies from pyproject.toml
* Synchronizes package versions in with pyproject.toml and pixi.toml
* Add hatchling to pixi.toml
* Updates lock file

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

- [x] Links to correct issue
- [ ] 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
luitjansl added a commit that referenced this issue Feb 5, 2024
Fixes #747 

# Description
assigns the advection scheme and dispersion xt3d options to the gwtgwt
package. They are written into the options block of said file.

- [X] Links to correct issue
- [ ] Update changelog, if changes affect users
- [X] PR title starts with ``Issue #nr``, e.g. ``Issue #737``
- [X] Unit tests were added
- [ ] **If feature added**: Added/extended example
JoerivanEngelen pushed a commit that referenced this issue Feb 6, 2024
Fixes #823 

# Description
Fixes a typo in the 1d transport model splitting test. Now that it's
fixed tolerances for the comparison could be made much stricter

# Checklist

- [X] Links to correct issue
- [ ] 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-merge-queue bot pushed a commit that referenced this issue Feb 6, 2024
Fixes #826

This commit replaces the black linter/formatter in favor of the ruff
linter/formatter.
The ruff and black formatter are 99% compatible but they vary just
slightly.
This causes issues when calling the `pixi run format` task because they
counteract each other.

A full list of differences between black and ruff can be found at:
https://docs.astral.sh/ruff/formatter/black/

The changes to review are in the pixi.toml file. All other changes are
made by the ruff formatter.

- [x] Links to correct issue
- [ ] 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-merge-queue bot pushed a commit that referenced this issue Jan 28, 2025
Fixes #1392 

# Description
Changes default to better match iMOD5. 

- Reverted the default of ``SimulationAllocationOptions.riv`` back to
what it was in the previous version, as this matches iMOD5's default
setting.
- Set ``SimulationAllocationOptions.drn`` to
``ALLOCATION_OPTION.at_elevation``, to match iMOD5's default setting.

# 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-merge-queue bot pushed a commit that referenced this issue Jan 31, 2025
Fixes #1395

# Description
Use proper value for missing layers in projectfile.

# 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``
- [x] Unit tests were added
- [ ] **If feature added**: Added/extended example
github-merge-queue bot pushed a commit that referenced this issue Jan 31, 2025
Fixes #1391 

# Description
- Add ``DISTRIBUTING_OPTION.by_corrected_thickness`` setting. 
- Move logic to compute correction factors into separate function.

# Checklist

- [x] Links to correct issue
- [x] Update changelog, if changes affect users
- [x] PR title starts with ``Issue #nr``, e.g. ``Issue #737``
- [x] Unit tests were added
- [ ] **If feature added**: Added/extended example
github-merge-queue bot pushed a commit that referenced this issue Feb 3, 2025
Fixes #1402

# Description
Adds known issue on literal well edge case.

# Checklist

- [x] Links to correct issue
- [ ] 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-merge-queue bot pushed a commit that referenced this issue Feb 3, 2025
Fixes #1399

# Description
This PR sets better defaults for ``minimum_k`` and
``minimum_thickness``. See linked issue.

# Checklist

- [x] Links to correct issue
- [x] Update changelog, if changes affect users
- [x] PR title starts with ``Issue #nr``, e.g. ``Issue #737``
- [x] Unit tests were added
- [ ] **If feature added**: Added/extended example
github-merge-queue bot pushed a commit that referenced this issue Feb 4, 2025
Fixes #1317 and #1331

# Description
With `Numba` now also supporting python 3.13 we can also add 3.13
support to iMOD-python.
This PR adds a 3.13 environment to the pixi.toml and also adds an import
test of it to the TC pipelines.

One line of code had to be rwritten to be 3.13 compatible. The
`importlib.resources.files` no longer provides a context manager and has
to wrapped using the `importlib.resources.as_file` method

# Checklist
<!---
Before requesting review, please go through this 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 added a commit that referenced this issue Feb 18, 2025
Fixes #1207 

# Description
Exclude tests and examples from analysis

# Checklist

- [x] Links to correct issue
- [ ] 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-merge-queue bot pushed a commit that referenced this issue Feb 19, 2025
Fixes #914

# Description
In validation messages, change tabs to four spaces and change aterisk to
dash.

# Checklist

- [x] Links to correct issue
- [x] Update changelog, if changes affect users
- [x] PR title starts with ``Issue #nr``, e.g. ``Issue #737``
- [x] Unit tests were added
- [ ] **If feature added**: Added/extended example
github-merge-queue bot pushed a commit that referenced this issue Feb 21, 2025
Fixes #1445

It turned out this performance issue pertained from a performance issue
where calling ``xr.DataArray().isin(pd.Series())`` was very slow for
large datasets, whereas ``pd.Series().isin(pd.Series())`` was a lot
faster.

# Description
- Fix performance issue when writing large MODFLOW6 WEL packages
- Add test which tests this performance, I had to add a small pytest
plugin for 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``
- [x] Unit tests were added
- [ ] **If feature added**: Added/extended example
github-merge-queue bot pushed a commit that referenced this issue Feb 25, 2025
Fixes #1437 

# Description
``primod`` expects a 2D rate array or single layer array for the dummy
MODFLOW6 package, as otherwise the ``squeeze("layer")`` it does returns
an error. I think the safest for iMOD Python is to return a 2D array
with extra layer coordinate. I added some extra tests to test if this
RCH package could be clipped and regridded, as in most/all fixtures for
clipping/regridding I added packages with layer dimension. Luckily these
two extra tests turned out to be mostly for my own peace of mind, as
they ran without problems.

# Checklist
- [x] Links to correct issue
- [x] Update changelog, if changes affect users
- [x] PR title starts with ``Issue #nr``, e.g. ``Issue #737``
- [x] Unit tests were added
- [ ] **If feature added**: Added/extended example
github-merge-queue bot pushed a commit that referenced this issue Feb 25, 2025
Fixes #1436 

# Description
Work around Dask issue by forcing a load of idomain and svat into
memory. These grids will never be as large as the boundary condition
grids with a time axis, so I think it is acceptable. At least for the
LHM it is. I couldn't get it to work with a ``where``: numpy only
accepts 1D arrays on a boolean indexed 3D as long as the 1D array has
the length of one of the dimensions, it then does what we want to do
here. However when this is not the case, which is 95% of the time, numpy
throws an error. I therefore had to resort to loading arrays into
memory.

Furthermore I refactored ``test_coupler_mapping.py`` to be able to
reduce some code duplication and add a test case with a dask array. For
this I had to make the well package used consistent (From 2 wells to 3
wells, where the second well now lays on y=2.0 instead of y=1.0), so I
updated some of the assertions.

# Checklist
- [x] Links to correct issue
- [x] Update changelog, if changes affect users
- [x] PR title starts with ``Issue #nr``, e.g. ``Issue #737``
- [x] Unit tests were added
- [ ] **If feature added**: Added/extended example
github-merge-queue bot pushed a commit that referenced this issue Feb 26, 2025
Fixes #1457 

Removes ``flow`` module, it has hardly seen any use. Reduces clutter,
scope, potential hurdles to getting familiar with the code base, and
potential maintenance.

# Description
- Remove ``flow`` module
- Remove unittests for ``flow``
- Remove iMODFLOW examples
- Remove notions that iMOD Python can generate iMODFLOW models from
README
- Update changelog, so that there are no crossrefs to be removed 

I also tested generating the docs, so that there are no errors thrown.

# 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-merge-queue bot pushed a commit that referenced this issue Feb 26, 2025
…aces`` (#1456)

Fixes #1454 

# Description
- Move ``imod.mf6.interfaces`` to ``imod.common.interfaces``
- Move ``imod.mf6.statusinfo.py`` to ``imod.common.statusinfo.py``

I had to move the ``statusinfo.py`` as it was imported in
``imod.common.interfaces.IModel``.

# Checklist
- [x] Links to correct issue
- [ ] 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
JoerivanEngelen added a commit that referenced this issue Feb 28, 2025
Fixes #1465

# Description
- Move ``mask`` utilities to common utilities. 
- Move aux variable logic to ``Package.mask`` and refactor it
- Move two generic utilities from ``imod.mf6.utilities.dataset.py`` to
``imod.common.utilities.value_filters.py``
- Move generic schemata utility module to common utilities

# Checklist
- [x] Links to correct issue
- [ ] 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
JoerivanEngelen added a commit that referenced this issue Feb 28, 2025
Fixes #1414 

# Description
- Adds ``cleanup_hfb`` function to clip barrier lines/Z polygons outside
the active domain. This unfortunately cannot deal with the edge case
where a hfb line is snapped to the outer edge of the active domain.
(These edges are filtered out when calling ``to_mf6_pkg``, but a
ValidationError is thrown when ``strict_hfb_validation`` is switched
on).
- Adds ``HorizontalFlowBarrierBase.cleanup`` method
- Moves some utility functions from ``imod.mf6.utilities`` to
``imod.prepare.hfb`` and ``imod.util.hfb``, to avoid circular imports.

# 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``
- [x] Unit tests were added
- [ ] **If feature added**: Added/extended example
JoerivanEngelen added a commit that referenced this issue Mar 5, 2025
Fixes #483

# Description
Adds relevant and adapted unittests from DIS package to unittest for
DISV package

# Checklist
- [x] Links to correct issue
- [ ] Update changelog, if changes affect users
- [x] PR title starts with ``Issue #nr``, e.g. ``Issue #737``
- [x] Unit tests were added
- [ ] **If feature added**: Added/extended example
JoerivanEngelen added a commit that referenced this issue Mar 6, 2025
Fixes #442 and #542

# Description
@HendrikKok asked me to clip a model for him to send it to Wageningen
and I thought this would be a trivial exercise, only I realized we still
lacked MetaSWAP clipping support. I noticed this was low-hanging fruit,
so instead of writing some special one-off script, I thought I might as
well add it to iMOD Python immediately.

This PR:

- Small refactor: Move clipping logic in ``imod.mf6.Package.clip_box``
to ``imod.common.utilities.clip`` module.
- Adds support to clip MetaSWAP packages
- Add unittests
- Boyscouting: Move clipping tests to ``test_common/test_utilities``
- Boyscouting: Move confusing name ``test_common.py`` to
``test_prepare/test_common.py``

# Checklist
- [x] Links to correct issue
- [ ] Update changelog, if changes affect users
- [x] PR title starts with ``Issue #nr``, e.g. ``Issue #737``
- [x] Unit tests were added
- [ ] **If feature added**: Added/extended example
github-merge-queue bot pushed a commit that referenced this issue Mar 7, 2025
Fixes #1480

# Description
We are experiencing flaky builds on the TeamCity build server.

A theory is that the builds are failing due to pull collisions when the
docker images are pulled at the start of a build.
By disabling the 'explicit pull' option this might happen less frequent

With this change an image will only be pulled when its not present on
the agent. If the image is overwritten on the registry the old image has
to be manually removed from the agents
# Checklist
<!---
Before requesting review, please go through this 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 added a commit that referenced this issue Mar 10, 2025
Fixes #443 and #364

# Description

* Adds clipping method to ``imod.msw.MetaSwapModel``, this includes a
special case for ``clip_box`` method of PrecipitationMapping, and
EvapotranspirationMapping: These should not be clipped if a
``MeteoGridCopy`` instance is part of the model. Otherwise nonsensical
mappings are generated.
* Add ``imod.msw.MetaSwapModel.clip_box`` method to public API
* Override ``clip_box`` method in MeteoMapping, should clip meteo
attribute instead of dataset attribute.
* Refactor: Move time slice clipping logic to
``imod.common.utilities.clip``.
* Refactor: Make ``meteo`` class variable an attribute. This makes more
sense. I think I made it a class variable before to please mypy.
* Boyscouting: Add some extra docstring information on usecase to
``imod.msw.MeteoGridCopy``

# Checklist
- [x] Links to correct issue
- [x] Update changelog, if changes affect users
- [x] PR title starts with ``Issue #nr``, e.g. ``Issue #737``
- [x] Unit tests were added
- [ ] **If feature added**: Added/extended example
JoerivanEngelen added a commit that referenced this issue Mar 10, 2025
Fixes #492

# Description
Adds some simple logging to the simulation object. I didn't add solver
settings, these are listed in the .ims file. I also didn't add stdout of
MODFLOW6, as this is already logged in the LIST file and would require
some extra work.

Furthermore some boyscouting: fix some easy-to-fix issues raised by
Sonarcloud:

- Remove unreachable return statements
- Don't use caps in variable's name

# 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
JoerivanEngelen added a commit that referenced this issue Mar 21, 2025
Fixes #1492

# Description
Replace fastcore typedispatching with plum's dispatching.
Plum is a bit stricter, which I generally think is good. When fastcore's
typedispatching didn't encounter a typedispatched fallback function for
type ``Any``, for some reason things worked, but I'm not sure what it
did. Plum is stricter so I had to explicitly had to add some fallback
functions to either raise an error or do something.

In detail, this PR
- Replaces @typedispatch with a plum Dispatcher instance, this also
limits the scope for accidentily adding typedispatched functions in
other modules
- Separate ``clip_by_grid`` method for GridDataArray into one for
xr.DataArray and xu.UgridDataArray, as plum apparently thinks this
ambiguous.
- Update some arrays in ``create_exchange_package`` to become DataArray
- Add missing fallback functions for ``enforce_dim_order`` and
``is_unstructured``
- Add function for ``enforce_dim_order`` with ``None``
- Change fallback type from ``object`` to ``Any``, to also support
``None``

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

- [x] Links to correct issue
- [ ] 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
JoerivanEngelen added a commit that referenced this issue Apr 17, 2025
Fixes #1498 

# Description
Fix broken copy method

# 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``
- [x] Unit tests were added
- [ ] **If feature added**: Added/extended example

---------

Co-authored-by: JoerivanEngelen <[email protected]>
JoerivanEngelen added a commit that referenced this issue Apr 28, 2025
Closes #305 

# Description

This throws an error when a user tries to write a model in a directory
with a space in it.

Follow-up to #1514

See my comment here:
#1514 (comment)

> Thanks for hotfixing this. FYI: This is not an immediate problem
anymore: I just talked to @TeunvanWoerkom, he moved to a drive without
spaces in the path.
> 
> I'm not sure if we should merge this, as the `wq` test bench doesn't
have the coverage of the `mf6` module. Most notably, we don't run a
model with iMOD-WQ to test if it breaks. The current `wq` module is
tried and tested in many projects, so that is sufficient to do work
with. I don't want to risk breaking it with changes.
> 
> Besides, Teun manually quoted the paths in his runfile to fix this and
then iMOD-WQ apparently also isn't able to deal with spaces in paths (at
least the version he used). It crashes upon attempting to create the
results directories.
> 
> Alternatively: We could raise an error if a user attempts to write a
`wq` model in a folder with a space in the path?


It turned out that adding quotes doesn't do the trick, as iMOD-WQ also
cannot handle spaces in paths, even when they are quoted in the runfile.
It crashes upon writing results.

# 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``
- [x] Unit tests were added
- [ ] **If feature added**: Added/extended example
github-merge-queue bot pushed a commit that referenced this issue May 19, 2025
…in iMOD projectfile (#1529)

Fixes #1528 

# Description
<!---
Thanks for opening a PR!

Please add your description here of changes made and how they are going
to
resolve the linked issue 
-->
Fixes the issue of using relative paths for the extra MetaSWAP files in
the iMOD project file.

# 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``
- [x] Unit tests were added
- [ ] **If feature added**: Added/extended example

---------

Co-authored-by: JoerivanEngelen <[email protected]>
JoerivanEngelen added a commit that referenced this issue May 23, 2025
Fixes #1507

# Description
- Adds validation of model options
- Add TypeSchema to validate model options, which are not DataArray or
UgridDataArray
- Clean up unused kwargs logic in ``Modflow6Model.__init__``
- Small refactor: move some logic to concatenate schemata to separate
function, force to list to allow concatenating (hidden bug that showed
up in mypy after .
- Small refactor: Add TypeAlias SchemaDict

# Checklist

- [x] Links to correct issue
- [x] Update changelog, if changes affect users
- [x] PR title starts with ``Issue #nr``, e.g. ``Issue #737``
- [x] Unit tests were added
- [ ] **If feature added**: Added/extended example
JoerivanEngelen added a commit that referenced this issue May 27, 2025
Fixes #1539 

# Description
Changes the following:

- Fix bug where UgridDataArrays where silently converted to regular
DataArrays (caused by the call to ``.data_vars``).
- Add unstructured grid test case to well tests where easily applicable.

# Checklist
- [x] Links to correct issue
- [x] Update changelog, if changes affect users
- [x] PR title starts with ``Issue #nr``, e.g. ``Issue #737``
- [x] Unit tests were added
- [ ] **If feature added**: Added/extended example
JoerivanEngelen added a commit that referenced this issue May 27, 2025
…abstraction rates (#1533)

Fixes #1532

# Description
Fixes a bug where surface water rates were not written to file in
absence of groundwater abstraction rates.

# Checklist
- [x] Links to correct issue
- [x] Update changelog, if changes affect users
- [x] PR title starts with ``Issue #nr``, e.g. ``Issue #737``
- [x] Unit tests were added
- [ ] **If feature added**: Added/extended example
JoerivanEngelen pushed a commit that referenced this issue May 27, 2025
…ct file. (#1543)

Fixes #1542 

# Description
<!---
Thanks for opening a PR!

Please add your description here of changes made and how they are going
to
resolve the linked issue 
-->
This fixes a minor bug related to unwanted case sensitivity of the
periods keyword in the iMOD project file.

# 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``
- [x] Unit tests were added
- [ ] **If feature added**: Added/extended example
github-merge-queue bot pushed a commit that referenced this issue May 27, 2025
Fixes #1536

# Description
- Remove unnecessary calls to ``.values``
- Fix bug in ``_skip_if_datarray`` where the spatial dimension of
unstructured grids was hardcoded
- Refactor exchange creation logic to use
``xr.Dataset().to_dataframe()``, this to carefully merge variables into
a dataset with matching dimensions, then convert to pandas dataframe.

I can't verify yet if this improves things with Teun's example as I do
not have his scripts, but this fixes a bug and will improve performance
somewhat when using dask (as it reduces unnecessary loads into memory)

# Checklist

- [x] Links to correct issue
- [x] Update changelog, if changes affect users
- [x] PR title starts with ``Issue #nr``, e.g. ``Issue #737``
- [x] Unit tests were added
- [ ] **If feature added**: Added/extended example
JoerivanEngelen added a commit that referenced this issue May 28, 2025
Fixes #1525

# Description
Add support to directly provide repeat_stresses as dictionary. As issue
states: Simplifies API for users a lot, as they don't need to search for
the obscure utility function ``get_period_stess``.

# Checklist
- [x] Links to correct issue
- [x] Update changelog, if changes affect users
- [x] PR title starts with ``Issue #nr``, e.g. ``Issue #737``
- [x] Unit tests were added
- [ ] **If feature added**: Added/extended example
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