22
22
import numpy as np
23
23
import pandas as pd
24
24
25
- from qiskit .utils .deprecation import deprecate_func
26
-
27
25
from qiskit_experiments .framework import (
28
26
AnalysisResultData ,
29
27
BaseAnalysis ,
30
28
ExperimentData ,
31
29
Options ,
32
30
)
33
31
from qiskit_experiments .visualization import (
34
- BaseDrawer ,
35
32
BasePlotter ,
36
33
CurvePlotter ,
37
- LegacyCurveCompatDrawer ,
38
34
MplDrawer ,
39
35
)
40
36
@@ -76,7 +72,6 @@ class CompositeCurveAnalysis(BaseAnalysis):
76
72
for qi in (0, 1):
77
73
analysis = curve.OscillationAnalysis(name=f"init{qi}")
78
74
analysis.set_options(
79
- return_fit_parameters=["freq"],
80
75
filter_data={"init_state": qi},
81
76
)
82
77
analysis = CompositeCurveAnalysis(analyses=analyses)
@@ -147,20 +142,6 @@ def plotter(self) -> BasePlotter:
147
142
"""A short-cut to the plotter instance."""
148
143
return self ._options .plotter
149
144
150
- @property
151
- @deprecate_func (
152
- since = "0.5" ,
153
- additional_msg = "Use `plotter` from the new visualization module instead." ,
154
- removal_timeline = "after 0.6" ,
155
- package_name = "qiskit-experiments" ,
156
- )
157
- def drawer (self ) -> BaseDrawer :
158
- """A short-cut for curve drawer instance, if set. ``None`` otherwise."""
159
- if hasattr (self ._options , "curve_drawer" ):
160
- return self ._options .curve_drawer
161
- else :
162
- return None
163
-
164
145
def analyses (
165
146
self , index : Optional [Union [str , int ]] = None
166
147
) -> Union [BaseCurveAnalysis , List [BaseCurveAnalysis ]]:
@@ -273,8 +254,6 @@ def _default_options(cls) -> Options:
273
254
This is ``True`` by default.
274
255
return_fit_parameters (bool): (Deprecated) Set ``True`` to return all fit model parameters
275
256
with details of the fit outcome. Default to ``False``.
276
- return_data_points (bool): (Deprecated) Set ``True`` to include in the analysis result
277
- the formatted data points given to the fitter. Default to ``False``.
278
257
extra (Dict[str, Any]): A dictionary that is appended to all database entries
279
258
as extra information.
280
259
"""
@@ -283,7 +262,6 @@ def _default_options(cls) -> Options:
283
262
plotter = CurvePlotter (MplDrawer ()),
284
263
plot = True ,
285
264
return_fit_parameters = False ,
286
- return_data_points = False ,
287
265
extra = {},
288
266
)
289
267
@@ -293,27 +271,6 @@ def _default_options(cls) -> Options:
293
271
return options
294
272
295
273
def set_options (self , ** fields ):
296
- # TODO remove this in Qiskit Experiments 0.6
297
- if "curve_drawer" in fields :
298
- warnings .warn (
299
- "The option 'curve_drawer' is replaced with 'plotter'. "
300
- "This option will be removed in Qiskit Experiments 0.6." ,
301
- DeprecationWarning ,
302
- stacklevel = 2 ,
303
- )
304
- # Set the plotter drawer to `curve_drawer`. If `curve_drawer` is the right type, set it
305
- # directly. If not, wrap it in a compatibility drawer.
306
- if isinstance (fields ["curve_drawer" ], BaseDrawer ):
307
- plotter = self .options .plotter
308
- plotter .drawer = fields .pop ("curve_drawer" )
309
- fields ["plotter" ] = plotter
310
- else :
311
- drawer = fields ["curve_drawer" ]
312
- compat_drawer = LegacyCurveCompatDrawer (drawer )
313
- plotter = self .options .plotter
314
- plotter .drawer = compat_drawer
315
- fields ["plotter" ] = plotter
316
-
317
274
for field in fields :
318
275
if not hasattr (self .options , field ):
319
276
warnings .warn (
@@ -349,10 +306,7 @@ def _run_analysis(
349
306
metadata = analysis .options .extra
350
307
metadata ["group" ] = analysis .name
351
308
analysis .set_options (
352
- plot = False ,
353
- extra = metadata ,
354
- return_fit_parameters = self .options .return_fit_parameters ,
355
- return_data_points = self .options .return_data_points ,
309
+ plot = False , extra = metadata , return_fit_parameters = self .options .return_fit_parameters
356
310
)
357
311
results , _ = analysis ._run_analysis (experiment_data )
358
312
for res in results :
0 commit comments