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

PERF: refactor atef.bin cli entrypoint to defer imports (try 2) #257

Merged
merged 2 commits into from
Sep 17, 2024

Conversation

tangkong
Copy link
Contributor

@tangkong tangkong commented Sep 17, 2024

Description

A different attempt at #256 , this time making separate submodules for each sub-parser in order to avoid changes to atef.bin.main

More submodules than before, but less modifications to the existing logic.

Motivation and Context

A suggestion by Zach in #256

How Has This Been Tested?

Interactively.

Where Has This Been Documented?

This PR

Pre-merge checklist

  • Code works interactively
  • Code contains descriptive docstrings, including context and API
  • New/changed functions and methods are covered in the test suite where possible
  • Code has been checked for threading issues (no blocking tasks in GUI thread)
  • Test suite passes locally
  • Test suite passes on GitHub Actions
  • Ran docs/pre-release-notes.sh and created a pre-release documentation page
  • Pre-release docs include context, functional descriptions, and contributors as appropriate

@tangkong tangkong changed the title PERF: refactor atef.bin cli entrypoint to defer imports PERF: refactor atef.bin cli entrypoint to defer imports (try 2) Sep 17, 2024
@tangkong tangkong requested a review from ZLLentz September 17, 2024 17:43
Copy link
Member

@ZLLentz ZLLentz left a comment

Choose a reason for hiding this comment

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

I think the extra submodules were worth it, it's interesting to see these subparser modules that only have the parser and defer the deep import until it's time to execute.

And again, this is all a compromise because Python modules are technically allowed to run as much code as they'd like on import...

@tangkong
Copy link
Contributor Author

supercedes #256

@tangkong tangkong merged commit 87cba02 into pcdshub:master Sep 17, 2024
11 checks passed
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