Closed BrunoLiegiBastonLiegi closed 5 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 66.64%. Comparing base (
a514441
) to head (92cc146
). Report is 12 commits behind head on main.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@stavros11 @alecandido regarding the try/except
in the list_available
compared to the get_available_platforms
, I believe there is a subtle difference, which we may want or not want to expose. I do not have any strong opinion on this and I am okay with both the options anyway.
The get_available_platforms
only checks which platform is found in the QIBOLAB_PLATFORMS
directory, but it does not provide any information about whether the platform actually works and can be used. An empty file fake_platform/platform.py
would still pass the get_available_platforms
and be listed as available by the list_available_backends
, even though it will certainly fail upon instantiation with the QibolabBackend
.
Therefore, it's just a matter of deciding what the list_available_backends
function should produce, either the list of all the backends/platforms that we are sure (up to some point, because the instantiation of the backend alone is tested) are working, or just the list of the platforms that follow the required formatting.
@BrunoLiegiBastonLiegi, I'm aware of that. But I'd say that, if there is a single function (and I'd keep a single one, to keep it simple), we should perform the simpler task, without extra computation.
Verifying that there is something that looks like a platform is enough, even because to test it is actually working you should attempt an execution, that would require a connection, and more. If there is an inconsistent platform installed in your Qibolab path, then you are responsible for that, or you could contact your sysadmin.
EDIT: moreover, the actual check could be implemented on top of the list_available
function, since it's not MetaBackend
-specific: you can iterate the result of list_available
, load
them, and then try to execute a minimal circuit, without any extra knowledge from the MetaBackend
Alright, then I'll drop the try/except
here. Regarding the general minimal test circuit in the list_available_backends
instead, it looks like a good idea, but, in the qibolab case for example, that would require you to have an accessible qubit everytime you call the function, which seems a little bit too expensive to me.
In general, it could always be an expensive test, because running circuits always requires acquiring the resources needed. How much expensive definitely depends on the backend.
This PR implements a
MetaBackend
to load theqibolab
backend and list the available platforms.Checklist: