Skip to content

Commit

Permalink
Started on new suggestions, suggestion 1 finished qiskit-community#1268
Browse files Browse the repository at this point in the history
  • Loading branch information
Musa-Sina-Ertugrul committed Apr 22, 2024
1 parent 5713ab1 commit a1f2864
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions qiskit_experiments/framework/experiment_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -866,6 +866,7 @@ def __add_data(
def add_data(
self,
data: Union[Result, List[Result], Dict, List[Dict]],
**kwargs
) -> None:
"""Add experiment data.
Expand Down Expand Up @@ -907,7 +908,7 @@ def add_data(
for inner_datum in datum["metadata"]["composite_metadata"]:
if "composite_index" in inner_datum:
for sub_expdata in composite_expdata:
self.add_data(inner_datum)
self.add_data(inner_datum,inner_comoposite_flag=False)
except IndexError or RuntimeError or AnalysisError:
new_child = ExperimentData()
for inner_datum in marginalized_datum:
Expand All @@ -926,13 +927,17 @@ def add_data(
for inner_datum in datum["composite_metadata"]:
if "composite_index" in inner_datum:
for sub_expdata in composite_expdata:
self.add_data(inner_datum)
self.add_data(inner_datum,inner_comoposite_flag=False)
except IndexError or RuntimeError or AnalysisError:
new_child = ExperimentData()
for inner_datum in marginalized_datum:
new_child.add_data(inner_datum)
else:
self._result_data.append(datum)
try:
if kwargs["inner_comoposite_flag"]:
self._result_data.append(datum)
except KeyError:
self._result_data.append(datum)

elif isinstance(datum, Result):
self._add_result_data(datum)
Expand Down

0 comments on commit a1f2864

Please sign in to comment.