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

Bugfix for use of old layer definition in 'fit' function #92

Merged
merged 2 commits into from
Mar 11, 2025

Conversation

MattBrst
Copy link
Contributor

I used the code: ca.set_parameter(name="kaq0_2", initial=10), and the original code extracted the numbers 0 and 2 as layer numbers, but these were strings instead of integers.

Fixed with this commit.

If you have multiple layers in the layer description (e.g.:
Bugfix for old method of selecting layers
@MattBrst
Copy link
Contributor Author

MattBrst commented Feb 28, 2025

For others who encounter the same error: You can solve this as well by using ca.set_parameter(name="kaq0_2", layers=[0, 1, 2], initial=10).

This should be recommended, since the old usage (extraction of the layer numbers from the name string) is deprecated and will be removed in the future.

@mbakker7
Copy link
Owner

mbakker7 commented Mar 5, 2025

Is there a notebook where this is used that also shows the deprecation warning? That may be useful.

@MattBrst
Copy link
Contributor Author

MattBrst commented Mar 10, 2025

The Pratt County example hits the deprecation warning in the first cell of step 6.

And at the same time you see the error that I encountered and want to fix with the proposed change:

error message

@mbakker7
Copy link
Owner

Looks good. Thanks for submitting!

@mbakker7 mbakker7 merged commit eaa2916 into mbakker7:dev Mar 11, 2025
6 checks passed
mbakker7 added a commit that referenced this pull request Mar 12, 2025
Some bug fixes and minor improvements:
* Add inhomogeneity name to crosssection plot (1D inhom) (#90)
* Added 'names' in plotting of inhom
* Bugfix for old method of selecting layers (#92)
* Specify step for Jacobian (#95)

---------

Co-authored-by: Davíd Brakenhoff <d.brakenhoff@artesia-water.nl>
Co-authored-by: Mattijs Borst <41747007+MattBrst@users.noreply.github.com>
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