Skip to content

Commit

Permalink
update analysis results docs
Browse files Browse the repository at this point in the history
  • Loading branch information
coruscating committed Feb 11, 2024
1 parent 20dd97b commit 92c7eaf
Showing 1 changed file with 20 additions and 7 deletions.
27 changes: 20 additions & 7 deletions docs/tutorials/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -185,23 +185,36 @@ exponential decay model of the :math:`T_1` experiment:
Analysis Results
----------------

The analysis results resulting from the fit are accessed with :meth:`~.ExperimentData.analysis_results`:
The analysis results resulting from the fit are accessed with
:meth:`~.ExperimentData.analysis_results`. If the ``dataframe=True`` parameter is passed, analysis
results will be retrieved in the pandas :class:`~pandas:pandas.DataFrame` format:

.. jupyter-execute::

exp_data.analysis_results(dataframe=True)

Alternatively, analysis results can be accessed via the legacy list format:

.. jupyter-execute::

for result in exp_data.analysis_results():
print(result)

Results can be indexed numerically (starting from 0) or using their name. Analysis results can also be
retrieved in the pandas :class:`~pandas:pandas.DataFrame` format by passing ``dataframe=True``:
Individual results can be retrieved using their name or their long or short IDs, which will all
return the corresponding :class:`AnalysisResult` object:

.. jupyter-execute::
:hide-code:

exp_data.analysis_results(dataframe=True)
result_id = exp_data.analysis_results("T1").result_id
short_id = result_id.split("-")[0]
print(f"exp_data.analysis_results(\"T1\")")
print(f"exp_data.analysis_results(\"{result_id}\")")
print(f"exp_data.analysis_results(\"{short_id}\")")

.. note::
See the :meth:`~.ExperimentData.analysis_results` API documentation for more
advanced usage patterns to access subsets of analysis results.
.. attention::
Retrieving analysis results by a numerical index, whether an integer or a slice, is deprecated
as of 0.6 and will be removed in a future release.

Each analysis
result value is a ``UFloat`` object from the ``uncertainties`` package. The nominal
Expand Down

0 comments on commit 92c7eaf

Please sign in to comment.