-
Notifications
You must be signed in to change notification settings - Fork 15
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
Minor adjustments in result objects #896
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #896 +/- ##
==========================================
+ Coverage 66.61% 66.62% +0.01%
==========================================
Files 55 55
Lines 5942 5954 +12
==========================================
+ Hits 3958 3967 +9
- Misses 1984 1987 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
Fine for 0.1, I'd replace all results objects in 0.2 with arrays (possibly newtype or annotated for the sake of the type check, but just arrays at runtime).
I just left a few minor comments, but they are not changing anything drastically.
@property | ||
def average(self): | ||
"""Perform average over i and q.""" | ||
return self |
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.
Maybe an error?
(It's true that is already averaged, but asking for its average doesn't make sense)
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.
Just a temporary patch for qibocal.
@cached_property | ||
def phase_std(self): | ||
"""Signal phase in radians.""" | ||
return None |
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.
Even this one sounds more appropriate as an error...
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.
Same here
Co-authored-by: Alessandro Candido <[email protected]>
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.
I think for now this is fine as a hack to support qibocal needs. In long term I agree that these result classes should be revisited and simplified.
Since it's only listed in the events, but not linked in any comment, let me note explicitly that it has already been scheduled for 0.2 #899 I could provide a PR with the |
Required by qiboteam/qibocal#832
This PR "corrects" the
average
property ofAveragedIntegratedResults
by returning the object itself without performing the average again.I've also added the property
phase_std
which is useful for qibocal (if you think that it is not necessary I can always drop it and do it directly in qibocal).I'm keeping it as draft to account for any possible changes in qiboteam/qibocal#832
EDIT: I've also implemented #897 here.
Checklist: