Skip to content

Commit 908f4f2

Browse files
committed
update Why UXarray and Install sections
1 parent 5e7f526 commit 908f4f2

2 files changed

Lines changed: 83 additions & 99 deletions

File tree

Lines changed: 55 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -1,116 +1,92 @@
11
.. currentmodule:: uxarray
2-
32
.. _installation:
43

4+
================
55
Installation
6-
============
6+
================
77

8-
This installation guide includes only the UXarray installation instructions. Please
9-
refer to `UXarray Contributor's Guide <https://uxarray.readthedocs.io/en/latest/contributing.html>`_
10-
for detailed information about how to contribute to the UXarray project.
8+
UXarray is built **on top of** `Xarray <https://docs.xarray.dev/en/latest/getting-started-guide/installing.html#installation>`__,
9+
so we **strongly** recommend becoming familiar with Xarray’s installation
10+
process and dependencies first.
1111

12-
Installing UXarray via Conda
13-
----------------------------
12+
For details on contributing, see the :doc:`UXarray Contributor’s Guide <contributing>`.
1413

15-
The easiest way to install UXarray along with its dependencies is via
16-
`Conda <https://conda.io/en/latest>`_::
1714

18-
conda install -c conda-forge uxarray
15+
Installing with Conda (recommended)
16+
-----------------------------------
1917

20-
Note that the Conda package manager automatically installs all `required`
21-
dependencies of UXarray, meaning it is not necessary to explicitly install
22-
Xarray or other required packages when installing UXarray.
18+
UXarray itself is a pure Python package, but its dependencies are not.
19+
The easiest way to get everything installed is to use conda.
20+
To install UXarray with its recommended dependencies using the conda command line tool:
2321

24-
If you are interested in learning more about how Conda environments work, please
25-
visit the `managing environments <https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html>`_
26-
page of the Conda documentation.
2722

28-
Installing UXarray via PyPI
29-
---------------------------
23+
.. code-block:: bash
3024
31-
An alternative to Conda is using pip::
25+
conda install -c conda-forge uxarray
3226
33-
pip install uxarray
27+
.. note::
3428

35-
This installs the minimum set of required dependencies, which includes the following:
29+
Conda automatically installs Xarray and every other required
30+
dependency (including non‑Python libraries).
3631

37-
.. literalinclude:: ../pyproject.toml
38-
:language: toml
39-
:start-after: minimal dependencies start
40-
:end-before: minimal dependencies end
32+
Installing with pip
33+
-------------------
34+
.. code-block:: bash
4135
36+
pip install uxarray
4237
43-
UXarray also maintains other dependency sets for different subsets of functionality::
38+
This installs the *minimal* required dependencies. UXarray also provides optional extras:
4439

45-
$ python -m pip install "uxarray[math]" # Install optional dependencies for accurate math utlities
46-
$ python -m pip install "uxarray[dev]" # Install optional dependencies for development
47-
$ python -m pip install "uxarray[complete]" # Install all optional dependencies
40+
.. code-block:: bash
4841
49-
The above commands should install most of the optional dependencies. However,
50-
some packages which are either not listed on PyPI or require extra
51-
installation steps are excluded. To know which dependencies would be
52-
installed, take a look at the ``[project.optional-dependencies]`` section in
53-
``pyproject.toml``:
42+
pip install "uxarray[dev]" # development tools
43+
pip install "uxarray[complete]" # all optional features
5444
55-
.. literalinclude:: ../pyproject.toml
56-
:language: toml
57-
:start-at: [project.optional-dependencies]
58-
:end-before: [project.urls]
45+
A complete list of extras lives in the ``[project.optional-dependencies]``
46+
section of our `pyproject.toml <https://github.com/UXARRAY/uxarray/blob/main/pyproject.toml>`_
5947

60-
Installing UXarray from source (Github)
61-
---------------------------------------
6248

63-
Installing UXarray from source code is a fairly straightforward task, but
64-
doing so should not be necessary for most users. If you `are` interested in
65-
installing UXarray from source, you will first need to get the latest version
66-
of the code::
49+
Installing from source
50+
----------------------
51+
Installing from source is intended mainly for developers.
6752

68-
git clone https://github.com/UXARRAY/uxarray.git
69-
cd uxarray
53+
#. **Clone the repo**
7054

71-
Required dependencies for installing and testing UXarray
72-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
55+
.. code-block:: bash
7356
74-
The following packages should be installed (in your active conda
75-
environment)::
57+
git clone https://github.com/UXARRAY/uxarray.git
58+
cd uxarray
7659
77-
- Python 3.9+
78-
- `pytest <https://docs.pytest.org/en/stable/>`_ (For tests only)
79-
- `xarray <http://xarray.pydata.org/en/stable/>`_
60+
#. **Create a dev environment**
8061

81-
If you don't have these packages installed, the next section describes
82-
how to setup a conda environment with them.
62+
A ready‑made file is provided at ``ci/environment.yml``:
8363

84-
Creating a Conda environment
85-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
64+
.. code-block:: bash
8665
87-
The UXarray source code includes a conda environment definition file
88-
(:code:`environment.yml`) in the :code:`/ci` folder under the root
89-
directory that can be used to create a development environment
90-
containing all of the packages required to build UXarray. The
91-
following commands should work on Windows, Linux, and macOS to create
92-
and activate a new conda environment from that file::
66+
conda env create -f ci/environment.yml
67+
conda activate uxarray_build
9368
94-
conda env create -f ci/environment.yml
95-
conda activate uxarray_build
69+
#. **Install UXarray**
9670

97-
Installing from source
98-
^^^^^^^^^^^^^^^^^^^^^^
71+
.. code-block:: bash
72+
73+
pip install .
9974
100-
Once the dependencies listed above are installed, you can install
101-
UXarray with running the following command from the root-directory::
75+
#. **Run the test‑suite**
76+
77+
.. code-block:: bash
78+
79+
pytest test
80+
81+
Verifying your installation
82+
---------------------------
10283

103-
pip install .
84+
After installing UXarray, you can verify the installation by running the following in a Python shell or script:
10485

105-
For compatibility purposes, we strongly recommend using Conda to
106-
configure your build environment as described above.
86+
.. code-block:: python
10787
108-
Testing UXarray source
109-
^^^^^^^^^^^^^^^^^^^^^^
88+
import uxarray as ux
11089
111-
A UXarray code base can be tested from the root directory of the source
112-
code repository using the following command (Explicit installation of the
113-
`pytest <https://docs.pytest.org/en/stable/>`_ package may be required, please
114-
see above)::
90+
print(ux.__version__)
11591
116-
pytest test
92+
This should print the installed version of UXarray without errors.

docs/getting-started/overview.rst

Lines changed: 28 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ data analysis techniques to operate directly on unstructured grids. It extends u
88
and inherits from the commonly used Xarray Python package to provide a powerful and
99
familiar interface for working with unstructured grids in Python. UXarray provides
1010
Xarray styled functions to better read in and use unstructured grid datasets that
11-
follow standard conventions, including UGRID, MPAS, SCRIP, and Exodus formats.
11+
follow standard conventions, including UGRID, MPAS, SCRIP, ICON, HEALPix, and Exodus formats.
1212

1313

1414
Unstructured Grids
@@ -27,7 +27,7 @@ single convention for our grid representation instead of having separate ones fo
2727
grid format, meaning that we encode all supported unstructured grid formats in the
2828
UGRID conventions at the data loading step.
2929

30-
Specifically, our core functionality is build around two-dimension
30+
Specifically, our core functionality is built around two-dimensional
3131
Unstructured Grids as defined by the 2D Flexible Mesh Topology in the
3232
UGRID conventions, which can contain a mix of triangles, quadrilaterals, or
3333
other geometric faces.
@@ -36,30 +36,38 @@ other geometric faces.
3636
Core Data Structures
3737
====================
3838

39-
The functionality of UXarray is built around three core data structures which provide
40-
an Unstructured Grid aware implementation of many Xarray functions and use cases.
39+
UXarray’s core API revolves around three primary types, which extend Xarray for unstructured-grid workflows:
40+
41+
.. list-table::
42+
:widths: 20 80
43+
:header-rows: 0
44+
45+
* - :py:class:`uxarray.Grid`
46+
- Represents the unstructured grid itself, housing grid-specific methods and topology variables. Encapsulates a :py:class:`xarray.Dataset` for storing the grid definition.
47+
48+
* - :py:class:`uxarray.UxDataset`
49+
- Extends :py:class:`xarray.Dataset` to operate on unstructured grids; linked to a :py:class:`~uxarray.Grid` instance via its ``uxgrid`` property.
50+
51+
* - :py:class:`uxarray.UxDataArray`
52+
- Similarly extends :py:class:`xarray.DataArray` and exposes a ``uxgrid`` accessor for grid-aware operations.
53+
4154

42-
* ``Grid`` is used to represent our Unstructured Grid, housing grid-specific methods
43-
and topology variables.
44-
* ``UxDataset`` inherits from the ``xarray.Dataset`` class, providing much of the same
45-
functionality but extended to operate on Unstructured Grids. Other than new and
46-
overloaded methods, it is linked to a ``Grid`` object through the use of a class
47-
property (``UxDataset.uxgrid``) to provide a grid-aware implementation. An instance
48-
of ``UxDataset`` can be thought of as a collection of Data Variables that reside on
49-
some Unstructured Grid as defined in the ``uxgrid`` property.
50-
* ``UxDataArray`` similarly inherits from the ``xarray.DataArray`` class and contains
51-
a ``Grid`` property (``UxDataArray.uxgrid``) just like ``UxDataset``.
5255

5356
Core Functionality
5457
==================
5558

56-
In addition to providing a way to load in and interface with Unstructured Grids, we
57-
also aim to provide computational and analysis operators that directly operate on
58-
Unstructured Grids. Some of these include:
59+
In addition to loading and interfacing with Unstructured Grids, UXarray provides
60+
computational and analysis operators that operate directly on those grids. Some of
61+
these include:
62+
5963
* Visualization
6064
* Remapping
61-
* Subsetting & Selection
65+
* Subsetting
66+
* Cross-Sections
6267
* Aggregations
68+
* Zonal Averaging
6369

64-
A more detailed overview of supported functionality can be found in our `API Reference <https://uxarray.readthedocs.io/en/latest/api.html>`_
65-
and `User Guide <https://uxarray.readthedocs.io/en/latest/userguide.html>`_ sections.
70+
A more detailed overview of supported functionality can be found in our
71+
`API Reference <https://uxarray.readthedocs.io/en/latest/api.html>`_
72+
and `User Guide <https://uxarray.readthedocs.io/en/latest/userguide.html>`_
73+
sections.

0 commit comments

Comments
 (0)