You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -9,7 +9,7 @@ Our Python tutorial is compatible with Python 3. It relies on several packages
9
9
Why Python?
10
10
-----------
11
11
12
-
`Python <https://www.python.org/>`_ is an easy to learn, open source programming language. In addition to the standard language library, there are thousands of free third-party modules (code libraries) available on the `Python Package Index <https://pypi.org/>`_ (PyPI). Unlike commerical numerical computing environments like Matlab and IDL, Python is free for everyone to use. In addition, Python code can be run on just any platform whether Windows, Linux, or OS X.
12
+
`Python <https://www.python.org/>`_ is an easy to learn open source programming language. In addition to the standard language library, there are thousands of free third-party modules (code libraries) available on code repositories such as `Python Package Index <https://pypi.org/>`_ (PyPI), `_Conda <https://anaconda.org/anaconda/repo>`_ and `Conda Forge <https://conda-forge.org/feedstock-outputs/>`_. Unlike commerical numerical computing environments like Matlab and IDL, Python is free for everyone to use. In addition, Python code can be run on multiple platforms such as Windows, Linux, and OS X.
13
13
14
14
Here are some links to help you learn more about Python.
15
15
@@ -22,19 +22,14 @@ Here are some links to help you learn more about Python.
22
22
23
23
.. _in-Installing:
24
24
25
-
Installing Python and the Anaconda Distribution
25
+
Installing Python
26
26
-----------------------------------------------
27
27
28
-
Python
29
-
^^^^^^
30
-
The latest installers for Python for many platforms can be found on the `Python website <https://www.python.org/downloads/release/python-2714/>`_.
31
-
28
+
There are several ways of installing Python on your machine. You can install compiled binaries directly from the `Python website <https://www.python.org/downloads/release/python-2714/>`_, or one can install via a package manager such as Anaconda or Miniconda. I personally find the Anaconda or Miniconda route to be simplest.
32
29
33
30
Anaconda
34
31
^^^^^^^^
35
-
Python code can be written in any text editor and run from the command line. Third-party modules can be manually installed from the command line using the `pip`_ package manager.
36
-
37
-
Python code can also be written and executed in an interactive environment (integrated development environment, IDE) similar to the Matlab console. For scientific computing, the `Anaconda`_ Python distribution is quite convenient because it comes with a `large collection`_ of useful modules, a good open source IDE, `Spyder`_., and the ability to open and execute `Jupyter Notebooks`_
32
+
For scientific computing, the `Anaconda`_ Python distribution is quite convenient because it comes with a `large collection`_ of useful modules, a good open source IDE, `Spyder`_., and the ability to open and execute `Jupyter Notebooks`_
38
33
39
34
The latest installers for the Anaconda Distribution can be found on the `Anaconda website`_
40
35
@@ -49,57 +44,12 @@ The latest installers for the Anaconda Distribution can be found on the `Anacond
49
44
50
45
.. _in-libraries:
51
46
52
-
Installing Required Python Packages
53
-
-----------------------------------
54
-
55
-
After installing Anaconda the following packages must be installed:
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).
84
-
85
-
86
-
.. code-block:: bash
87
-
88
-
pip install netcdf4
89
-
pip install pyresample
90
-
pip install cartopy
91
-
pip install xarray
92
-
[SEE NOTE!] pip install xmitgcm
93
-
pip install xgcm
94
-
pip install cmocean
95
47
96
48
97
-
98
-
99
49
Downloading the *ecco_v4_py* Python Package
100
50
-------------------------------------------
101
51
102
-
The *ecco_v4_py* package is a library of routines that are helpful for analyzing the ECCO v4 state estimate. It is stored on the `github repository`_
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`_
103
53
104
54
105
55
Below are three **options** or installing the *ecco_v4_py* Python package.
@@ -129,7 +79,7 @@ To use `git` to clone into the project simply run the following commands
129
79
130
80
Option 2: Download the repository using git (not recommended)
This method gets you the source code but if you make changes it is harder to share those changes with the community.
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.
133
83
134
84
.. code-block:: bash
135
85
@@ -139,21 +89,141 @@ This method gets you the source code but if you make changes it is harder to sha
139
89
> unzip master.zip
140
90
> rm master.zip
141
91
142
-
Of course you may want to use this method if you don't have access to git.
143
92
144
-
Option 3: Use the *pip* Python package tool (not recommended)
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.
93
+
94
+
Option 3: Use the *pip* Python package tool (not at all recommended)
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.
147
97
148
98
.. code-block:: bash
149
99
150
100
pip install ecco_v4_py
101
+
102
+
103
+
151
104
105
+
Installing Required Python Packages
106
+
-----------------------------------
152
107
153
-
Using the *ecco_v4_py* Python Package in your programs
The following additional packages must be installed
109
+
110
+
.. code-block:: bash
155
111
156
-
If you use Options 1 or 2 to download the *ecco_v4_py* source code then you must tell Python the location of the files before Python can it. This is easy, you just you just have to remember to do it at the top of all of your programs!
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!
To activate the conda environment with the required dependencies call:
152
+
153
+
.. code-block:: bash
154
+
155
+
conda activate ECCOv4_py
156
+
157
+
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
+
190
+
.. 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).
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)
159
229
@@ -164,7 +234,7 @@ Assuming you downloaded the *ecco_v4_py* routines to ``/home/username/ECCOv4-py`
164
234
import ecco_v4_py as ecco
165
235
166
236
167
-
If you used Method 3 (pip install) then the *ecco_v4_py* library will be automatically installed and will be ready to import into your Python program via the following commands:
237
+
If you you installed the package using pip then the *ecco_v4_py* library will be automatically installed and will be ready to import into your Python program via the following commands:
0 commit comments