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 fragile imports #3016

Merged
merged 6 commits into from
Jan 14, 2021
Merged

Conversation

neutrinoceros
Copy link
Member

PR Summary

For a while there was a note in pyproject.toml that said isort couldn't be applied to yt/init.py because it would create circular imports. Turns out there are only a handful of fragilities to fix in that regard, and I'm doing it here.

@neutrinoceros neutrinoceros added infrastructure Related to CI, versioning, websites, organizational issues, etc code style Related to linting tools labels Jan 3, 2021
yt/__init__.py Outdated Show resolved Hide resolved
@neutrinoceros neutrinoceros marked this pull request as ready for review January 3, 2021 18:08
yt/__init__.py Outdated Show resolved Hide resolved
@neutrinoceros
Copy link
Member Author

Indeed the one test that failed was the one defining a sample plugin file: it broke because np wasn't defined anywhere else.
I went ahead and fixed it but this does mean that this removal is able to cause breakage downstream...

@matthewturk
Copy link
Member

matthewturk commented Jan 4, 2021 via email

@neutrinoceros neutrinoceros added the backwards incompatible This change will change behavior label Jan 4, 2021
@neutrinoceros
Copy link
Member Author

Well merge away if you're up for it, but I'm adding the "backward incompatible" label for the release manager because the natural error message is really not helpful:

# from the test
...
yt.utilities.exceptions.YTFieldNotFound: Could not find field ('unknown', 'random') in UniformGridData.

users should be warned that they need to import numpy themselves from the plugin file if they intend to use it there.

@cphyc cphyc merged commit 8f35e0d into yt-project:master Jan 14, 2021
@neutrinoceros neutrinoceros deleted the fix_fragile_imports branch January 14, 2021 21:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backwards incompatible This change will change behavior code style Related to linting tools infrastructure Related to CI, versioning, websites, organizational issues, etc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants