-
Notifications
You must be signed in to change notification settings - Fork 14
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
Add support for multiple platform paths #903
Conversation
@Jacfomg, since you added them: why are these exported top-level? qibolab/src/qibolab/__init__.py Lines 9 to 13 in b93ee1b
We could export even more, but currently we are not doing it, so it's rather asymmetric (e.g. @andrea-pasquale removing this would break Qibocal? In any case, we could do it in 0.2, and that would not be a big deal (wrt everything else there...) |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #903 +/- ##
==========================================
+ Coverage 66.81% 66.90% +0.08%
==========================================
Files 55 58 +3
Lines 5970 5983 +13
==========================================
+ Hits 3989 4003 +14
+ Misses 1981 1980 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Yes, it will break qibocal but it should be an easy fix. |
At the moment, I'm not touching it. I will do it in 0.2 |
Despite a bunch of reshuffling, this is intended to target 0.1.x (I added the milestone to make this clear). For this reason, we should test that it's not breaking Qibocal, nor any platform working with the current Qibolab All the things I've moved around should have been considered internal, so it is formally non-breaking (but I hope it's non-breaking even in practice). |
A pytest fixture is defined for the purpose, keeping it separate from the dummy_qrc for the time being, at least until #903 will be merged
A pytest fixture is defined for the purpose, keeping it separate from the dummy_qrc for the time being, at least until #903 will be merged
I don't remenber who, but it was for the qibocal imports. Yes, changing would requiere changing it the import on each routine but only that. |
For now I get an error coming from this line in qibocal: https://github.com/qiboteam/qibocal/blob/37d060599c739b3b70602505d29509af295aedb0/src/qibocal/protocols/randomized_benchmarking/utils.py#L9 Also, unrelated with the above point, but I see that tests here are failing for windows. Maybe some path related convention? EDIT: Apart from the |
Yes the import should not be like that, I will fix it. |
Ok, great! I just have to fix a test (because I need the path to be escaped for Windows), and on my side this is ready. @stavros11 in case you're interested in, the problem is that the path separator on Windows is the same as the escape character, i.e. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @alecandido, looks good to me. My only concern is that the file reshuffling may cause some weird conflicts with 0.2, but if you are planning to do the rebase I don't have any objection.
from .load import create_platform | ||
from .platform import Platform, unroll_sequences | ||
|
||
__all__ = ["Platform", "create_platform", "unroll_sequences"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is probably trying to reproduce the previous behavior, however in principle we don't need to necessarily expose unroll_sequences
externally. I think it is only used by the Platform
internally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Point is that I don't know what is used and what not, so I kept it to avoid breaking anything.
But what you say makes sense to me, so we could even immediately drop from 0.2.
I have to take care of my own mess :P |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @alecandido, looks good to me.
I just have a suggestion.
Mainly to avoid top-level definitions, that will make it simpler preventing dependency loops (and already helped me detecting some accidental imports)
Thanks devenv for the update
678be53
to
4972ed9
Compare
@stavros11 @andrea-pasquale: I've just rebased, so, as soon as the tests will pass, and given the double approval, I'll directly merge. |
This is mainly an extension of the platform loading feature that I had in mind since long (i.e. just treat
$QIBOLAB_PLATFORMS
as most of the other$PATH
-like variables, with multiple paths and fallback).I started implementing this as a service for #849, to have both
dummy_qrc
andemulators
in scope. However, I doubt it will be useful there, since I will just implement a separate fixture for that (though I could convertdummy_qrc
to a more genericplatforms
fixture, up for voting).In the process, I started narrowing the exports of Qibolab, since I was already touching
__init__.py
. More or less going in the direction of #790.Ok, this is usually not a great idea, and I'm already kind of regretting...
I hope that is not breaking anything (things not listed in
__all__
are exported by accident, and should not be used), but I might split it anyhow...