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

CLN: Remove bare xtgeo imports #1161

Closed
wants to merge 3 commits into from

Conversation

mferrera
Copy link
Contributor

Resolves #1149

I was a bit opinionated with these changes in expanding import paths fully and using relative imports, but I don't particularly believe that needs to be enforced and no linting rules exist to enforce it anyway. I do think that it will be a bit helpful in the near term, with structural refactors ahead, and that we should discuss whether or not to codify it in the style guide. Some major projects, e.g. pandas, do this.

This also adds a manual check in linting ci to make sure no further import xtgeos are added

This cannot be enforce through current ruff rules so flag it in CI.
Enforce that pandas and numpy are imported as pd and np, respectively,
and also that some modules must be lazily imported. This will make
enforcing lazy imports for heavier packages easier later on.
@mferrera mferrera self-assigned this Feb 12, 2024
@mferrera mferrera closed this Aug 9, 2024
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.

Remove bare import xtgeo imports, use relative imports where appropriate
1 participant