Skip to content

Commit 38ceaa0

Browse files
committed
docs and option name
1 parent ef9e61b commit 38ceaa0

File tree

14 files changed

+31
-30
lines changed

14 files changed

+31
-30
lines changed

qiskit_experiments/curve_analysis/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ class AnalysisB(CurveAnalysis):
312312
compute custom quantities based on the raw fit parameters.
313313
See :ref:`curve_analysis_results` for details.
314314
Afterwards, the analysis draws several curves in the Matplotlib figure.
315-
User can set custom drawer to the option ``curve_plotter``.
315+
User can set custom drawer to the option ``curve_drawer``.
316316
The drawer defaults to the :class:`MplCurveDrawer`.
317317
Finally, it returns the list of created analysis results and Matplotlib figure.
318318

qiskit_experiments/curve_analysis/base_curve_analysis.py

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -111,14 +111,14 @@ def parameters(self) -> List[str]:
111111
@property
112112
def drawer(self) -> BaseCurveDrawer:
113113
"""A short-cut for curve drawer instance."""
114-
return self._options.curve_plotter
114+
return self._options.curve_drawer
115115

116116
@classmethod
117117
def _default_options(cls) -> Options:
118118
"""Return default analysis options.
119119
120120
Analysis Options:
121-
curve_plotter (BaseCurveDrawer): A curve drawer instance to visualize
121+
curve_drawer (BaseCurveDrawer): A curve drawer instance to visualize
122122
the analysis result.
123123
plot_raw_data (bool): Set ``True`` to draw processed data points,
124124
dataset without formatting, on canvas. This is ``False`` by default.
@@ -156,7 +156,7 @@ def _default_options(cls) -> Options:
156156
"""
157157
options = super()._default_options()
158158

159-
options.curve_plotter = MplCurveDrawer()
159+
options.curve_drawer = MplCurveDrawer()
160160
options.plot_raw_data = False
161161
options.plot = True
162162
options.return_fit_parameters = True
@@ -173,7 +173,7 @@ def _default_options(cls) -> Options:
173173

174174
# Set automatic validator for particular option values
175175
options.set_validator(field="data_processor", validator_value=DataProcessor)
176-
options.set_validator(field="curve_plotter", validator_value=BaseCurveDrawer)
176+
options.set_validator(field="curve_drawer", validator_value=BaseCurveDrawer)
177177

178178
return options
179179

@@ -187,23 +187,25 @@ def set_options(self, **fields):
187187
KeyError: When removed option ``curve_fitter`` is set.
188188
"""
189189
# TODO remove this in Qiskit Experiments v0.4
190-
if "curve_plotter" in fields and isinstance(fields["curve_plotter"], str):
191-
plotter_str = fields["curve_plotter"]
190+
if "curve_plotter" in fields:
192191
warnings.warn(
193-
f"The curve plotter '{plotter_str}' has been deprecated. "
194-
"The option is replaced with 'MplCurveDrawer' instance. "
192+
f"The analysis option 'curve_plotter' has been deprecated. "
193+
"The option is replaced with 'curve_drawer' that takes 'MplCurveDrawer' instance. "
195194
"If this is a loaded analysis, please save this instance again to update option value. "
196-
"This warning will be removed with backport in Qiskit Experiments 0.4.",
195+
"The 'curve_plotter' argument along with this warning will be removed "
196+
"in Qiskit Experiments 0.4.",
197197
DeprecationWarning,
198198
stacklevel=2,
199199
)
200-
fields["curve_plotter"] = MplCurveDrawer()
200+
del fields["curve_plotter"]
201201

202202
if "curve_fitter" in fields:
203203
warnings.warn(
204204
"Setting curve fitter to analysis options has been deprecated and "
205205
"the option has been removed. The fitter setting is dropped. "
206-
"Now you can directly override '_run_curve_fit' method to apply custom fitter.",
206+
"Now you can directly override '_run_curve_fit' method to apply custom fitter. "
207+
"The `curve_fitter` argument along with this warning will be removed "
208+
"in Qiskit Experiments 0.4.",
207209
DeprecationWarning,
208210
stacklevel=2,
209211
)
@@ -217,7 +219,8 @@ def set_options(self, **fields):
217219
f"Option(s) {deprecated} have been moved to draw_options and will be removed soon. "
218220
"Use self.drawer.set_options instead. "
219221
"If this is a loaded analysis, please save this instance again to update option value. "
220-
"This warning will be removed with backport in Qiskit Experiments 0.4.",
222+
"These arguments along with this warning will be removed "
223+
"in Qiskit Experiments 0.4.",
221224
DeprecationWarning,
222225
stacklevel=2,
223226
)

qiskit_experiments/curve_analysis/curve_data.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
class SeriesDef:
2828
"""A dataclass to describe the definition of the curve.
2929
30-
Args:
30+
Attributes:
3131
fit_func: A callable that defines the fit model of this curve. The argument names
3232
in the callable are parsed to create the fit parameter list, which will appear
3333
in the analysis results. The first argument should be ``x`` that represents
@@ -78,7 +78,7 @@ class CurveData:
7878
This dataset can consist of X, Y values from multiple series.
7979
To extract curve data of the particular series, :meth:`get_subset_of` can be used.
8080
81-
Args:
81+
Attributes:
8282
x: X-values that experiment sweeps.
8383
y: Y-values that observed and processed by the data processor.
8484
y_err: Uncertainty of the Y-values which is created by the data processor.
@@ -130,7 +130,7 @@ def get_subset_of(self, index: Union[str, int]) -> "CurveData":
130130
class FitData:
131131
"""A dataclass to store the outcome of the fitting.
132132
133-
Args:
133+
Attributes:
134134
popt: List of optimal parameter values with uncertainties if available.
135135
popt_keys: List of parameter names being fit.
136136
pcov: Covariance matrix from the least square fitting.
@@ -182,7 +182,7 @@ def fitval(self, key: str) -> uncertainties.UFloat:
182182
class ParameterRepr:
183183
"""Detailed description of fitting parameter.
184184
185-
Args:
185+
Attributes:
186186
name: Original name of the fit parameter being defined in the fit model.
187187
repr: Optional. Human-readable parameter name shown in the analysis result and in the figure.
188188
unit: Optional. Physical unit of this parameter if applicable.

qiskit_experiments/curve_analysis/standard_analysis/error_amplification_analysis.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def _default_options(cls):
106106
considered as good. Defaults to :math:`\pi/2`.
107107
"""
108108
default_options = super()._default_options()
109-
default_options.curve_plotter.set_options(
109+
default_options.curve_drawer.set_options(
110110
xlabel="Number of gates (n)",
111111
ylabel="Population",
112112
ylim=(0, 1.0),

qiskit_experiments/curve_analysis/standard_analysis/gaussian.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class GaussianAnalysis(curve.CurveAnalysis):
7171
@classmethod
7272
def _default_options(cls) -> Options:
7373
options = super()._default_options()
74-
options.curve_plotter.set_options(
74+
options.curve_drawer.set_options(
7575
xlabel="Frequency",
7676
ylabel="Signal (arb. units)",
7777
xval_unit="Hz",

qiskit_experiments/curve_analysis/standard_analysis/resonance.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class ResonanceAnalysis(curve.CurveAnalysis):
7171
@classmethod
7272
def _default_options(cls) -> Options:
7373
options = super()._default_options()
74-
options.curve_plotter.set_options(
74+
options.curve_drawer.set_options(
7575
xlabel="Frequency",
7676
ylabel="Signal (arb. units)",
7777
xval_unit="Hz",

qiskit_experiments/library/characterization/analysis/cr_hamiltonian_analysis.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ class CrossResonanceHamiltonianAnalysis(curve.CurveAnalysis):
196196
def _default_options(cls):
197197
"""Return the default analysis options."""
198198
default_options = super()._default_options()
199-
default_options.curve_plotter.set_options(
199+
default_options.curve_drawer.set_options(
200200
subplots=(3, 1),
201201
xlabel="Flat top width",
202202
ylabel=[

qiskit_experiments/library/characterization/analysis/drag_analysis.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ def _default_options(cls):
120120
descriptions of analysis options.
121121
"""
122122
default_options = super()._default_options()
123-
default_options.curve_plotter.set_options(
123+
default_options.curve_drawer.set_options(
124124
xlabel="Beta",
125125
ylabel="Signal (arb. units)",
126126
)

qiskit_experiments/library/characterization/analysis/ramsey_xy_analysis.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def _default_options(cls):
9595
descriptions of analysis options.
9696
"""
9797
default_options = super()._default_options()
98-
default_options.curve_plotter.set_options(
98+
default_options.curve_drawer.set_options(
9999
xlabel="Delay",
100100
ylabel="Signal (arb. units)",
101101
xval_unit="s",

qiskit_experiments/library/characterization/analysis/t1_analysis.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class T1Analysis(curve.DecayAnalysis):
3030
def _default_options(cls) -> Options:
3131
"""Default analysis options."""
3232
options = super()._default_options()
33-
options.curve_plotter.set_options(
33+
options.curve_drawer.set_options(
3434
xlabel="Delay",
3535
ylabel="P(1)",
3636
xval_unit="s",

0 commit comments

Comments
 (0)