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

refactor(recarray_utils): deprecate functions for numpy builtins #1960

Merged
merged 1 commit into from
Sep 27, 2023

Conversation

wpbonelli
Copy link
Member

@wpbonelli wpbonelli commented Sep 23, 2023

  • deprecate ra_slice(), suggest numpy.lib.recfunctions.repack_fields()
  • deprecate recarray(), suggest numpy.core.records.fromrecords()
  • add tests demonstrating equivalent usage
  • replace occurrences in tests and notebooks
  • update docstring examples
    • show output instead of assigning to variable
    • use doctest to verify examples run correctly

Maybe worth doctesting in CI in future?

@codecov
Copy link

codecov bot commented Sep 23, 2023

Codecov Report

Merging #1960 (409f60c) into develop (5b5eb4e) will increase coverage by 0.0%.
Report is 2 commits behind head on develop.
The diff coverage is 83.3%.

@@           Coverage Diff           @@
##           develop   #1960   +/-   ##
=======================================
  Coverage     72.6%   72.7%           
=======================================
  Files          257     257           
  Lines        57801   57800    -1     
=======================================
+ Hits         42018   42023    +5     
+ Misses       15783   15777    -6     
Files Coverage Δ
flopy/utils/__init__.py 100.0% <100.0%> (ø)
flopy/utils/modpathfile.py 85.9% <100.0%> (-0.1%) ⬇️
flopy/utils/recarray_utils.py 94.4% <50.0%> (-5.6%) ⬇️

... and 7 files with indirect coverage changes

@wpbonelli wpbonelli marked this pull request as ready for review September 23, 2023 23:15
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.

Looks good, @wpbonelli. Not sure how often these functions are used, so impact should be minimal. Noticed tests are still failing.

@wpbonelli
Copy link
Member Author

thanks @langevin-usgs I think CI will fail until

@langevin-usgs
Copy link
Contributor

Okay, thanks @wpbonelli. Hopefully @emorway-usgs can get that straightened out soon so we can merge.

@wpbonelli wpbonelli merged commit 941a5f1 into modflowpy:develop Sep 27, 2023
21 checks passed
@wpbonelli wpbonelli deleted the recarray-utils branch September 27, 2023 01:23
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