-
Notifications
You must be signed in to change notification settings - Fork 127
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
Cleanup composite analysis #1397
Cleanup composite analysis #1397
Conversation
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 @nkanazawa1989, the new code is much cleaner. I only have a comment regarding a bug not from this PR.
) | ||
) | ||
|
||
if self.options.return_data_points: |
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.
Ah, I found a bug while testing this, return_data_points=True
throws an error right now because it's trying to use the old groupby
syntax with ScatterTable
.
I think the fix is
https://github.com/Qiskit-Extensions/qiskit-experiments/blob/0bbd426dc257be6d35daf04d94bbb31e0d059648/qiskit_experiments/curve_analysis/base_curve_analysis.py#L356
should be curve_data.dataframe.groupby("series_name"))
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 for catching the bug!
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.
LGTM, thanks.
### Summary Thanks to #1342 we can cleanup internals of `CompositeCurveAnalysis`. Not API break and no feature upgrade with this PR. ### Details and comments Previously the curve data and fit summary data are internally created in `CurveAnalysis` but immediately discarded. The implementation in `CurveAnalysis._run_analysis` is manually copied to `CompositeCurveAnalysis._run_analysis` to access these artifact data to create composite artifact data from them. This makes code fragile since developers needed to manually update both base classes. With this PR, implementation of component analysis is encapsulated. (cherry picked from commit cb37d42)
Summary
Thanks to #1342 we can cleanup internals of
CompositeCurveAnalysis
. Not API break and no feature upgrade with this PR.Details and comments
Previously the curve data and fit summary data are internally created in
CurveAnalysis
but immediately discarded. The implementation inCurveAnalysis._run_analysis
is manually copied toCompositeCurveAnalysis._run_analysis
to access these artifact data to create composite artifact data from them. This makes code fragile since developers needed to manually update both base classes. With this PR, implementation of component analysis is encapsulated.