Skip to content

Commit e7f83e9

Browse files
review comments
Co-authored-by: Daniel J. Egger <[email protected]>
1 parent 79e8704 commit e7f83e9

File tree

4 files changed

+21
-21
lines changed

4 files changed

+21
-21
lines changed

qiskit_experiments/curve_analysis/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
Curve analysis provides the analysis base class for a variety of experiments with
2121
a single experimental parameter sweep. This analysis subclasses can override
2222
several class attributes to customize the behavior from data processing to post-processing,
23-
including providing systematic initial guess for parameters tailred to the experiment.
23+
including providing systematic initial guess for parameters tailored to the experiment.
2424
Here we describe how code developers can create new analysis inheriting from the base class.
2525
2626

qiskit_experiments/curve_analysis/base_curve_analysis.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@ def _default_options(cls) -> Options:
122122
Analysis Options:
123123
curve_plotter (BaseCurveDrawer): A curve drawer instance to visualize
124124
the analysis result.
125-
plot_raw_data (bool): Set ``True`` to draw un-formatted data points on canvas.
126-
This is ``False`` by default.
125+
plot_raw_data (bool): Set ``True`` to draw processed data points,
126+
dataset without formatting, on canvas. This is ``False`` by default.
127127
plot (bool): Set ``True`` to create figure for fit result.
128128
This is ``True`` by default.
129129
return_fit_parameters (bool): Set ``True`` to return all fit model parameters
@@ -257,7 +257,7 @@ def _format_data(
257257
"""Post-processing for fit data collection.
258258
259259
Args:
260-
curve_data: Raw data collection created from experiment results.
260+
curve_data: Processed data collection created from experiment results.
261261
262262
Returns:
263263
Formatted data.
@@ -318,7 +318,7 @@ def _run_data_processing(
318318
series: List of series definition defining filtering condition.
319319
320320
Returns:
321-
Collection of curve data extracted from the experiment result.
321+
Processed data that will be sent to the formatter method.
322322
323323
Raises:
324324
DataProcessorError: When key for x values is not found in the metadata.
@@ -365,7 +365,7 @@ def _run_curve_fit(
365365
"""Perform curve fitting on given data collection and fit models.
366366
367367
Args:
368-
curve_data: A formatted data collection to fit.
368+
curve_data: Formatted data to fit.
369369
series: A list of fit models.
370370
371371
Returns:
@@ -493,7 +493,7 @@ def _create_curve_data(
493493
"""Create analysis results for raw curve data.
494494
495495
Args:
496-
curve_data: Full curve dataset used for the fitting.
496+
curve_data: Formatted data that is used for the fitting.
497497
series: List of series definition associated with the curve data.
498498
499499
Returns:

qiskit_experiments/curve_analysis/curve_analysis.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -156,37 +156,37 @@ def _run_analysis(
156156
analysis_results = []
157157

158158
# Run data processing
159-
raw_curve_data = self._run_data_processing(experiment_data.data(), self.__series__)
159+
processed_data = self._run_data_processing(experiment_data.data(), self.__series__)
160160

161161
if self.options.plot and self.options.plot_raw_data:
162162
for s in self.__series__:
163-
raw_data = raw_curve_data.get_subset_of(s.name)
163+
sub_data = processed_data.get_subset_of(s.name)
164164
self.drawer.draw_raw_data(
165-
x_data=raw_data.x,
166-
y_data=raw_data.y,
165+
x_data=sub_data.x,
166+
y_data=sub_data.y,
167167
ax_index=s.canvas,
168168
)
169169
# for backward compatibility, will be removed in 0.4.
170-
self.__processed_data_set["raw_data"] = raw_curve_data
170+
self.__processed_data_set["raw_data"] = processed_data
171171

172172
# Format data
173-
formatted_curve_data = self._format_data(raw_curve_data)
173+
formatted_data = self._format_data(processed_data)
174174
if self.options.plot:
175175
for s in self.__series__:
176176
self.drawer.draw_formatted_data(
177-
x_data=formatted_curve_data.x,
178-
y_data=formatted_curve_data.y,
179-
y_err_data=formatted_curve_data.y_err,
177+
x_data=formatted_data.x,
178+
y_data=formatted_data.y,
179+
y_err_data=formatted_data.y_err,
180180
name=s.name,
181181
ax_index=s.canvas,
182182
color=s.plot_color,
183183
marker=s.plot_symbol,
184184
)
185185
# for backward compatibility, will be removed in 0.4.
186-
self.__processed_data_set["fit_ready"] = formatted_curve_data
186+
self.__processed_data_set["fit_ready"] = formatted_data
187187

188188
# Run fitting
189-
fit_data = self._run_curve_fit(formatted_curve_data, self.__series__)
189+
fit_data = self._run_curve_fit(formatted_data, self.__series__)
190190

191191
# Create figure and result data
192192
if fit_data:
@@ -252,7 +252,7 @@ def _run_analysis(
252252
self.drawer.draw_fit_report(description=report_description)
253253

254254
# Add raw data points
255-
analysis_results.extend(self._create_curve_data(formatted_curve_data, self.__series__))
255+
analysis_results.extend(self._create_curve_data(formatted_data, self.__series__))
256256

257257
# Finalize plot
258258
if self.options.plot:

releasenotes/notes/cleanup-curve-analysis-96d7ff706cae5b4e.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ developer:
66
see qiskit-experiments/#737 for details.
77
88
According to this update, several protected methods that are
9-
originally designed to be overridden by subclass have been deprecated or upgraded.
9+
originally designed to be overridden by subclasses have been deprecated or upgraded.
1010
Check the following list of changes you may need to upgrade your analysis subclass.
1111
1212
- :meth:`CurveAnalysis._generate_fit_guesses`
1313
1414
The signature of method has been upgraded. Now this method should be called with
15-
``curve_data`` and calling ``self._data()`` to get curve data has been deprecated.
15+
``curve_data`` to get the curve data instead of calling ``self._data()`` which has been deprecated.
1616
1717
- :meth:`CurveAnalysis._data`
1818

0 commit comments

Comments
 (0)