Skip to content

Commit 0d5e949

Browse files
authored
updated instructions for installing ecco_v4_py
updated instructions for installing ecco_v4_py
1 parent 7e51911 commit 0d5e949

1 file changed

Lines changed: 25 additions & 123 deletions

File tree

doc/Installing_Python_and_Python_Packages.rst

Lines changed: 25 additions & 123 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Python and Python Packages
33
**************************
44

5-
Our Python tutorial is compatible with Python 3. It relies on several packages including **ecco_v4-py** which include codes to facilitate loading, plotting, and performing calculations on ECCOv4 state estimate fields.
5+
The ECCO Python tutorial is compatible with Python 3. It relies on several packages including **ecco_v4-py** which include codes to facilitate loading, plotting, and performing calculations on ECCOv4 state estimate fields.
66

77
.. _in-python:
88

@@ -49,7 +49,7 @@ The latest installers for the Anaconda Distribution can be found on the `Anacond
4949
Downloading the *ecco_v4_py* Python Package
5050
-------------------------------------------
5151

52-
The *ecco_v4_py* package is a library of routines that are helpful for analyzing the ECCO the Version 4 state estimate. The latest version can always be found on our `github repository`_
52+
The *ecco_v4_py* package is a library of routines for analyzing the ECCO the Version 4 state estimate. The latest version can always be found on our `github repository`_
5353

5454

5555
Below are three **options** or installing the *ecco_v4_py* Python package.
@@ -64,8 +64,8 @@ Option 1: Clone into the repository using git (recommended)
6464
Cloning into the *ecco_v4_py* repository using `git`
6565
is recommended because
6666

67-
a) you can easily see and modify the ecco_v4_py source code
68-
b) you can improve the source code and share your improvements with the community.
67+
a) you can easily see and modify source code
68+
b) you share your improvements with the community.
6969

7070
To use `git` to clone into the project simply run the following commands
7171
(in the example below the Python files will go into ~/ECCOv4-py/)
@@ -77,9 +77,9 @@ To use `git` to clone into the project simply run the following commands
7777
> git clone https://github.com/ECCO-GROUP/ECCOv4-py.git
7878
7979
80-
Option 2: Download the repository using git (not recommended)
80+
Option 2: Download the repository using git (less recommended)
8181
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
82-
This method gets you the source code but if you make changes it is harder to share those changes with the community. Use this method if you don't have access to git.
82+
This method downloads the source code but if you make changes it is harder to share those changes with the community using git.
8383

8484
.. code-block:: bash
8585
@@ -89,141 +89,42 @@ This method gets you the source code but if you make changes it is harder to sha
8989
> unzip master.zip
9090
> rm master.zip
9191
92+
Option 3: Use the *conda* package manager (less recommended)
93+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
94+
*ecco_v4_py* is available via the *conda* package management system (see https://anaconda.org/conda-forge/ecco_v4_py )
95+
Installing using conda should install all of the required dependencies.
96+
97+
.. code-block:: bash
98+
99+
conda install ecco_v4_py
92100
93101
94-
Option 3: Use the *pip* Python package tool (not at all recommended)
102+
Option 4: Use the *pip* package manager (not at all recommended)
95103
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
96-
If you use *pip* to install the *ecco_v4_py* package the source code will be installed in your Python library directory from https://pypi.org/project/ecco-v4-py/. This method is OK if you don't plan to look at or modify the library code, but what fun would that be? Also, YMMV with respect to installing dependencies.
104+
*ecco_v4_py* is available via the *pip* package manager (see https://pypi.org/project/ecco-v4-py/ ) Before using pip, you must first install the PROJ and GEOS libraries (see next section).
97105

98106
.. code-block:: bash
99107
100108
pip install ecco_v4_py
101109
102110
103-
104111
105-
Installing Required Python Packages
106-
-----------------------------------
107-
108-
The following additional packages must be installed
109-
110-
.. code-block:: bash
111-
112-
- aiohttp
113-
- codecov
114-
- cartopy>=0.18.0
115-
- cmocean
116-
- dask
117-
- docrep
118-
- fsspec
119-
- future
120-
- geos
121-
- matplotlib
122-
- netcdf4
123-
- numpy
124-
- pathlib
125-
- proj
126-
- pytest
127-
- python=3.8
128-
- pytest-cov
129-
- pyresample
130-
- scipy
131-
- xarray
132-
- xgcm>=0.5.0
133-
- xmitgcm>=0.5.1
134-
135-
Below are several **options** or installing these packages. PICK ONE!
136-
137-
138-
Option 1: *Conda*
139-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
140-
.. attention::
141-
Conda is recommended because it automatically installs the GEOS (Geometry Engine, Open Source) library which is needed to make projection plots.
142-
143-
To simply install all required dependencies using conda, create a new conda environment using the ECCOv4-py environment YAML.
144-
145-
146-
.. code-block:: bash
147-
148-
cd your_ECCOv4_py_directory/
149-
conda env create --name ECCOv4_py --file ci/environment-py38.yml
150-
151-
To activate the conda environment with the required dependencies call:
152-
153-
.. code-block:: bash
154-
155-
conda activate ECCOv4_py
156-
112+
Installing Dependencies
113+
-----------------------
157114

158-
Alternatively, one can install the dependencies one at a time into an existing conda environment:
159-
160-
.. code-block:: bash
161-
162-
conda activate yourExistingCondaEnvironment
163-
164-
conda install -c conda-forge aiohttp
165-
conda install -c conda-forge codecov
166-
conda install -c conda-forge cartopy
167-
conda install -c conda-forge cmocean
168-
conda install -c conda-forge dask
169-
conda install -c conda-forge docrep
170-
conda install -c conda-forge fsspec
171-
conda install -c conda-forge future
172-
conda install -c conda-forge geos
173-
conda install -c conda-forge matplotlib
174-
conda install -c conda-forge netcdf4
175-
conda install -c conda-forge numpy
176-
conda install -c conda-forge pathlib
177-
conda install -c conda-forge proj
178-
conda install -c conda-forge pytest
179-
conda install -c conda-forge pytest-cov
180-
conda install -c conda-forge pyresample
181-
conda install -c conda-forge scipy
182-
conda install -c conda-forge xarray
183-
conda install -c conda-forge xgcm
184-
conda install -c conda-forge xmitgcm
185-
186-
187-
Option 2: *pip* alone (not recommended)
188-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
189-
190115
.. DANGER::
191-
The Python module Cartopy requires the GEOS (Geometry Engine, Open Source) library. Instructions for installing this library can be found on the `geos website`_. Some users have reported difficulties installing GEOS libraries on their platforms. For that reason, we recommend using Conda (Option 1).
192-
193-
To install geos, following instructions here:
194-
https://pygeos.readthedocs.io/en/latest/installation.html
116+
While conda is recommended because it automatically installs the required the GEOS (Geometry Engine) and PROJ (generic coordinate transformation software) binary libraries, you can install those libraries yourself.
195117

118+
Instructions for installing the GEOS library can be found on the `geos website`_.
196119

197-
.. code-block:: bash
120+
Instructions for installing the PROJ library can be found on the `proj website`_.
198121

199-
pip install geos
200-
pip install aiohttp
201-
pip install codecov
202-
pip install cmocean
203-
pip install dask
204-
pip install docrep
205-
pip install fsspec
206-
pip install future
207-
pip install matplotlib
208-
pip install netcdf4
209-
pip install numpy
210-
pip install pathlib
211-
pip install pytest
212-
pip install pytest-cov
213-
pip install pyresample
214-
pip install scipy
215-
pip install xarray
216-
pip install xgcm
217-
pip install xmitgcm
218-
pip install proj
219-
pip install cartopy
220-
221-
122+
Some users have reported difficulties installing these libraries on their platforms. For that reason, we recommend using conda (Option 1).
222123

223124

224125

225126
Using the *ecco_v4_py* in your programs
226-
------------------------------------------------------
127+
---------------------------------------
227128

228129
Assuming you downloaded the *ecco_v4_py* routines to ``/home/username/ECCOv4-py`` then simply add these three lines to the top of your Python programs (or Jupyter Notebooks)
229130

@@ -240,6 +141,7 @@ If you you installed the package using pip then the *ecco_v4_py* library will be
240141
241142
import ecco_v4_py as ecco
242143
243-
.. _geos website: https://trac.osgeo.org/geos
244144
145+
.. _proj website: https://proj.org/install.html
146+
.. _geos website: https://libgeos.org/
245147
.. _github repository: https://github.com/ECCO-GROUP/ECCOv4-py/tree/master/ecco_v4_py

0 commit comments

Comments
 (0)