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

Figure extraction from experiment data by name without extension #1287

Merged
merged 6 commits into from
Oct 23, 2023

Conversation

ItamarGoldman
Copy link
Contributor

@ItamarGoldman ItamarGoldman commented Oct 16, 2023

Summary

Figure names could be referred without ".svg" at the ending.

Details and comments

Some details that should be in this section include:
In #629 , an issue was raised where a figure that was saved with the name "abcd" couldn't be accessed. This issue is caused by that the 'add_figures()' method in ExperimentData class added ".svg" automatically. As it explicitly written that SVG extension is added if the file name doesn't have one, we can conclude that all figure names have ".svg" extension. To not make a major change in the code I added to the figure method in ExperimentData class a check for the extension of the figure_key. If it doesn't have ".svg" ending, it adds one before trying to pull it from the dict of figures.

@ItamarGoldman ItamarGoldman changed the title Figure extraction from experiment data by name without extension [WIP]Figure extraction from experiment data by name without extension Oct 16, 2023
@ItamarGoldman ItamarGoldman changed the title [WIP]Figure extraction from experiment data by name without extension Figure extraction from experiment data by name without extension Oct 23, 2023
Co-authored-by: Yael Ben-Haim <[email protected]>
@ItamarGoldman ItamarGoldman added this pull request to the merge queue Oct 23, 2023
Merged via the queue into qiskit-community:main with commit 7e920d3 Oct 23, 2023
10 checks passed
@ItamarGoldman ItamarGoldman deleted the IS-629 branch October 30, 2023 07:54
nkanazawa1989 pushed a commit to nkanazawa1989/qiskit-experiments that referenced this pull request Jan 10, 2024
…kit-community#1287)

### Summary

Figure names could be referred without ".svg" at the ending.
### Details and comments

Some details that should be in this section include:
In qiskit-community#629 , an issue was raised where a figure that was saved with the
name "abcd" couldn't be accessed. This issue is caused by that the
'add_figures()' method in `ExperimentData` class added ".svg"
automatically. As it explicitly written that SVG extension is added if
the file name doesn't have one, we can conclude that all figure names
have ".svg" extension. To not make a major change in the code I added to
the `figure` method in `ExperimentData` class a check for the extension
of the `figure_key`. If it doesn't have ".svg" ending, it adds one
before trying to pull it from the dict of figures.

---------

Co-authored-by: Yael Ben-Haim <[email protected]>
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.

2 participants