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
Copy file name to clipboardExpand all lines: docs/index.rst
+42-34Lines changed: 42 additions & 34 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -80,65 +80,73 @@ The best way to get started with Parcels is to have a look at the Jupyter notebo
80
80
81
81
* `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
82
82
83
-
.. _installing-linux-macos:
84
83
85
-
Installing Parcels on Linux and macOS
86
-
=====================================
84
+
.. _installing-parcels:
87
85
88
-
Parcels depends on a working Python installation, a netCDF installation, a C
89
-
compiler, and various Python packages.
86
+
Installing Parcels
87
+
==================
90
88
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.
94
90
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.
96
92
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.
98
94
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.
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::
105
98
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
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::
109
105
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
111
108
112
109
parcels_get_examples parcels_examples
113
110
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
+
114
116
jupyter notebook
115
117
116
118
5. The next time you start a terminal and want to work with Parcels, activate the environment with::
117
119
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
+
============================================
119
128
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.)
124
130
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
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:
131
141
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::
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.
138
146
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::
Copy file name to clipboardExpand all lines: parcels/examples/parcels_tutorial.ipynb
+9-14Lines changed: 9 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -383,8 +383,7 @@
383
383
"pset.execute(AdvectionRK4, # the kernel (which defines how particles move)\n",
384
384
" runtime=timedelta(days=6), # the total length of the run\n",
385
385
" dt=timedelta(minutes=5), # the timestep of the kernel\n",
386
-
" interval=timedelta(hours=1), # the interval at which output is stored\n",
387
-
" output_file=pset.ParticleFile(name=\"EddyParticles\")) # the name of the output file"
386
+
" output_file=pset.ParticleFile(name=\"EddyParticles\", outputdt=timedelta(hours=1))) # the file name and the time step of the outputs"
388
387
]
389
388
},
390
389
{
@@ -981,7 +980,7 @@
981
980
"editable": true
982
981
},
983
982
"source": [
984
-
"Now one of the neat features of Parcels is that the particles can be plotted as a movie *during execution*, which is great for debugging. To rerun the particles while plotting them on top of the zonal velocity field (`fieldset.U`), first reinitialise the `ParticleSet` and then re-execute. However, now rather than saving the output to a file, display a movie using the `show_movie` keyword, in this case with the zonal velocity `fieldset.U` as background"
983
+
"Now one of the neat features of Parcels is that the particles can be plotted as a movie *during execution*, which is great for debugging. To rerun the particles while plotting them on top of the zonal velocity field (`fieldset.U`), first reinitialise the `ParticleSet` and then re-execute. However, now rather than saving the output to a file, display a movie using the `moviedt` display frequency, in this case with the zonal velocity `fieldset.U` as background"
985
984
]
986
985
},
987
986
{
@@ -1000,8 +999,8 @@
1000
999
"# pset.execute(AdvectionRK4,\n",
1001
1000
"# runtime=timedelta(days=6),\n",
1002
1001
"# dt=timedelta(minutes=5),\n",
1003
-
"# interval=timedelta(hours=1),\n",
1004
-
"# show_movie=fieldset.U)"
1002
+
"# moviedt=timedelta(hours=1),\n",
1003
+
"# movie_background_field=fieldset.U)"
1005
1004
]
1006
1005
},
1007
1006
{
@@ -1036,9 +1035,8 @@
1036
1035
"source": [
1037
1036
"pset.execute(AdvectionRK4,\n",
1038
1037
" dt=-timedelta(minutes=5), # negative timestep for backward run\n",
1039
-
" endtime=timedelta(days=0), # the end time of the run\n",
1040
-
" interval=-timedelta(hours=1), # negative interval for backward run\n",
1041
-
" output_file=pset.ParticleFile(name=\"EddyParticles_Bwd\")) # the name of the output file"
1038
+
" runtime=timedelta(days=0), # the run time\n",
1039
+
" output_file=pset.ParticleFile(name=\"EddyParticles_Bwd\", outputdt=timedelta(hours=1))) # the file name and the time step of the outputs"
1042
1040
]
1043
1041
},
1044
1042
{
@@ -1165,8 +1163,7 @@
1165
1163
"pset.execute(AdvectionRK4 + k_WestVel, # simply add kernels using the + operator\n",
0 commit comments