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

Future proofing: treat most warnings as errors in pytest, and fix existing ones #3380

Merged
merged 23 commits into from
Jul 1, 2021

Conversation

neutrinoceros
Copy link
Member

@neutrinoceros neutrinoceros commented Jun 26, 2021

PR Summary

PR Summary

fix #3379
Though independent, this is complementary with #3376.

An important note is that there are some internal deprecation warnings with no obvious solution yet, so I'm adding them to the ignore-list in conftest.py but they will need to be addressed in future releases. Specifically, I'm talking about fields ("all", "px") and ("gas", "px") (respectively "py", "dpx" and "dpy"), that are used internally in slice selectors, but never with explicit field/particle types. Getting to a stable solution here requires much more thought and design that what I'm solving here so I'll defer it to future works, and in any case it's not as urgent as other deprecation warnings because it's internal so it won't break haphazardly.

TODO

  • pass CI
  • document why each ignored warning gets a pass (comments)

@neutrinoceros neutrinoceros added enhancement Making something better infrastructure Related to CI, versioning, websites, organizational issues, etc yt-4.0 feature targeted for the yt-4.0 release labels Jun 26, 2021
@neutrinoceros neutrinoceros force-pushed the future_proofing branch 12 times, most recently from 9fd63c8 to 2105651 Compare June 28, 2021 10:40
conftest.py Outdated Show resolved Hide resolved
conftest.py Outdated Show resolved Hide resolved
@neutrinoceros neutrinoceros force-pushed the future_proofing branch 3 times, most recently from 45ae7dd to 5b5e4b5 Compare June 28, 2021 13:46
@neutrinoceros
Copy link
Member Author

neutrinoceros commented Jun 28, 2021

There remains only one failure in the py38_unittest job but I'm struggling to reproduce it locally. Any help would be greatly appreciated.
edit: done ! ✅
Hopefully this is the last thing that needs solving here, though I'm writing this before I can see the results from the py38 job on Jenkins.

@@ -47,7 +47,7 @@ install_requires =
toml>=0.10.2
tqdm>=3.4.0
unyt>=2.8.0
python_requires = >=3.6
python_requires = >=3.6,<3.12
Copy link
Member Author

Choose a reason for hiding this comment

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

To anyone wondering: the reasoning here is that the distutils builtin package is slanted for removal in Python 3.12 (which should be released around October 2023), but it is currently used in several places in yt, making it de facto incompatible with Python 3.12
Solving this doesn't seem like a priority but I'll document it as an issue !

Copy link
Member

@matthewturk matthewturk left a comment

Choose a reason for hiding this comment

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

I'd like to see one of the changes reworked, but otherwise this looks good to me.

#
# >>> warnings from wrong values passed to numpy
# these should normally be curated out of the test suite but they are too numerous
# to deal with in a reasonable time at the moment.
Copy link
Member

Choose a reason for hiding this comment

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

I think some like this may arise from field detection.

Copy link
Member Author

Choose a reason for hiding this comment

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

oh, good call ! I'll keep this in mind if I ever feel daring enough to fix these :)

yt/utilities/fortran_utils.py Outdated Show resolved Hide resolved
yt/utilities/tests/test_cosmology.py Show resolved Hide resolved
yt/visualization/volume_rendering/lens.py Outdated Show resolved Hide resolved
yt/visualization/volume_rendering/lens.py Show resolved Hide resolved
yt/data_objects/index_subobjects/grid_patch.py Outdated Show resolved Hide resolved
@neutrinoceros
Copy link
Member Author

pre-commit.ci autofix

neutrinoceros and others added 23 commits June 30, 2021 20:44
…ill make use of the distutils package, targetted for removal in Python 3.12)
Co-authored-by: Corentin Cadiou <contact@cphyc.me>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Making something better infrastructure Related to CI, versioning, websites, organizational issues, etc yt-4.0 feature targeted for the yt-4.0 release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Future proofing yt 4.0
3 participants