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

[patch] use deprecate from pyiron_snippets #1432

Merged
merged 3 commits into from
Jun 3, 2024
Merged

Conversation

liamhuber
Copy link
Member

No description provided.

)
from pyiron_snippets.deprecate import deprecate
Copy link
Member

Choose a reason for hiding this comment

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

The import feels a bit redundant from pyiron_snippets.deprecate import deprecate. Can we change it to from pyiron_snippets import deprecate ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Certainly not on this version of snippets. Personally, to maintain the idea that snippets is exceedingly lightweight and that all its pieces are independent, I prefer to leave its __init__ empty. But I'm not totally closed to it so feel free to open an issue on snippets and see what the others think

Comment on lines +22 to 23
from pyiron_snippets.deprecate import deprecate
from pyiron_snippets.import_alarm import ImportAlarm
Copy link
Member

Choose a reason for hiding this comment

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

Especially this line would be much cleaner as:

Suggested change
from pyiron_snippets.deprecate import deprecate
from pyiron_snippets.import_alarm import ImportAlarm
from pyiron_snippets import deprecate, ImportAlarm

Copy link
Member Author

Choose a reason for hiding this comment

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

As mentioned above, I don't want this because if snippets grows I don't want to burn time importing everything in it just because you use one thing in it. But tbh I'm not sure that even with a large module this burns significant time, so if you have data to prove it won't impact performance down the line, then I'm open to it.

Copy link
Contributor

@pmrv pmrv Jun 3, 2024

Choose a reason for hiding this comment

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

The current way keeps the different submodules of snippets and their API uncoupled as is intended and so I think it is strongly preferable to importing/exporting everything in the top module. Especially since it would be for purely aesthetic reasons. from pyiron_snippets.deprecate import * would work just as well, if it's really unbearable.

i.e. pyiron_base.state.logger.logger with pyiron_snippets.logger.logger. The original location leaves a re-direct for backwards compatibility.
[patch] replace logger with snippets version
Base automatically changed from snippets_alarm to main June 3, 2024 18:30
@jan-janssen jan-janssen merged commit 3e1e67c into main Jun 3, 2024
23 checks passed
@jan-janssen jan-janssen deleted the snippets_deprecate branch June 3, 2024 18:32
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.

3 participants