Reducing qcodes import times
Hi all,
Following this discussion #4565 and this issue #4543 I am proposing this pull request to work on reducing qcodes loading time.
I have started with pandas.
I tried to propagate what @jenshnielsen did to make pandas import lazy-import.
I am not sure I have succeeded since I still see pandas being imported while doing importtime-waterfall.
I would gladly improve the request if someone help me on this.
If this becomes a successful endeavor, I will continue by making other import lazy-import.
And also, I do not no how to run qcodes test and check if I didn't break anything ^^'. Again, if someone may help me.
Thanks, I will try to have a look asab and see if I can figure out why/if pandas is still being imported eagerly
Found out that pandas was imported by xarray so I passed xarray in lazy import.
On the data_set file, I got some error and had to write the type of some parameters as 'xr.Dataset', see line 693 for example. I do not know why and if this is correct.
Yep, forget what I wrote, it is fixed.
Looks good. Did you verify that you need to also make changes to the tests. Importing qcodes should not import the tests module. If it does that seems like a bug we should also fix.
You right, test file do not matters. Could you remind me how to run the test locally?
Alright there is maybe the import of Monitor to work on but I am waiting opinion(s) from others. On my pc it looks like it is 20% faster, can anyone look on their machine?
I should have include everything you said. Please tell me if I missed anything.
Codecov Report
Merging #4616 (f8718ed) into master (81f1424) will decrease coverage by
0.07%. The diff coverage is88.88%.
@@ Coverage Diff @@
## master #4616 +/- ##
==========================================
- Coverage 68.30% 68.23% -0.08%
==========================================
Files 339 339
Lines 31974 31979 +5
==========================================
- Hits 21841 21820 -21
- Misses 10133 10159 +26
Should be good
Done.
I did not get what you meant by "documentation about where to import it from"...
Looks good. thanks @edumur
bors merge
:clock1: Waiting for PR status (Github check) to be set, probably by CI. Bors will automatically try to run when all required PR statuses are set.
bors merge