Skip to content

Conversation

@atravitz
Copy link
Contributor

For cli commands, slow imports should be moved inside functions (as recommended here).

By moving the plan_alchemical_network_output import from the top of the file to inside the functions for rbfe and rhfe network planning, we avoid importing openfe during the command-gathering process.

The --help and --version calls now take 0.15 seconds instead of ~4 seconds.

Ideally, we will also speed up import openfe, which was the root cause of this slow behavior, in another PR.

Checklist

  • Added a news entry

Developers certificate of origin

@atravitz atravitz self-assigned this Oct 11, 2024
@codecov
Copy link

codecov bot commented Oct 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.84%. Comparing base (29d8cd9) to head (0186b3c).
Report is 153 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #955      +/-   ##
==========================================
- Coverage   94.59%   92.84%   -1.76%     
==========================================
  Files         134      134              
  Lines        9935     9935              
==========================================
- Hits         9398     9224     -174     
- Misses        537      711     +174     
Flag Coverage Δ
fast-tests 92.84% <100.00%> (?)
slow-tests ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@IAlibay IAlibay left a comment

Choose a reason for hiding this comment

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

lgtm thanks!

@IAlibay IAlibay merged commit 83028b1 into main Oct 12, 2024
@IAlibay IAlibay deleted the fix_slow_cli_call branch October 12, 2024 19:42
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