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

bug: ModflowUtlobs only loads last "continuous" block #2058

Closed
dannbuckley opened this issue Jan 14, 2024 · 4 comments
Closed

bug: ModflowUtlobs only loads last "continuous" block #2058

dannbuckley opened this issue Jan 14, 2024 · 4 comments
Assignees
Labels
Milestone

Comments

@dannbuckley
Copy link

Describe the bug
The flopy.mf6.modflow.mfutlobs.ModflowUtlobs class does not load both of the continuous blocks from the ex-gwf-advtidal.obs file within the ex-gwf-advtidal MODFLOW 6 example. This is what the loaded class currently looks like:

package_name = obs_1
filename = ex-gwf-advtidal.obs
package_type = obs
model_or_simulation_package = model
model_name = ex-gwf-advtidal

Block continuous
--------------------
continuous
{internal}
(rec.array([('h1_13_8', 'head', (2, 12, 7), None)],
          dtype=[('obsname', 'O'), ('obstype', 'O'), ('id', 'O'), ('id2', 'O')]))

Expected behavior
The class should have both continuous blocks from the observation file:

# File generated by Flopy version 3.3.6 on 12/07/2022 at 20:40:00.
BEGIN options
END options

BEGIN continuous  FILEOUT  ex-gwf-advtidal.obs.flow.csv
  icf1  flow-ja-face  1 5 6  1 6 6
END continuous  FILEOUT  ex-gwf-advtidal.obs.flow.csv

BEGIN continuous  FILEOUT  ex-gwf-advtidal.obs.head.csv
  h1_13_8  head  3 13 8
END continuous  FILEOUT  ex-gwf-advtidal.obs.head.csv

Desktop (please complete the following information):

  • OS: Windows 11
  • FloPy Version 3.5.0
@spaulins-usgs
Copy link
Contributor

@dannbuckley, I have merged a fix for this problem into the develop branch.

@dannbuckley
Copy link
Author

Hey @spaulins-usgs,

I can confirm that the data is there:

>>> model.get_package("obs_1").continuous.get_data()
{'ex-gwf-advtidal.obs.flow.csv': rec.array([('icf1', 'flow-ja-face', (0, 4, 5), (0, 5, 5))],
           dtype=[('obsname', 'O'), ('obstype', 'O'), ('id', 'O'), ('id2', 'O')]),
 'ex-gwf-advtidal.obs.head.csv': rec.array([('h1_13_8', 'head', (2, 12, 7), None)],
           dtype=[('obsname', 'O'), ('obstype', 'O'), ('id', 'O'), ('id2', 'O')])}

The class summary still looks like it does in the original comment:

>>> model.get_package("obs_1")
package_name = obs_1
filename = ex-gwf-advtidal.obs
package_type = obs
model_or_simulation_package = model
model_name = ex-gwf-advtidal

Block continuous
--------------------
continuous
{internal}
(rec.array([('h1_13_8', 'head', (2, 12, 7), None)],
          dtype=[('obsname', 'O'), ('obstype', 'O'), ('id', 'O'), ('id2', 'O')]))

@spaulins-usgs
Copy link
Contributor

@dannbuckley, yes the class summary is being abbreviated when there are multiple blocks of the same type. It also gets abbreviated for stress period data. I will discuss with the rest of the flopy team the best way to display the class summary in these cases. Note that it is probably best to abbreviate the class summary in at least some cases since there can be 100s or even 1000s of stress periods in some models.

@dannbuckley
Copy link
Author

@spaulins-usgs That makes sense. In that case, then, it might be easier to print the number of instances of the block within the package instead of printing all the data (e.g., "continuous: 100 blocks" or similar). Also, printing something like "only last block shown" or similar might help.

@wpbonelli wpbonelli added this to the 3.6.1 milestone Mar 2, 2024
langevin-usgs pushed a commit that referenced this issue Mar 13, 2024
… multiple blocks (#2058) (#2102)

* fix(str and repr): improved display string for str and repr data with multiple blocks

* fix(str and repr)

* fix(str/repr): pandas list str/repr fix
@wpbonelli wpbonelli modified the milestones: 3.6.1, 3.7.0 May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants