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(masked_4D_arrays): allow re-use of preceding spd data if empty #2314

Merged
merged 12 commits into from
Oct 20, 2024

Conversation

martclanor
Copy link
Contributor

@martclanor martclanor commented Sep 23, 2024

This PR aims to address the issue raised in discussion #2309

  • fix(MFPandasTransientList.masked_4D_arrays_itr): allow re-use of preceding spd data if empty (mf6)
    • generalize setting of array shape for different grid types
    • re-use preceding spd array data
    • update relevant test
  • fix(MfList.masked_4d_arrays): allow re-use of preceding spd data if empty (non-mf6)
    • generalize setting of array shape for different grid types
    • re-use preceding spd array data
  • fix(model_attributes_to_shapefile): fix exporting of transientlist if disu
    • create separate case for disu
    • update relevant test
  • test(masked_4D_arrays): add tests
    • compare mf6 and non-mf6 shp export (riv data)
  • refactor(MFTransientList): re-use masked_4D_arrays_itr implementation
  • refactor(model_attributes_to_shapefile): remove bare except
  • refactor(model_attributes_to_shapefile): skip transientlist if empty
  • refactor(model_attributes_to_shapefile): skip transientlist if all elements are of object type
    • if package has timeseries data, transientlist elements are all of object type
  • refactor(mflist_export): skip mflist if all elements are of object type
    • if package has timeseries data, mflist elements are all of object type
  • fix(mfUsgDisU): return ncpl as integer
  • refactor(model_attributes_to_shapefile): use first recarray kper to check transientlist
  • refactor(mflist_export): use first recarray kper to check mflist

I did remove the bare except clause in flopy.export.shapefile_utils.model_attributes_to_shapefile but it caused several tests to fail. These issues were addressed in the last commits. However, in hindsight, I'm not sure if that was worth removing.

@martclanor martclanor marked this pull request as ready for review September 23, 2024 15:42
@martclanor martclanor marked this pull request as draft September 26, 2024 07:58
@wpbonelli
Copy link
Member

At least some of the CI failures look like the same thing Josh is running into #2318 (comment). I will patch the get-modflow script shortly

@wpbonelli wpbonelli added this to the 3.9 milestone Oct 10, 2024
@martclanor martclanor force-pushed the fix_masked_4d_arrays branch from b8a8cac to fe21cbd Compare October 19, 2024 19:33
Copy link

codecov bot commented Oct 19, 2024

Codecov Report

Attention: Patch coverage is 95.23810% with 2 lines in your changes missing coverage. Please review.

Project coverage is 74.2%. Comparing base (5555d15) to head (fe21cbd).
Report is 13 commits behind head on develop.

Files with missing lines Patch % Lines
flopy/export/shapefile_utils.py 93.3% 1 Missing ⚠️
flopy/mf6/data/mfdatalist.py 0.0% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##           develop   #2314     +/-   ##
=========================================
- Coverage     74.3%   74.2%   -0.1%     
=========================================
  Files          294     292      -2     
  Lines        59562   59683    +121     
=========================================
+ Hits         44282   44336     +54     
- Misses       15280   15347     +67     
Files with missing lines Coverage Δ
flopy/export/utils.py 64.6% <100.0%> (+0.1%) ⬆️
flopy/mf6/data/mfdataplist.py 78.8% <100.0%> (+0.1%) ⬆️
flopy/mfusg/mfusgdisu.py 83.8% <100.0%> (ø)
flopy/utils/util_list.py 75.5% <100.0%> (+<0.1%) ⬆️
flopy/export/shapefile_utils.py 84.0% <93.3%> (+0.2%) ⬆️
flopy/mf6/data/mfdatalist.py 69.0% <0.0%> (+1.8%) ⬆️

... and 16 files with indirect coverage changes

@martclanor martclanor marked this pull request as ready for review October 19, 2024 20:07
Copy link
Member

@wpbonelli wpbonelli left a comment

Choose a reason for hiding this comment

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

Thanks a lot for this @martclanor

@wpbonelli wpbonelli merged commit 332a310 into modflowpy:develop Oct 20, 2024
23 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