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

Make figures loaded from experiment db viewable in notebook #436

Closed
chriseclectic opened this issue Oct 19, 2021 · 0 comments
Closed

Make figures loaded from experiment db viewable in notebook #436

chriseclectic opened this issue Oct 19, 2021 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@chriseclectic
Copy link
Collaborator

What is the expected behavior?

If you load a saved experiment from the database trying to view figures returns a bytes object for the loaded SVG file. This can be made viewable by using Ipython.display.SVG so it might be nice to do this automatically in the DbExperimentDataV1.figure function along lines of:

# during file imports
try:
    from IPython.display import SVG
    display_svg = True
except ImportError:
    display_svg = False

# at end of `DbExperimentData.figure` method
if isinstance(figure_data, bytes) and display_svg:
    return SVG(figure_data)
return figure_data
@chriseclectic chriseclectic added the enhancement New feature or request label Oct 19, 2021
@chriseclectic chriseclectic reopened this Apr 19, 2022
@ItamarGoldman ItamarGoldman self-assigned this Nov 13, 2023
github-merge-queue bot pushed a commit that referenced this issue Dec 21, 2023
### Summary

Make figures loaded from experiment db viewable in jupyter notebook as
suggested in #436 .
### Details and comments

Some details that should be in this section include:

- Why this change was necessary
  To  make it more comfortable to use figures in jupyter notebook.
- What do users and developers need to know about this change
To display figures of experiment data that were loaded from experiment
db don't need to convert to SVG.

---------

Co-authored-by: Will Shanks <[email protected]>
nkanazawa1989 pushed a commit to nkanazawa1989/qiskit-experiments that referenced this issue Jan 17, 2024
…ommunity#1321)

### Summary

Make figures loaded from experiment db viewable in jupyter notebook as
suggested in qiskit-community#436 .
### Details and comments

Some details that should be in this section include:

- Why this change was necessary
  To  make it more comfortable to use figures in jupyter notebook.
- What do users and developers need to know about this change
To display figures of experiment data that were loaded from experiment
db don't need to convert to SVG.

---------

Co-authored-by: Will Shanks <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants