From 165464a62726c3003020b9ca898f1a459d9b8090 Mon Sep 17 00:00:00 2001 From: ItamarGoldman Date: Mon, 16 Oct 2023 14:59:15 +0300 Subject: [PATCH] Added to the string ".svg" if it didn't have it --- qiskit_experiments/framework/experiment_data.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/qiskit_experiments/framework/experiment_data.py b/qiskit_experiments/framework/experiment_data.py index 20fab44cc8..2044bb3aa8 100644 --- a/qiskit_experiments/framework/experiment_data.py +++ b/qiskit_experiments/framework/experiment_data.py @@ -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)