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

Issues with WellModel [BUG] #602

Closed
rubencalje opened this issue Jun 6, 2023 · 3 comments
Closed

Issues with WellModel [BUG] #602

rubencalje opened this issue Jun 6, 2023 · 3 comments
Assignees
Labels
bug Indicates an unintended behavior or coding error priority 1 normal, deal with in the foreseeable future

Comments

@rubencalje
Copy link
Collaborator

Describe the bug
There are three issues with the wellModel:

1 strange info message
When running the notebook http://localhost:8888/notebooks/pastas/doc/examples/multiple_wells.ipynb
During ml_wm.solve() I get the following info message:
INFO: No distance passed to HantushWellModel, assuming r=1.0.

2 sorting error, when distances are not sorted yet, this results in a key-errror:
KeyError: 'Extraction_2'

3 stacklegend in stacked_results gives the following error:
UnboundLocalError: local variable 'loc' referenced before assignment

To Reproduce
1 Run the notebook in http://localhost:8888/notebooks/pastas/doc/examples/multiple_wells.ipynb
2 In the above notebook, change line
w = ps.WellModel(list(extraction_ts.values()), "Wells", distances) in:
w = ps.WellModel(list(extraction_ts.values()), "Wells", distances[::-1])
3 In the above notebook, run:
ml_wm.plots.stacked_results(figsize=(10, 8), stacklegend=True);

Expected behavior
1 No info message
2 No error
3 No error

Python package version
Python version: 3.9.7
NumPy version: 1.23.5
Pandas version: 1.5.3
SciPy version: 1.9.1
Matplotlib version: 3.7.1
Numba version: 0.56.4
LMfit version: 1.2.1
Latexify version: Not Installed
Pastas version: 1.1.0

@rubencalje rubencalje added the bug Indicates an unintended behavior or coding error label Jun 6, 2023
@dbrakenhoff
Copy link
Member

dbrakenhoff commented Jun 6, 2023

I'll take a look.

  1. The first issue is quite challenging to deal with, as discussed in How to resolve "INFO: No distance passed to HantushWellModel, assuming r=1.0." #437 and No distance passed to HantushWellModel, assuming r=1.0. #601. Whenever a call is made to ml.get_parameters(name), no distances are provided to WellModel, and it uses r=1.0. I don't think there is a clean way to distinguish between an internal call to rfunc.step and an external one without adding loads of if/else's internally. Implementing an argument to silence the warning then results in lots of unnecessary warn=False being passed around just to get rid of this message. But maybe someone has a better idea?

2 and 3 are simple fixes I will commit soon.

@martinvonk martinvonk added the priority 1 normal, deal with in the foreseeable future label Aug 3, 2023
@raoulcollenteur
Copy link
Member

@dbrakenhoff and @rubencalje is this issue fixed after merging #603 and #604 ?

@dbrakenhoff
Copy link
Member

Yep, all fixed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unintended behavior or coding error priority 1 normal, deal with in the foreseeable future
Projects
None yet
Development

No branches or pull requests

4 participants