Skip to content

Commit

Permalink
Added to the string ".svg" if it didn't have it
Browse files Browse the repository at this point in the history
  • Loading branch information
ItamarGoldman committed Oct 16, 2023
1 parent 4678387 commit 165464a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions qiskit_experiments/framework/experiment_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -1311,6 +1311,12 @@ def figure(
raise ExperimentEntryNotFound(f"Figure {figure_key} not found.")
figure_key = self._figures.keys()[figure_key]

# All figures must have '.svg' in their names when added, as the extension is added to the key
# name in the `add_figures()` method of this class.
if isinstance(figure_key, str):
if ".svg" not in figure_key:
figure_key += ".svg"

figure_data = self._figures.get(figure_key, None)
if figure_data is None and self.service:
figure = self.service.figure(experiment_id=self.experiment_id, figure_name=figure_key)
Expand Down

0 comments on commit 165464a

Please sign in to comment.