Skip to content

Commit 152c733

Browse files
authored
Merge branch 'master' into Write_particledata_on_delete
2 parents a0b1173 + 1ecc9c5 commit 152c733

2 files changed

Lines changed: 49 additions & 42 deletions

File tree

docs/index.rst

Lines changed: 42 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -80,65 +80,73 @@ The best way to get started with Parcels is to have a look at the Jupyter notebo
8080

8181
* `Plotting tutorial <http://nbviewer.jupyter.org/github/OceanParcels/parcels/blob/master/parcels/examples/tutorial_plotting.ipynb>`_ for further explanation on the plotting capabilities of Parcels
8282

83-
.. _installing-linux-macos:
8483

85-
Installing Parcels on Linux and macOS
86-
=====================================
84+
.. _installing-parcels:
8785

88-
Parcels depends on a working Python installation, a netCDF installation, a C
89-
compiler, and various Python packages.
86+
Installing Parcels
87+
==================
9088

91-
The simplest way to install Parcels is to use Anaconda and Conda-Forge for all
92-
requirements. This is the “batteries-included” solution probably suitable for most users.
93-
Note that if you already have an existing Python setup that you wish to use for Parcels, you should follow the instructions at the bottom of this section.
89+
This is the “batteries-included” solution probably suitable for most users.
9490

95-
The five steps below are the installation instructions for Linux and macOS. Note that for Windows, steps 2 and 5 are slightly different, see :ref:`installing-windows` below.
91+
The simplest way to install Parcels is to use Anaconda and the Parcels Conda-Forge package with the latest release of Parcels. This package will automatically install (almost) all the requirements for a fully functional installaion of Parcels.
9692

97-
1. Install Anaconda's Miniconda following the steps at https://conda.io/docs/user-guide/install/. All the code below assumes that you download the Python-2 version.
93+
The steps below are the installation instructions for Linux / macOS and for Windows. If the commands for Linux / macOS and Windows differ, this is indicated with a comment at the end of the line.
9894

99-
2. Download Parcels' `environment.yml <https://raw.githubusercontent.com/OceanParcels/parcels/master/environment.yml>`_ file, navigate to the directory where you saved that file, and run::
95+
1. Install Anaconda's Miniconda following the steps at https://conda.io/docs/user-guide/install/. All the code below assumes that you download the Python-2 version. If you're on Linux / macOS, it also assumes that you installed Miniconda-2 to your home directory.
10096

101-
source $HOME/miniconda2/bin/activate root
102-
conda env create -f environment.yml -n py2_parcels
103-
source $HOME/miniconda2/bin/activate py2_parcels
104-
pip install git+https://github.com/OceanParcels/parcels.git@master
97+
2. Start a terminal (Linux / macOS) or the Anaconda prompt (Windows). Activate the root (or base) environment of your Miniconda and create an environment containing Parcels, all its essential dependencies, and the nice-to-have Jupyter and Basemap package::
10598

106-
3. Validate the installation by downloading the `example_peninsula.py <https://raw.githubusercontent.com/OceanParcels/parcels/master/parcels/examples/example_peninsula.py>`_ file, navigate to the directory where you saved that file, and then run::
99+
source $HOME/miniconda2/bin/activate root # Linux / macOS
100+
activate root # Windows
107101

108-
python example_peninsula.py --fieldset 100 100
102+
conda create -n py2_parcels -c conda-forge parcels jupyter basemap basemap-data-hires
103+
104+
3. Activate the newly created Parcels environment, get a copy of the the Parcels tutorials and examples, and run the simplest of the examples to validate that you have a working Parcels setup::
109105

110-
4. Optionally, if you want to run all the examples and tutorials, you can get tutorials and example data by running::
106+
source $HOME/miniconda2/bin/activate py2_parcels # Linux / macOS
107+
activate py2_parcels # Windows
111108

112109
parcels_get_examples parcels_examples
113110
cd parcels_examples
111+
112+
python example_peninsula.py --fieldset 100 100
113+
114+
4. Optionally, if you want to run all the examples and tutorials, start Jupyter and open the tutorial notebooks::
115+
114116
jupyter notebook
115117

116118
5. The next time you start a terminal and want to work with Parcels, activate the environment with::
117119

118-
source $HOME/miniconda2/bin/activate py2_parcels
120+
source $HOME/miniconda2/bin/activate py2_parcels # Linux / macOS
121+
activate py2_parcels # Windows
122+
123+
124+
.. _installing-arbitrary-Git-reference:
125+
126+
Installing a non-released version of Parcels
127+
============================================
119128

120-
An alternative, more advanced option is to use an existing netCDF installation and
121-
C compiler, ``git clone`` the `master branch of Parcels
122-
<https://github.com/OceanParcels/parcels>`_
123-
and ``pip install`` the dependencies in the `environment.yml <https://raw.githubusercontent.com/OceanParcels/parcels/master/environment.yml>`_ file.
129+
There might be cases where you want to install a version of Parcels that has not been released yet. (Perhaps, if you want to use a bleeding-edge feature which already is included on Github, but not in the conda-forge package.)
124130

125-
.. _installing-windows:
131+
Then, just after step 2 of :ref:`installing-parcels` above, remove the conda-forge package again, and use Pip to install Parcels from Github::
132+
133+
source $HOME/miniconda2/bin/activate py2_parcels_master # Linux / macOS
134+
activate py2_parcels_master # Windows
135+
136+
conda remove parcels
137+
pip install git+https://github.com/OceanParcels/parcels.git@master
126138

127-
Installing Parcels on Windows
128-
=============================
129139

130-
The installation process and usage of Parcels is much the same as under :ref:`installing-linux-macos` above. **However, steps 2 and 5 will be different**, as detailed below:
140+
.. _installation-dev:
131141

132-
2. Download Parcels' `environment_win.yml <https://raw.githubusercontent.com/OceanParcels/parcels/master/environment_win.yml>`_ file from the main Parcels' directory, start the ``Anaconda Prompt`` from the Windows start menu, navigate to the directory where you saved that file, and then run::
142+
Installation for developers
143+
===========================
133144

134-
activate root
135-
conda env create -f environment_win.yml -n py2_parcels
136-
activate py2_parcels
137-
pip install git+https://github.com/OceanParcels/parcels.git@master
145+
Parcels depends on a working Python installation, a netCDF installation, a C compiler, and various Python packages. If you prefer to maintain your own Python installation providing all this, ``git clone`` the `master branch of Parcels <https://github.com/OceanParcels/parcels>`_ and manually ``pip install`` all packages lister under ``dependencies`` in the `environment.yml <https://raw.githubusercontent.com/OceanParcels/parcels/master/environment.yml>`_ file.
138146

139-
5. The next time you start the ``Anaconda Prompt`` and want to work with Parcels, activate the environment with::
147+
Then, install Parcels in an `editable way <https://pip.pypa.io/en/stable/reference/pip_install/?highlight=editable#cmdoption-e>`_ by running::
140148

141-
activate py2_parcels
149+
pip install -e .
142150

143151

144152
Getting involved

setup.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
11
"""Install Parcels and dependencies."""
22

33
try:
4-
from setuptools import setup
4+
from setuptools import setup, find_packages
55
except ImportError:
6-
from distutils.core import setup
6+
from distutils.core import setup, find_packages
77

88
setup(name='parcels',
9-
version='0.0.1',
9+
version='1.0',
1010
description="""Framework for Lagrangian tracking of virtual
1111
ocean particles in the petascale age.""",
12-
author="Imperial College London",
12+
author="oceanparcels.org team",
1313
use_scm_version=True,
1414
setup_requires=['setuptools_scm'],
15-
packages=['parcels'],
16-
package_data={'parcels': ['parcels/include/*',
17-
'parcels/examples/*']},
18-
include_package_data=True,
15+
packages=find_packages(),
16+
package_data={'parcels': ['include/*',
17+
'examples/*']},
1918
entry_points={'console_scripts': [
2019
'parcels_get_examples = parcels.scripts.get_examples:main']}
2120
)

0 commit comments

Comments
 (0)