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

fix(str and repr): better repr and str output for transient data with multiple blocks (#2058) #2102

Merged
merged 3 commits into from
Mar 13, 2024

Conversation

scottrp
Copy link
Contributor

@scottrp scottrp commented Feb 13, 2024

When transient data contains multiple blocks of data this fix:

  1. Makes sure that the first block of data's str/repr gets called (it use to be the last "active" block got displayed)
  2. Flopy use to just display just one block of data. Now, if there are additional blocks, a message is added to the end of the str/repr indicating that more data is present.

Also added text for external data indicating that external is not displayed in the repr (it was not displayed before but no text indicated this)

For example, getting the str of ghb obs continuous data:

str(model.get_package("ghb_obs").continuous)

Might produce the following output:

{open/close AdvGW_tidal.ghb.obs_continuous_ghb_flows.csv.txt}
(External data not displayed)
...
and 1 additional data blocks

Copy link

codecov bot commented Feb 13, 2024

Codecov Report

Attention: 57 lines in your changes are missing coverage. Please review.

Comparison is base (626563a) 73.0% compared to head (cb1e5e4) 73.0%.
Report is 6 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff           @@
##           develop   #2102   +/-   ##
=======================================
  Coverage     73.0%   73.0%           
=======================================
  Files          259     259           
  Lines        59415   59491   +76     
=======================================
+ Hits         43401   43457   +56     
- Misses       16014   16034   +20     
Files Coverage Δ
flopy/mf6/data/mfdataarray.py 60.9% <50.0%> (-0.1%) ⬇️
flopy/mf6/data/mfdatalist.py 64.9% <50.0%> (+0.5%) ⬆️
flopy/mf6/data/mfdatascalar.py 60.0% <50.0%> (-0.6%) ⬇️
flopy/mf6/data/mfdatastorage.py 71.2% <0.0%> (-0.3%) ⬇️
flopy/mf6/data/mfdata.py 72.9% <6.6%> (-2.9%) ⬇️
flopy/mf6/data/mfdataplist.py 74.3% <44.2%> (-1.9%) ⬇️

... and 14 files with indirect coverage changes

@langevin-usgs
Copy link
Contributor

Would it make sense to paste some examples into this PR for what the output will look like for str and repr?

Copy link
Contributor

@langevin-usgs langevin-usgs left a comment

Choose a reason for hiding this comment

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

Hey @scottrp, this seems reasonable to me. Let's merge it in.

@langevin-usgs langevin-usgs merged commit 1fe5157 into modflowpy:develop Mar 13, 2024
24 checks passed
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