Skip to content

Commit c6c2d7b

Browse files
Merge pull request #917 from OceanParcels/documentation
Documentation
2 parents ab36fd4 + 0c279ae commit c6c2d7b

9 files changed

Lines changed: 166 additions & 42 deletions

File tree

docs/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@
5959
# built documents.
6060
#
6161
# The short X.Y version.
62-
version = ''
62+
version = '2.2.1'
6363
# The full version, including alpha/beta/rc tags.
64-
release = ''
64+
release = '2.2.1'
6565

6666
# The language for content autogenerated by Sphinx. Refer to documentation
6767
# for a list of supported languages.

docs/index.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
Parcels documentation
88
===================================
99

10-
Welcome to the documentation of parcels. This page provides detailed documentation for each method, class and function.
10+
Welcome to the documentation of parcels. This page provides detailed documentation for each method, class and function.
11+
The documentation corresponds to the latest conda release, for newer documentation see the docstrings in the code.
1112

1213
See http://www.oceanparcels.org for general information on the Parcels project, including how to install and use.
1314

@@ -61,7 +62,8 @@ parcels.kernels.advection module
6162
:show-inheritance:
6263

6364
parcels.kernels.advectiondiffusion module
64-
--------------------------------
65+
-----------------------------------------
66+
6567

6668
.. automodule:: parcels.kernels.advectiondiffusion
6769
:members:

docs/make.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ REM Command file for Sphinx documentation
55
if "%SPHINXBUILD%" == "" (
66
set SPHINXBUILD=sphinx-build
77
)
8-
set BUILDDIR=_build
8+
set BUILDDIR=../../oceanparcels_website/gh-pages
99
set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% .
1010
set I18NSPHINXOPTS=%SPHINXOPTS% .
1111
if NOT "%PAPER%" == "" (

parcels/field.py

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,12 @@ class Field(object):
7373
This flag overrides the allow_time_interpolation and sets it to False
7474
:param chunkdims_name_map (opt.): gives a name map to the FieldFileBuffer that declared a mapping between chunksize name, NetCDF dimension and Parcels dimension;
7575
required only if currently incompatible OCM field is loaded and chunking is used by 'field_chunksize' (which is the default)
76+
77+
For usage examples see the following tutorials:
78+
79+
* `Nested Fields <https://nbviewer.jupyter.org/github/OceanParcels/parcels/blob/master/parcels/examples/tutorial_NestedFields.ipynb>`_
80+
81+
* `Summed Fields <https://nbviewer.jupyter.org/github/OceanParcels/parcels/blob/master/parcels/examples/tutorial_SummedFields.ipynb>`_
7682
"""
7783

7884
def __init__(self, name, data, lon=None, lat=None, depth=None, time=None, grid=None, mesh='flat', timestamps=None,
@@ -271,6 +277,10 @@ def from_netcdf(cls, filenames, variable, dimensions, indices=None, grid=None,
271277
:param gridindexingtype: The type of gridindexing. Either 'nemo' (default) or 'mitgcm' are supported.
272278
See also the Grid indexing documentation on oceanparcels.org
273279
:param field_chunksize: size of the chunks in dask loading
280+
281+
For usage examples see the following tutorial:
282+
283+
* `Timestamps <https://nbviewer.jupyter.org/github/OceanParcels/parcels/blob/master/parcels/examples/tutorial_timestamps.ipynb>`_
274284
"""
275285
# Ensure the timestamps array is compatible with the user-provided datafiles.
276286
if timestamps is not None:
@@ -520,6 +530,10 @@ def set_scaling_factor(self, factor):
520530
"""Scales the field data by some constant factor.
521531
522532
:param factor: scaling factor
533+
534+
For usage examples see the following tutorial:
535+
536+
* `Unit converters <https://nbviewer.jupyter.org/github/OceanParcels/parcels/blob/master/parcels/examples/tutorial_unitconverters.ipynb>`_
523537
"""
524538

525539
if self._scaling_factor:
@@ -529,6 +543,12 @@ def set_scaling_factor(self, factor):
529543
self.data *= factor
530544

531545
def set_depth_from_field(self, field):
546+
"""Define the depth dimensions from another (time-varying) field
547+
548+
See `this tutorial <https://nbviewer.jupyter.org/github/OceanParcels/parcels/blob/master/parcels/examples/tutorial_timevaryingdepthdimensions.ipynb>`_
549+
for a detailed explanation on how to set up time-evolving depth dimensions
550+
551+
"""
532552
self.grid.depth_field = field
533553

534554
def __getitem__(self, key):
@@ -1178,6 +1198,9 @@ def add_periodic_halo(self, zonal, meridional, halosize=5, data=None):
11781198
by copying a small portion of the field on one side of the domain to the other.
11791199
Before adding a periodic halo to the Field, it has to be added to the Grid on which the Field depends
11801200
1201+
See `this tutorial <https://nbviewer.jupyter.org/github/OceanParcels/parcels/blob/master/parcels/examples/tutorial_periodic_boundaries.ipynb>`_
1202+
for a detailed explanation on how to set up periodic boundaries
1203+
11811204
:param zonal: Create a halo in zonal direction (boolean)
11821205
:param meridional: Create a halo in meridional direction (boolean)
11831206
:param halosize: size of the halo (in grid points). Default is 5 grid points
@@ -1557,10 +1580,14 @@ def spatial_c_grid_interpolation3D_full(self, ti, z, y, x, time):
15571580

15581581
def spatial_c_grid_interpolation3D(self, ti, z, y, x, time):
15591582
"""
1560-
__ V1 __
1561-
| |
1562-
U0 U1
1563-
| __ V0 __ |
1583+
+---+---+---+
1584+
| |V1 | |
1585+
+---+---+---+
1586+
|U0 | |U1 |
1587+
+---+---+---+
1588+
| |V0 | |
1589+
+---+---+---+
1590+
15641591
The interpolation is done in the following by
15651592
interpolating linearly U depending on the longitude coordinate and
15661593
interpolating linearly V depending on the latitude coordinate.
@@ -1666,6 +1693,9 @@ class SummedField(list):
16661693
still be queried through their list index (e.g. SummedField[1]).
16671694
SummedField is composed of either Fields or VectorFields.
16681695
1696+
See `here <https://nbviewer.jupyter.org/github/OceanParcels/parcels/blob/master/parcels/examples/tutorial_SummedFields.ipynb>`_
1697+
for a detailed tutorial
1698+
16691699
:param name: Name of the SummedField
16701700
:param F: List of fields. F can be a scalar Field, a VectorField, or the zonal component (U) of the VectorField
16711701
:param V: List of fields defining the meridional component of a VectorField, if F is the zonal component. (default: None)
@@ -1721,6 +1751,9 @@ class NestedField(list):
17211751
NestedField returns an `ErrorOutOfBounds` only if last field is as well out of boundaries.
17221752
NestedField is composed of either Fields or VectorFields.
17231753
1754+
See `here <https://nbviewer.jupyter.org/github/OceanParcels/parcels/blob/master/parcels/examples/tutorial_NestedFields.ipynb>`_
1755+
for a detailed tutorial
1756+
17241757
:param name: Name of the NestedField
17251758
:param F: List of fields (order matters). F can be a scalar Field, a VectorField, or the zonal component (U) of the VectorField
17261759
:param V: List of fields defining the meridional component of a VectorField, if F is the zonal component. (default: None)

0 commit comments

Comments
 (0)