Skip to content

Commit

Permalink
Remove kwargs from Experiment.analysis class meth
Browse files Browse the repository at this point in the history
  • Loading branch information
chriseclectic committed May 26, 2021
1 parent c5479e3 commit 58ee4d4
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions qiskit_experiments/base_experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,17 +142,13 @@ def run_analysis(self, experiment_data, **options) -> ExperimentData:
Raises:
QiskitError: if experiment_data container is not valid for analysis.
"""
if self.__analysis_class__ is None:
raise QiskitError(f"Experiment {self._type} does not have a default Analysis class")

# Get analysis options
analysis_options = copy.copy(self.analysis_options)
analysis_options.update_options(**options)
analysis_options = analysis_options.__dict__

# Run analysis
# pylint: disable = not-callable
analysis = self.__analysis_class__()
analysis = self.analysis()
analysis.run(experiment_data, save=True, return_figures=False, **analysis_options)
return experiment_data

Expand All @@ -167,12 +163,12 @@ def physical_qubits(self) -> Tuple[int]:
return self._physical_qubits

@classmethod
def analysis(cls, **kwargs):
def analysis(cls):
"""Return the default Analysis class for the experiment."""
if cls.__analysis_class__ is None:
raise QiskitError(f"Experiment {cls.__name__} does not have a default Analysis class")
# pylint: disable = not-callable
return cls.__analysis_class__(**kwargs)
return cls.__analysis_class__()

@abstractmethod
def circuits(self, backend: Optional[Backend] = None) -> List[QuantumCircuit]:
Expand Down

0 comments on commit 58ee4d4

Please sign in to comment.