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

Improve python API, use import edm4hep instead of from edm4hep import edm4hep #207

Merged
merged 2 commits into from
Jun 30, 2023

Conversation

jmcarcell
Copy link
Member

BEGINRELEASENOTES

  • Improve python API, use import edm4hep instead of from edm4hep import edm4hep
    ENDRELEASENOTES

This simplifies the code internally and also allows us to have TAB completion in an interactive python session. I prefer import edm4hep to from edm4hep import edm4hep; I think it makes more sense that you get EDM4hep and its classes directly, and it's the python way of importing a module for almost every module. Then if we add any additional python feature it can be added and imported with from edm4hep import feature. This breaks from edm4hep import edm4hep, which could be preserved by adding

sys.modules['edm4hep.edm4hep'] = edm4hep

Copy link
Contributor

@tmadlener tmadlener left a comment

Choose a reason for hiding this comment

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

🤩 Now this is awesome. Thanks.

@tmadlener tmadlener enabled auto-merge (squash) June 30, 2023 09:00
@jmcarcell jmcarcell disabled auto-merge June 30, 2023 09:11
@jmcarcell jmcarcell merged commit b85db04 into key4hep:master Jun 30, 2023
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.

2 participants