-
Notifications
You must be signed in to change notification settings - Fork 6
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
Circuit serialization as parameters of the tomography #1002
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1002 +/- ##
==========================================
- Coverage 97.52% 97.45% -0.07%
==========================================
Files 123 123
Lines 9714 9723 +9
==========================================
+ Hits 9474 9476 +2
- Misses 240 247 +7
Flags with carried forward coverage won't be shown. Click here to find out more.
|
@Edoardo-Pedicillo we will eventually move to Pydantic serialization even in Qibocal (it's a waste of time to maintain our own, when there is a high-quality maintained library doing that). If your solution is working, for the time being is more than enough. |
src/qibocal/auto/task.py
Outdated
circuit_file = open(circuit_path, "w") | ||
json.dump(value.raw, circuit_file) |
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.
Either use with open(...) as fd:
or use circuit_file.write_text(json.dumps(...))
. You should close file descriptors, and better doing it automatically than manually.
This PR is a patch to solve the serialization of Circuit parameters, like in state tomographies (this happens with the scripts). Maybe a better solution would be to define a dump method specific for each parameter class and call it directly in the action dump method.
Checklist:
master
0.1.9
main