Skip to content
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

Few improvements to qq compare #937

Merged
merged 4 commits into from
Jul 25, 2024
Merged

Conversation

andrea-pasquale
Copy link
Contributor

Some improvements to qq compare:

  • Handling multiple figures
  • Legend representation

Checklist:

  • Reviewers confirm new code works as expected.
  • Tests are passing.
  • Coverage does not decrease.
  • Documentation is updated.
  • Compatibility with Qibo modules (Please edit this section if the current pull request is not compatible with the following branches).
    • Qibo: master
    • Qibolab: main
    • Qibolab_platforms_qrc: main

@andrea-pasquale andrea-pasquale marked this pull request as ready for review July 21, 2024 05:52
# TODO: remove harcoded
# usually with heatmap first should be signal col = 1
# then phase (col = 2)
# if there is another element it should be a fit done on the first column
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall we raise a warning if j>2?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we could. Actually here the comments are wrong because it should be (0) signal, (1) phase, (2) fit.
So yes, we could raise a warning.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I believe that given that we most likely are not going to be able to write a proper test for the j>2 we might skip the warning... what do you think @GabrielePalazzo?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. Let's leave the comment, just to remember it.

Comment on lines 121 to 123
for i in range(len(plots[0])):
fig0 = plots[0][i]
fig1 = plots[1][i]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor remark.
Can we zip plots[0] and plots[1]? It removes a variable and it's safer (even though we expect plots[0] and plots[1] to have the same length). We can either save the combined plot into a new list or we can reuse fig0.

Suggested change
for i in range(len(plots[0])):
fig0 = plots[0][i]
fig1 = plots[1][i]
for fig0, fig1 in zip(plots[0], plots[1]):

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implemented in 366b632
I've also changed from append_trace to add_trace since I believe that for what we are doing the result should be the same.
If it looks good to you feel free to merge @GabrielePalazzo

@GabrielePalazzo GabrielePalazzo merged commit f716b66 into qq_compare Jul 25, 2024
10 of 19 checks passed
@GabrielePalazzo GabrielePalazzo deleted the improve_qq_compare branch July 25, 2024 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants