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

TST: Fix various warnings emitted from tests #1217

Merged
merged 3 commits into from
Jul 10, 2024

Conversation

mferrera
Copy link
Collaborator

@mferrera mferrera commented Jul 9, 2024

Resolves #1216

Reduces the number of warnings from 4000 to 1500. The remaining ones are mostly self-emitted for xtgeo 4.0 deprecations, with a few numpy ones.

A big-looking change is the removal of inplace= arguments. See the commit comment for a longer description, but tl;dr this didn't actually do things inplace but on a copy internally. See pandas-dev/pandas#51466

mferrera added 3 commits July 9, 2024 11:21
This resolves a few warnings related to accessing things. Removing the
`inplace=True` qualifier seems undesirable despite the warning being
emitted for it, but it turns out that generally when this is given
pandas is creating a copy internally anyway. pandas seem to have a
general desire to remove the `inplace=` options everywhere so that code
is not mutating, but remains more immutable.

See the following comment from years ago.
pandas-dev/pandas#16529 (comment)
pytest.PytestRemovedInWarning: Marks applied to fixtures have no effect
@mferrera mferrera force-pushed the fix-pandas-warnings branch from 3f98beb to cb916de Compare July 9, 2024 09:21
@mferrera mferrera self-assigned this Jul 9, 2024
@mferrera mferrera requested a review from tnatt July 9, 2024 09:28
@codecov-commenter
Copy link

Codecov Report

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

Project coverage is 80.04%. Comparing base (0375fed) to head (cb916de).
Report is 15 commits behind head on main.

Files Patch % Lines
src/xtgeo/grid3d/_grid_wellzone.py 75.00% 1 Missing ⚠️
src/xtgeo/xyz/_xyz_data.py 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1217      +/-   ##
==========================================
+ Coverage   80.02%   80.04%   +0.01%     
==========================================
  Files          98       98              
  Lines       13680    13683       +3     
  Branches     2203     2202       -1     
==========================================
+ Hits        10948    10952       +4     
+ Misses       1999     1996       -3     
- Partials      733      735       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@tnatt tnatt left a comment

Choose a reason for hiding this comment

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

🚀

@mferrera mferrera merged commit 3b44a9c into equinor:main Jul 10, 2024
39 checks passed
@mferrera mferrera deleted the fix-pandas-warnings branch July 10, 2024 12:18
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.

Resolve pandas warnings
3 participants