Skip to content

Add unified calibration class#79

Open
dbrakenhoff wants to merge 10 commits intodevfrom
combined-calibration
Open

Add unified calibration class#79
dbrakenhoff wants to merge 10 commits intodevfrom
combined-calibration

Conversation

@dbrakenhoff
Copy link
Copy Markdown
Contributor

  • add unified Calibration class that supports both steady and transient models
  • add support for constants and time shifts for head observations
  • ensure steady transmissivities are updated in initialize
  • use inhomdict in steady models and support names
  • improve aquifer summaries by using named columns instead of iloc indexing
  • add print time info to tmin_warning in invlapcomp
  • add example notebook to test new class

- add unified Calibration class that supports both steady and transient models
- add support for constants and time shifts for head observations
- ensure steady transmissivities are updated in initialize
- use inhomdict in steady models and support names
- improve aquifer summaries by using named columns instead of iloc indexing
- add print time info to tmin_warning in invlapcomp
- add example notebook to test new class
- Aquifers initialize method calls inhom.create_elements()
- this ensures all aquifer/inhom data is known prior to creating inhom elements
@dbrakenhoff
Copy link
Copy Markdown
Contributor Author

This PR introduces a breaking change, the inhomlist has been replaced by an inhomdict in timflow.steady. I think the impact is small as most people weren't accessing the inhomogeneities that way... ?

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a unified calibration framework intended to support both steady-state and transient timflow models (including shared/joint parameters), while also standardizing inhomogeneity handling (inhomdict) and improving aquifer summaries and some messaging.

Changes:

  • Added timflow.calibrate.Calibrate as a new unified calibration API, and exported it from timflow.__init__.
  • Replaced list-based inhomogeneity handling with inhomdict usage across steady/transient models and plotting, and updated summaries to use named columns.
  • Improved transient inverse Laplace warning output and updated a benchmark notebook for the new inhomogeneity access pattern.

Reviewed changes

Copilot reviewed 11 out of 12 changed files in this pull request and generated 15 comments.

Show a summary per file
File Description
timflow/transient/invlapnumba.py Improves tmin warning printout by including offending time and interval info.
timflow/transient/inhom1d.py Removes redundant initialize() override so element creation can be driven centrally.
timflow/transient/aquifer.py Makes aquifer summary column handling more robust and ensures 2-pass inhom init/element creation.
timflow/steady/model.py Updates inhomogeneity iteration and summaries to use inhomdict and inhom names.
timflow/steady/inhomogeneity1d.py Adjusts naming initialization to rely on aquifer add_inhom() naming logic.
timflow/steady/inhomogeneity.py Adds optional name support to polygon inhomogeneities and forwards it in constructors.
timflow/steady/aquifer.py Recomputes transmissivity on initialize, switches to inhomdict, and improves summary indexing.
timflow/plots/plots.py Unifies cross-section inhomogeneity plotting by iterating aq.inhomdict.values().
timflow/calibrate.py Adds new unified calibration implementation (steady/transient, shared parameters, time shifts/constants).
timflow/init.py Exports the new unified Calibrate at package top level.
docs/steady/04benchmarks/test_polygon_areasink.ipynb Updates notebook to access inhomogeneity via inhomdict and adds an empty cell.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

dbrakenhoff and others added 3 commits March 30, 2026 12:05
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
- allow negative log scaled parameters
- fix some typos
- allow adding constants and time shifts to head in well time series
- raise when adding time series but no transient model is defined, and when steady observations are added but no steady model is provided
- ensure nan-filling in residuals is done for transient calculations
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.

2 participants