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

Make h5py and ruamel lazy loading #4788

Merged
merged 2 commits into from
Nov 8, 2022

Conversation

peendebak
Copy link
Contributor

@peendebak peendebak commented Nov 2, 2022

This PR uses the lazy_loader package to make the qcodes import time lower. The lazy_loader package has been adapoted by several scientific python packages, for details see https://scientific-python.org/specs/spec-0001/

The h5py and ruamal components have been selected because they take time in the import and are only used in components that not all users will use (e.g. the legacy dataset and the Monitor). The PR is intended to be fully backwards compatible.

More gains can be made with non-backwards compatible changes. For example in the main qcodes __init__.py the number of direct imports which could be reduced.

Also see #4543

@jenshnielsen

@peendebak peendebak changed the title Make h5py and ruamel lazy loading Draft: Make h5py and ruamel lazy loading Nov 2, 2022
@codecov
Copy link

codecov bot commented Nov 2, 2022

Codecov Report

Merging #4788 (c46b4d8) into master (c46b4d8) will not change coverage.
The diff coverage is n/a.

❗ Current head c46b4d8 differs from pull request most recent head b87c4e6. Consider uploading reports for the commit b87c4e6 to get more accurate results

@@           Coverage Diff           @@
##           master    #4788   +/-   ##
=======================================
  Coverage   68.26%   68.26%           
=======================================
  Files         339      339           
  Lines       32065    32065           
=======================================
  Hits        21889    21889           
  Misses      10176    10176           

@peendebak peendebak changed the title Draft: Make h5py and ruamel lazy loading Make h5py and ruamel lazy loading Nov 2, 2022
@jenshnielsen
Copy link
Collaborator

@peendebak Thanks, happy to try this out. I agree that when we make a breaking change it would be good to avoid the top level imports of corners of qcodes. I have been hoping to do that in an official 1.0 release at some point down the line

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