Skip to content

Commit

Permalink
Update Documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
ayushjariyal committed Feb 17, 2025
1 parent fb66e7d commit 6896267
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions docs/source/topics/data_types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,27 @@ The user also has to specify the units for both ``x`` and ``y``:
In [4]: xy.set_y(np.array([1, 2, 3, 4]), 'Volume Expansion', '%')
To retrieve the ``x`` values and their metadata, you can use the :py:meth:`~aiida.orm.XyData.get_x` method:
.. code-block:: ipython
In [5]: x_name, x_array, x_units = xy.get_x()
Similarly, to retrieve the ``y`` values and their metadata, use the :py:meth:`~aiida.orm.XyData.get_y` method:

.. code-block:: ipython
In [6]: y_values = xy.get_y()
In [7]: for y_name, y_array, y_units in y_values:
...: print(y_name, y_array, y_units)
You can also retrieve the names of all ``y`` arrays using :py:meth:`~aiida.orm.XyData.get_y_arraynames`:

.. code-block:: ipython
In [8]: y_names = xy.get_y_arraynames()
In [9]: print(y_names)
Note that you can set multiple ``y`` values that correspond to the ``x`` grid.
Same as for the :py:class:`~aiida.orm.ArrayData`, the names and shapes of the arrays are stored to the database, the content of the arrays is stored to the repository in the `numpy format <https://numpy.org/doc/stable/reference/generated/numpy.lib.format.html#npy-format>`_ (``.npy``).

Expand Down

0 comments on commit 6896267

Please sign in to comment.