Repository: OceanParcels/Parcels (language: python)

Issue:
Changing Parcels -> parcels and importing all of parcels throughout
Most python packages are all-lowercase ([as suggested by pep8](https://peps.python.org/pep-0008/#package-and-module-names)), so we should also change the writing of `parcels` to lowercase throughout in the examples, documentation, docstrings and website. 

While we're at it, we could also change the notebooks in the examples to refer to the classes as `parcels.ClassName`, to better highlight that these are specific to `parcels`. So e.g. change
```python
from parcels import FieldSet

fset = FieldSet(...)
```
to
```python
import parcels

fset = parcels.FieldSet(...)
```
Removing `delta` alias for `timedelta`
The codebase uses `delta` as an alias for `datetime.timedelta` through the codebase and through the notebooks. This is a bit unique to `parcels`, and can lead to confusion to those famliar with Python wanting to use parcels for simulation.

It would be good to remove this in favour of using `timedelta`.

Support use of parcels.rng in Kernels
This PR fixes #1608. it supports using `parcels.rng` directly in Kernels (note, `parcels.ParcelsRandom` is also supported, but since the module itself it called `rng` better to use `parcels.rng` for traceability)
Kernel can't be converted to C depending on method of import
In pursuit of #1581, I encountered the following error message:

```
NotImplementedError: Cannot convert 'parcels' used in kernel to C-code
```

See the following minimal example. Doing the suggested change causes the error message:

```diff
import parcels
- from parcels import ParcelsRandom

example_dataset_folder = parcels.download_example_dataset("GlobCurrent_example_data")
filenames = {
    "U": f"{example_dataset_folder}/20*.nc",
    "V": f"{example_dataset_folder}/20*.nc",
}
variables = {
    "U": "eastward_eulerian_current_velocity",
    "V": "northward_eulerian_current_velocity",
}
dimensions = {"lat": "lat", "lon": "lon", "time": "time"}

fieldset = parcels.FieldSet.from_netcdf(filenames, variables, dimensions)

def nudge_kernel(particle, fieldset, time):
-   dlat = ParcelsRandom.normalvariate(0.0, 1.0)
+   dlat = parcels.ParcelsRandom.normalvariate(0.0, 1.0)
    particle_dlat += dlat

time = np.arange(0, 43200, 3600)
lon = [29] * len(time)
lat = [-33] * len(time)
pset = parcels.ParticleSet(fieldset=fieldset, pclass=parcels.JITParticle, lon=lon, lat=lat, time=time)


pset.execute(
    nudge_kernel,
    runtime=timedelta(days=7),
    dt=timedelta(minutes=5),
    output_file=output_file,
)
```


Likely culplit is code here:
https://github.com/OceanParcels/parcels/blob/035159a1b4002bc1550cebd275f93c0adaa8513d/parcels/compilation/codegenerator.py#L251-L265

Support use of parcels.rng in Kernels
This PR fixes #1608. it supports using `parcels.rng` directly in Kernels (note, `parcels.ParcelsRandom` is also supported, but since the module itself it called `rng` better to use `parcels.rng` for traceability)


Discussion / hints:
Before I go ahead on this, just confirming that I should only change the code to say `parcels.ClassName` and not the markdown cells? I think it would be clear from the code cells, and saying `parcels.FieldSet` every time would be a bit too verbose

Also, the lowercase nature of the package names (from my understanding) is only for the code itself. I think calling the package "Parcels" or "OceanParcels" in documentation is fine. Even numpy [uses NumPy for their project documentation](https://numpy.org/doc/2.0/user/whatisnumpy.html).
> Before I go ahead on this, just confirming that I should only change the code to say `parcels.ClassName` and not the markdown cells? I think it would be clear from the code cells, and saying `parcels.FieldSet` every time would be a bit too verbose

Yes indeed; only the code-cells. Like how it's done in the NumPy documentation (see screenshot below)
<img width="637" alt="Screenshot 2024-07-18 at 17 14 02" src="https://github.com/user-attachments/assets/bf256b10-92f9-44ad-a346-5d041b5c366a">


> Also, the lowercase nature of the package names (from my understanding) is only for the code itself. I think calling the package "Parcels" or "OceanParcels" in documentation is fine. Even numpy [uses NumPy for their project documentation](https://numpy.org/doc/2.0/user/whatisnumpy.html).

Ah, I didn't realise that! In that case, we can keep calling it Parcels in the non-codeblocks :-)






Fix patch:
diff --git a/.flake8 b/.flake8
index c770e35a7..e2e4bfc1b 100644
--- a/.flake8
+++ b/.flake8
@@ -10,3 +10,5 @@ ignore =
     E501,
     # ‘from module import *’ used; unable to detect undefined names
     F403,
+    # incompatability with Black
+    E203
diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs
index 2496866d6..56ae0cbf0 100644
--- a/.git-blame-ignore-revs
+++ b/.git-blame-ignore-revs
@@ -3,3 +3,6 @@
 
 # whitespace fixes
 e99e0d170a7dc128031b82ea00cdf9e9a0164b03
+
+# Run black on examples
+cbf96c4e1f58fa6348695d7553900ba3f7c3383b
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 1283515f6..5411ee6e1 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -13,10 +13,11 @@ repos:
     rev: "7.1.0"
     hooks:
       - id: flake8
-  - repo: https://github.com/pycqa/pydocstyle
-    rev: 6.3.0 # pick a git hash / tag to point to
+  - repo: https://github.com/psf/black-pre-commit-mirror
+    rev: 24.4.2
     hooks:
-      - id: pydocstyle
+      - id: black
+        files: docs/examples
   - repo: https://github.com/nbQA-dev/nbQA
     rev: 1.8.5
     hooks:
@@ -28,7 +29,7 @@ repos:
     hooks:
       - id: isort
         name: isort (python)
-  - repo: https://github.com/pre-commit/mirrors-prettier
-    rev: "v4.0.0-alpha.8"
+  - repo: https://github.com/biomejs/pre-commit
+    rev: v0.4.0
     hooks:
-      - id: prettier
+      - id: biome-format
diff --git a/.readthedocs.yaml b/.readthedocs.yaml
index 96f1e7f8a..e7e60beb1 100644
--- a/.readthedocs.yaml
+++ b/.readthedocs.yaml
@@ -9,6 +9,7 @@ build:
 
 sphinx:
   configuration: docs/conf.py
+  builder: dirhtml
 
 conda:
   environment: environment.yml
diff --git a/docs/conf.py b/docs/conf.py
index 3dbe88a3a..a35144d52 100755
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -317,7 +317,11 @@ def linkcode_resolve(domain, info):
 # html_use_smartypants = True
 
 # Custom sidebar templates, maps document names to template names.
-# html_sidebars = {}
+
+html_sidebars = {
+    "**": ["sidebar-nav-bs"],
+    "documentation/additional_examples": []
+}
 
 # Additional templates that should be rendered to pages, maps page names to
 # template names.
diff --git a/docs/contributing.rst b/docs/contributing.rst
index 904de0da6..1962a732b 100644
--- a/docs/contributing.rst
+++ b/docs/contributing.rst
@@ -41,7 +41,7 @@ Your first contribution
 There are many ways that you can contribute to Parcels. You can:
 
 - Participate in discussion about Parcels, either through the `issues <https://github.com/OceanParcels/parcels/issues>`_ or `discussions <https://github.com/OceanParcels/parcels/discussions>`_ tab
-- Suggest improvements to `tutorials <documentation.rst>`_
+- Suggest improvements to `tutorials <documentation/index.rst>`_
 - Suggest improvements to `documentation <index.rst>`_
 - Write code (fix bugs, implement features, codebase improvements, etc)
 
diff --git a/docs/documentation.rst b/docs/documentation.rst
deleted file mode 100644
index 210c84b15..000000000
--- a/docs/documentation.rst
+++ /dev/null
@@ -1,69 +0,0 @@
-Documentation and Tutorials
-===========================
-
-Parcels has several documentation and tutorial Jupyter notebooks which go through various aspects of Parcels. Static versions of these notebooks are available below in the site, with the interactive notebooks being available either completely online at the following `Binder link <https://mybinder.org/v2/gh/OceanParcels/parcels/master?labpath=docs%2Fexamples%2Fparcels_tutorial.ipynb>`_, or locally by downloading :download:`parcels_tutorials.zip </_downloads/parcels_tutorials.zip>` and running with your own Parcels installation.
-
-
-
-.. nbgallery::
-   :caption: Overview
-   :name: tutorial-overview
-
-   examples/tutorial_parcels_structure.ipynb
-   examples/parcels_tutorial.ipynb
-   examples/tutorial_output.ipynb
-
-
-.. nbgallery::
-   :caption: Setting up FieldSets
-   :name: tutorial-fieldsets
-
-   examples/documentation_indexing.ipynb
-   examples/tutorial_nemo_curvilinear.ipynb
-   examples/tutorial_nemo_3D.ipynb
-   examples/tutorial_NestedFields.ipynb
-   examples/tutorial_timevaryingdepthdimensions.ipynb
-   examples/tutorial_periodic_boundaries.ipynb
-   examples/tutorial_interpolation.ipynb
-   examples/tutorial_unitconverters.ipynb
-   examples/tutorial_timestamps.ipynb
-
-
-.. nbgallery::
-   :caption: Creating ParticleSets
-   :name: tutorial-particlesets
-
-   examples/tutorial_jit_vs_scipy.ipynb
-   examples/tutorial_delaystart.ipynb
-
-
-.. nbgallery::
-   :caption: Writing kernels to be executed on each particle
-   :name: tutorial-kernels
-
-   examples/tutorial_diffusion.ipynb
-   examples/tutorial_sampling.ipynb
-   examples/tutorial_particle_field_interaction.ipynb
-   examples/tutorial_interaction.ipynb
-   examples/tutorial_analyticaladvection.ipynb
-   examples/tutorial_kernelloop.ipynb
-
-
-.. nbgallery::
-   :caption: Other tutorials
-   :name: tutorial-other
-
-   examples/documentation_MPI.ipynb
-   examples/documentation_stuck_particles.ipynb
-   examples/documentation_unstuck_Agrid.ipynb
-   examples/documentation_LargeRunsOutput.ipynb
-   examples/documentation_geospatial.ipynb
-   examples/documentation_advanced_zarr.ipynb
-
-
-.. nbgallery::
-   :caption: Worked examples
-   :name: tutorial-examples
-
-   examples/tutorial_Argofloats.ipynb
-   examples/documentation_homepage_animation.ipynb
diff --git a/docs/documentation/additional_examples.rst b/docs/documentation/additional_examples.rst
new file mode 100644
index 000000000..54db65047
--- /dev/null
+++ b/docs/documentation/additional_examples.rst
@@ -0,0 +1,76 @@
+example_brownian.py
+-------------------
+
+.. literalinclude:: ../examples/example_brownian.py
+   :language: python
+   :linenos:
+
+example_dask_chunk_OCMs.py
+--------------------------
+
+.. literalinclude:: ../examples/example_dask_chunk_OCMs.py
+   :language: python
+   :linenos:
+
+example_decaying_moving_eddy.py
+-------------------------------
+
+.. literalinclude:: ../examples/example_decaying_moving_eddy.py
+   :language: python
+   :linenos:
+
+example_globcurrent.py
+----------------------
+
+.. literalinclude:: ../examples/example_globcurrent.py
+   :language: python
+   :linenos:
+
+example_mitgcm.py
+-----------------
+
+.. literalinclude:: ../examples/example_mitgcm.py
+   :language: python
+   :linenos:
+
+example_moving_eddies.py
+------------------------
+
+.. literalinclude:: ../examples/example_moving_eddies.py
+   :language: python
+   :linenos:
+
+example_nemo_curvilinear.py
+---------------------------
+
+.. literalinclude:: ../examples/example_nemo_curvilinear.py
+   :language: python
+   :linenos:
+
+example_ofam.py
+---------------
+
+.. literalinclude:: ../examples/example_ofam.py
+   :language: python
+   :linenos:
+
+example_peninsula.py
+--------------------
+
+.. literalinclude:: ../examples/example_peninsula.py
+   :language: python
+   :linenos:
+
+example_radial_rotation.py
+--------------------------
+
+.. literalinclude:: ../examples/example_radial_rotation.py
+   :language: python
+   :linenos:
+
+example_stommel.py
+------------------
+
+.. literalinclude:: ../examples/example_stommel.py
+   :language: python
+   :linenos:
diff --git a/docs/documentation/index.rst b/docs/documentation/index.rst
new file mode 100644
index 000000000..7356a9b68
--- /dev/null
+++ b/docs/documentation/index.rst
@@ -0,0 +1,76 @@
+Documentation and Tutorials
+===========================
+
+Parcels has several documentation and tutorial Jupyter notebooks and scripts which go through various aspects of Parcels. Static versions of the notebooks are available below via the gallery in the site, with the interactive notebooks being available either completely online at the following `Binder link <https://mybinder.org/v2/gh/OceanParcels/parcels/master?labpath=docs%2Fexamples%2Fparcels_tutorial.ipynb>`_. Following the gallery of notebooks is a list of scripts which provide additional examples to users. You can work with the example notebooks and scripts locally by downloading :download:`parcels_tutorials.zip </_downloads/parcels_tutorials.zip>` and running with your own Parcels installation.
+
+.. nbgallery::
+   :caption: Overview
+   :name: tutorial-overview
+
+   ../examples/tutorial_parcels_structure.ipynb
+   ../examples/parcels_tutorial.ipynb
+   ../examples/tutorial_output.ipynb
+
+
+.. nbgallery::
+   :caption: Setting up FieldSets
+   :name: tutorial-fieldsets
+
+   ../examples/documentation_indexing.ipynb
+   ../examples/tutorial_nemo_curvilinear.ipynb
+   ../examples/tutorial_nemo_3D.ipynb
+   ../examples/tutorial_NestedFields.ipynb
+   ../examples/tutorial_timevaryingdepthdimensions.ipynb
+   ../examples/tutorial_periodic_boundaries.ipynb
+   ../examples/tutorial_interpolation.ipynb
+   ../examples/tutorial_unitconverters.ipynb
+   ../examples/tutorial_timestamps.ipynb
+
+
+.. nbgallery::
+   :caption: Creating ParticleSets
+   :name: tutorial-particlesets
+
+   ../examples/tutorial_jit_vs_scipy.ipynb
+   ../examples/tutorial_delaystart.ipynb
+
+
+.. nbgallery::
+   :caption: Writing kernels to be executed on each particle
+   :name: tutorial-kernels
+
+   ../examples/tutorial_diffusion.ipynb
+   ../examples/tutorial_sampling.ipynb
+   ../examples/tutorial_particle_field_interaction.ipynb
+   ../examples/tutorial_interaction.ipynb
+   ../examples/tutorial_analyticaladvection.ipynb
+   ../examples/tutorial_kernelloop.ipynb
+
+
+.. nbgallery::
+   :caption: Other tutorials
+   :name: tutorial-other
+
+   ../examples/documentation_MPI.ipynb
+   ../examples/documentation_stuck_particles.ipynb
+   ../examples/documentation_unstuck_Agrid.ipynb
+   ../examples/documentation_LargeRunsOutput.ipynb
+   ../examples/documentation_geospatial.ipynb
+   ../examples/documentation_advanced_zarr.ipynb
+
+
+.. nbgallery::
+   :caption: Worked examples
+   :name: tutorial-examples
+
+   ../examples/tutorial_Argofloats.ipynb
+   ../examples/documentation_homepage_animation.ipynb
+
+
+Python Example Scripts
+----------------------
+
+
+.. toctree::
+
+   additional_examples
diff --git a/docs/examples/documentation_MPI.ipynb b/docs/examples/documentation_MPI.ipynb
index 01a5171b2..eab6293d8 100644
--- a/docs/examples/documentation_MPI.ipynb
+++ b/docs/examples/documentation_MPI.ipynb
@@ -216,14 +216,14 @@
     "%pylab inline\n",
     "import os\n",
     "import time\n",
-    "from datetime import timedelta as delta\n",
+    "from datetime import timedelta\n",
     "from glob import glob\n",
     "\n",
     "import matplotlib.pyplot as plt\n",
     "import numpy as np\n",
     "import psutil\n",
     "\n",
-    "from parcels import AdvectionRK4, FieldSet, JITParticle, ParticleSet\n",
+    "import parcels\n",
     "\n",
     "\n",
     "def set_cms_fieldset(cs):\n",
@@ -235,7 +235,7 @@
     "\n",
     "    if cs not in [\"auto\", False]:\n",
     "        cs = {\"time\": (\"time\", 1), \"lat\": (\"latitude\", cs), \"lon\": (\"longitude\", cs)}\n",
-    "    return FieldSet.from_netcdf(files, variables, dimensions, chunksize=cs)\n",
+    "    return parcels.FieldSet.from_netcdf(files, variables, dimensions, chunksize=cs)\n",
     "\n",
     "\n",
     "func_time = []\n",
@@ -243,12 +243,16 @@
     "chunksize = [128, 256, 512, 768, 1024, 1280, 1536, 1792, 2048, 2610, \"auto\", False]\n",
     "for cs in chunksize:\n",
     "    fieldset = set_cms_fieldset(cs)\n",
-    "    pset = ParticleSet(\n",
-    "        fieldset=fieldset, pclass=JITParticle, lon=[0], lat=[0], repeatdt=delta(hours=1)\n",
+    "    pset = parcels.ParticleSet(\n",
+    "        fieldset=fieldset,\n",
+    "        pclass=parcels.JITParticle,\n",
+    "        lon=[0],\n",
+    "        lat=[0],\n",
+    "        repeatdt=timedelta(hours=1),\n",
     "    )\n",
     "\n",
     "    tic = time.time()\n",
-    "    pset.execute(AdvectionRK4, dt=delta(hours=1))\n",
+    "    pset.execute(parcels.AdvectionRK4, dt=timedelta(hours=1))\n",
     "    func_time.append(time.time() - tic)\n",
     "    process = psutil.Process(os.getpid())\n",
     "    mem_B_used = process.memory_info().rss\n",
@@ -387,19 +391,23 @@
     "            \"lat\": (\"latitude\", cs),\n",
     "            \"lon\": (\"longitude\", cs),\n",
     "        }\n",
-    "    return FieldSet.from_netcdf(files, variables, dimensions, chunksize=cs)\n",
+    "    return parcels.FieldSet.from_netcdf(files, variables, dimensions, chunksize=cs)\n",
     "\n",
     "\n",
     "chunksize_3D = [128, 256, 512, 768, 1024, 1280, 1536, 1792, 2048, 2610, \"auto\", False]\n",
     "func_time3D = []\n",
     "for cs in chunksize_3D:\n",
     "    fieldset = set_cms_fieldset_3D(cs)\n",
-    "    pset = ParticleSet(\n",
-    "        fieldset=fieldset, pclass=JITParticle, lon=[0], lat=[0], repeatdt=delta(hours=1)\n",
+    "    pset = parcels.ParticleSet(\n",
+    "        fieldset=fieldset,\n",
+    "        pclass=parcels.JITParticle,\n",
+    "        lon=[0],\n",
+    "        lat=[0],\n",
+    "        repeatdt=timedelta(hours=1),\n",
     "    )\n",
     "\n",
     "    tic = time.time()\n",
-    "    pset.execute(AdvectionRK4_3D, dt=delta(hours=1))\n",
+    "    pset.execute(AdvectionRK4_3D, dt=timedelta(hours=1))\n",
     "    func_time3D.append(time.time() - tic)"
    ]
   },
diff --git a/docs/examples/documentation_advanced_zarr.ipynb b/docs/examples/documentation_advanced_zarr.ipynb
index adcc084b0..c79a6157a 100644
--- a/docs/examples/documentation_advanced_zarr.ipynb
+++ b/docs/examples/documentation_advanced_zarr.ipynb
@@ -598,7 +598,7 @@
     "import numpy as np\n",
     "import zarr\n",
     "\n",
-    "from parcels import AdvectionRK4, FieldSet, ParticleSet, ScipyParticle"
+    "import parcels"
    ]
   },
   {
@@ -617,7 +617,7 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "fieldset = FieldSet.from_xarray_dataset(\n",
+    "fieldset = parcels.FieldSet.from_xarray_dataset(\n",
     "    ds_flow_field,\n",
     "    variables={\"U\": \"U\", \"V\": \"V\"},\n",
     "    dimensions={\"lat\": \"lat\", \"lon\": \"lon\"},\n",
@@ -682,9 +682,9 @@
     "def create_random_pset(\n",
     "    fieldset=None, lon_range=(-15, 15), lat_range=(-15, 15), number_particles=200\n",
     "):\n",
-    "    return ParticleSet.from_list(\n",
+    "    return parcels.ParticleSet.from_list(\n",
     "        fieldset=fieldset,\n",
-    "        pclass=ScipyParticle,\n",
+    "        pclass=parcels.ScipyParticle,\n",
     "        lon=np.random.uniform(*lon_range, size=(number_particles,)),\n",
     "        lat=np.random.uniform(*lat_range, size=(number_particles,)),\n",
     "        time=np.zeros(shape=(number_particles,)),\n",
@@ -1477,7 +1477,7 @@
     "\n",
     "# run experiment\n",
     "pset.execute(\n",
-    "    AdvectionRK4,\n",
+    "    parcels.AdvectionRK4,\n",
     "    runtime=timedelta(days=17),\n",
     "    dt=timedelta(hours=3),\n",
     "    output_file=outputfile,\n",
diff --git a/docs/examples/documentation_geospatial.ipynb b/docs/examples/documentation_geospatial.ipynb
index e644c2617..fcf3491ff 100644
--- a/docs/examples/documentation_geospatial.ipynb
+++ b/docs/examples/documentation_geospatial.ipynb
@@ -36,7 +36,7 @@
     "- [geopandas](https://geopandas.org/) to create the geospatial datasets (`conda install -c conda-forge geopandas`)\n",
     "- [lxml](https://lxml.de/) to create KML files for Google Earth (`conda install lxml`)\n",
     "\n",
-    "This tutorial saves all generated data output in a folder `tutorial_geospatial_output` to avoid clogging the working directory."
+    "This tutorial saves all generated data output in a folder `tutorial_geospatial_output` to avoid clogging the working directory. If you're re-running this notebook, be sure to delete this folder so that the notebook doesn't encounter writing issues."
    ]
   },
   {
@@ -127,13 +127,7 @@
     "from lxml import etree\n",
     "from shapely.geometry import LineString, Point\n",
     "\n",
-    "from parcels import (\n",
-    "    AdvectionRK4,\n",
-    "    FieldSet,\n",
-    "    JITParticle,\n",
-    "    ParticleSet,\n",
-    "    download_example_dataset,\n",
-    ")\n",
+    "import parcels\n",
     "\n",
     "DATA_OUTPUT_FOLDER = Path(\"tutorial_geospatial_output\")\n",
     "DATA_OUTPUT_FOLDER.mkdir(exist_ok=True)\n",
@@ -156,7 +150,7 @@
    ],
    "source": [
     "# An example parcels simulation\n",
-    "data_folder = download_example_dataset(\"GlobCurrent_example_data\")\n",
+    "data_folder = parcels.download_example_dataset(\"GlobCurrent_example_data\")\n",
     "filenames = filename = str(data_folder / \"20*.nc\")\n",
     "variables = {\n",
     "    \"U\": \"eastward_eulerian_current_velocity\",\n",
@@ -168,11 +162,13 @@
     "    \"time\": \"time\",\n",
     "}\n",
     "\n",
-    "fieldset = FieldSet.from_netcdf(filenames, variables, dimensions)\n",
+    "fieldset = parcels.FieldSet.from_netcdf(filenames, variables, dimensions)\n",
     "\n",
     "# Mesh of particles\n",
     "lons, lats = np.meshgrid(range(15, 35, 2), range(-40, -30, 2))\n",
-    "pset = ParticleSet(fieldset=fieldset, pclass=JITParticle, lon=lons, lat=lats)\n",
+    "pset = parcels.ParticleSet(\n",
+    "    fieldset=fieldset, pclass=parcels.JITParticle, lon=lons, lat=lats\n",
+    ")\n",
     "dt = timedelta(hours=24)\n",
     "output_file = pset.ParticleFile(\n",
     "    name=DATA_OUTPUT_FOLDER / f\"{DATA_OUTPUT_NAME}.zarr\", outputdt=dt\n",
@@ -185,7 +181,7 @@
     "\n",
     "\n",
     "pset.execute(\n",
-    "    [AdvectionRK4, DeleteParticle],\n",
+    "    [parcels.AdvectionRK4, DeleteParticle],\n",
     "    runtime=timedelta(days=120),\n",
     "    dt=dt,\n",
     "    output_file=output_file,\n",
@@ -467,7 +463,10 @@
     "]\n",
     "for trajectory_idx, trajectory_gdf in gdf_parcels.groupby(\"trajectory\"):\n",
     "    trajectory_gdf = trajectory_gdf.sort_values(\"obs\")\n",
-    "    linestring = LineString(trajectory_gdf[\"geometry\"])\n",
+    "    points = trajectory_gdf[\"geometry\"]\n",
+    "    if points.shape[0] == 1:\n",
+    "        continue  # Can't create LineString with one point\n",
+    "    linestring = LineString()\n",
     "    linestrings.append((trajectory_idx, linestring))\n",
     "\n",
     "gdf_parcels_linestring = gpd.GeoDataFrame(\n",
diff --git a/docs/examples/documentation_indexing.ipynb b/docs/examples/documentation_indexing.ipynb
index c8cf0fcfc..28b54b3f7 100644
--- a/docs/examples/documentation_indexing.ipynb
+++ b/docs/examples/documentation_indexing.ipynb
@@ -54,13 +54,12 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "from datetime import timedelta as delta\n",
     "from glob import glob\n",
     "from os import path\n",
     "\n",
     "import numpy as np\n",
     "\n",
-    "from parcels import FieldSet, download_example_dataset"
+    "import parcels"
    ]
   },
   {
@@ -95,7 +94,9 @@
     }
    ],
    "source": [
-    "example_dataset_folder = download_example_dataset(\"NemoNorthSeaORCA025-N006_data\")\n",
+    "example_dataset_folder = parcels.download_example_dataset(\n",
+    "    \"NemoNorthSeaORCA025-N006_data\"\n",
+    ")\n",
     "ufiles = sorted(glob(f\"{example_dataset_folder}/ORCA*U.nc\"))\n",
     "vfiles = sorted(glob(f\"{example_dataset_folder}/ORCA*V.nc\"))\n",
     "wfiles = sorted(glob(f\"{example_dataset_folder}/ORCA*W.nc\"))\n",
@@ -123,7 +124,7 @@
     "    },\n",
     "}\n",
     "\n",
-    "fieldset = FieldSet.from_nemo(filenames, variables, dimensions)"
+    "fieldset = parcels.FieldSet.from_nemo(filenames, variables, dimensions)"
    ]
   },
   {
@@ -140,7 +141,7 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "fieldsetA = FieldSet.from_netcdf(filenames, variables, dimensions)"
+    "fieldsetA = parcels.FieldSet.from_netcdf(filenames, variables, dimensions)"
    ]
   },
   {
@@ -178,7 +179,7 @@
     "    \"W\": c_grid_dimensions,\n",
     "}\n",
     "\n",
-    "fieldsetC = FieldSet.from_nemo(\n",
+    "fieldsetC = parcels.FieldSet.from_nemo(\n",
     "    filenames, variables, dimensions, netcdf_decodewarning=False\n",
     ")"
    ]
diff --git a/docs/examples/documentation_stuck_particles.ipynb b/docs/examples/documentation_stuck_particles.ipynb
index 82f8354ed..ef6b298a6 100644
--- a/docs/examples/documentation_stuck_particles.ipynb
+++ b/docs/examples/documentation_stuck_particles.ipynb
@@ -63,7 +63,7 @@
    "source": [
     "import math\n",
     "from copy import copy\n",
-    "from datetime import timedelta as delta\n",
+    "from datetime import timedelta\n",
     "from glob import glob\n",
     "\n",
     "import cmocean\n",
@@ -76,14 +76,7 @@
     "from matplotlib.lines import Line2D\n",
     "from scipy import interpolate\n",
     "\n",
-    "from parcels import (\n",
-    "    AdvectionRK4,\n",
-    "    Field,\n",
-    "    FieldSet,\n",
-    "    JITParticle,\n",
-    "    ParticleSet,\n",
-    "    download_example_dataset,\n",
-    ")"
+    "import parcels"
    ]
   },
   {
@@ -480,7 +473,7 @@
     "dims = {\"lon\": \"longitude\", \"lat\": \"latitude\", \"depth\": \"depth\", \"time\": \"time\"}\n",
     "dimensions = {\"U\": dims, \"V\": dims}\n",
     "\n",
-    "fieldset = FieldSet.from_netcdf(filenames, variables, dimensions)\n",
+    "fieldset = parcels.FieldSet.from_netcdf(filenames, variables, dimensions)\n",
     "\n",
     "npart = 3  # number of particles to be released\n",
     "lon = np.linspace(7, 7.2, npart, dtype=np.float32)\n",
@@ -488,14 +481,19 @@
     "lons, lats = np.meshgrid(lon, lat)\n",
     "time = np.zeros(lons.size)\n",
     "\n",
-    "pset = ParticleSet(fieldset=fieldset, pclass=JITParticle, lon=lons, lat=lats, time=time)\n",
+    "pset = parcels.ParticleSet(\n",
+    "    fieldset=fieldset, pclass=parcels.JITParticle, lon=lons, lat=lats, time=time\n",
+    ")\n",
     "\n",
-    "kernels = pset.Kernel(AdvectionRK4)\n",
+    "kernels = pset.Kernel(parcels.AdvectionRK4)\n",
     "\n",
-    "output_file = pset.ParticleFile(name=\"SMOC.zarr\", outputdt=delta(hours=1))\n",
+    "output_file = pset.ParticleFile(name=\"SMOC.zarr\", outputdt=timedelta(hours=1))\n",
     "\n",
     "pset.execute(\n",
-    "    kernels, runtime=delta(hours=119), dt=delta(minutes=12), output_file=output_file\n",
+    "    kernels,\n",
+    "    runtime=timedelta(hours=119),\n",
+    "    dt=timedelta(minutes=12),\n",
+    "    output_file=output_file,\n",
     ")"
    ]
   },
@@ -706,7 +704,9 @@
    },
    "outputs": [],
    "source": [
-    "example_dataset_folder = download_example_dataset(\"NemoNorthSeaORCA025-N006_data\")\n",
+    "example_dataset_folder = parcels.download_example_dataset(\n",
+    "    \"NemoNorthSeaORCA025-N006_data\"\n",
+    ")\n",
     "cufields = xr.open_dataset(f\"{example_dataset_folder}/ORCA025-N06_20000104d05U.nc\")\n",
     "cvfields = xr.open_dataset(f\"{example_dataset_folder}/ORCA025-N06_20000104d05V.nc\")\n",
     "\n",
@@ -890,7 +890,9 @@
    },
    "outputs": [],
    "source": [
-    "example_dataset_folder = download_example_dataset(\"NemoNorthSeaORCA025-N006_data\")\n",
+    "example_dataset_folder = parcels.download_example_dataset(\n",
+    "    \"NemoNorthSeaORCA025-N006_data\"\n",
+    ")\n",
     "ufiles = sorted(glob(f\"{example_dataset_folder}/ORCA*U.nc\"))\n",
     "vfiles = sorted(glob(f\"{example_dataset_folder}/ORCA*V.nc\"))\n",
     "wfiles = sorted(glob(f\"{example_dataset_folder}/ORCA*W.nc\"))\n",
@@ -930,19 +932,24 @@
     "    \"W\": {\"lon\": \"glamf\", \"lat\": \"gphif\", \"depth\": \"depthw\", \"time\": \"time_counter\"},\n",
     "}\n",
     "\n",
-    "fieldset = FieldSet.from_nemo(filenames, variables, dimensions)\n",
+    "fieldset = parcels.FieldSet.from_nemo(filenames, variables, dimensions)\n",
     "\n",
     "npart = 10  # number of particles to be released\n",
     "lon = np.linspace(3, 4, npart, dtype=np.float32)\n",
     "lat = 51.5 * np.ones(npart)\n",
     "time = np.zeros(npart)\n",
     "\n",
-    "pset = ParticleSet(fieldset=fieldset, pclass=JITParticle, lon=lon, lat=lat, time=time)\n",
+    "pset = parcels.ParticleSet(\n",
+    "    fieldset=fieldset, pclass=parcels.JITParticle, lon=lon, lat=lat, time=time\n",
+    ")\n",
     "\n",
-    "output_file = pset.ParticleFile(name=\"Cgrid-stuck.zarr\", outputdt=delta(hours=1))\n",
+    "output_file = pset.ParticleFile(name=\"Cgrid-stuck.zarr\", outputdt=timedelta(hours=1))\n",
     "\n",
     "pset.execute(\n",
-    "    AdvectionRK4, runtime=delta(days=10), dt=delta(minutes=5), output_file=output_file\n",
+    "    parcels.AdvectionRK4,\n",
+    "    runtime=timedelta(days=10),\n",
+    "    dt=timedelta(minutes=5),\n",
+    "    output_file=output_file,\n",
     ")"
    ]
   },
@@ -1202,17 +1209,6 @@
     "This random walk can be added using a diffusion kernel, as documented in [this notebook](tutorial_diffusion.ipynb). Since the particles will move randomly through the domain, without awareness of the solid-fluid boundaries in the velocity field, we cannot define stuck particles as having moved less than a tolerance value and we will instead check whether particles find themselves on land or not. To do this, we sample a `landmask` field which denotes the f-nodes that are part of the solid.\n"
    ]
   },
-  {
-   "cell_type": "code",
-   "execution_count": 20,
-   "metadata": {
-    "hide_input": true
-   },
-   "outputs": [],
-   "source": [
-    "from parcels import DiffusionUniformKh, Kernel"
-   ]
-  },
   {
    "cell_type": "code",
    "execution_count": 21,
@@ -1221,7 +1217,7 @@
    },
    "outputs": [],
    "source": [
-    "LandParticle = JITParticle.add_variable(\"on_land\")\n",
+    "LandParticle = parcels.JITParticle.add_variable(\"on_land\")\n",
     "\n",
     "\n",
     "def Sample_land(particle, fieldset, time):\n",
@@ -1274,13 +1270,13 @@
     "    \"W\": {\"lon\": \"glamf\", \"lat\": \"gphif\", \"depth\": \"depthw\", \"time\": \"time_counter\"},\n",
     "}\n",
     "\n",
-    "fieldset = FieldSet.from_nemo(filenames, variables, dimensions)\n",
+    "fieldset = parcels.FieldSet.from_nemo(filenames, variables, dimensions)\n",
     "\n",
     "fieldset.add_constant_field(\"Kh_zonal\", 5, mesh=\"spherical\")\n",
     "fieldset.add_constant_field(\"Kh_meridional\", 5, mesh=\"spherical\")\n",
     "#  fieldset.add_constant('dres', 0.00005)\n",
     "fieldset.add_field(\n",
-    "    Field(\n",
+    "    parcels.Field(\n",
     "        \"landmask\",\n",
     "        data=landmask,\n",
     "        lon=coords[\"glamf\"],\n",
@@ -1294,15 +1290,19 @@
     "lat = 51.5 * np.ones(npart)\n",
     "time = np.zeros(npart)\n",
     "\n",
-    "pset = ParticleSet(fieldset=fieldset, pclass=LandParticle, lon=lon, lat=lat, time=time)\n",
+    "pset = parcels.ParticleSet(\n",
+    "    fieldset=fieldset, pclass=LandParticle, lon=lon, lat=lat, time=time\n",
+    ")\n",
     "\n",
-    "output_file = pset.ParticleFile(name=\"Cgrid-diffusion.zarr\", outputdt=delta(hours=1))\n",
+    "output_file = pset.ParticleFile(\n",
+    "    name=\"Cgrid-diffusion.zarr\", outputdt=timedelta(hours=1)\n",
+    ")\n",
     "pset.execute(\n",
-    "    pset.Kernel(AdvectionRK4)\n",
-    "    + pset.Kernel(DiffusionUniformKh)\n",
+    "    pset.Kernel(parcels.AdvectionRK4)\n",
+    "    + pset.Kernel(parcels.DiffusionUniformKh)\n",
     "    + pset.Kernel(Sample_land),\n",
-    "    runtime=delta(days=10),\n",
-    "    dt=delta(minutes=5),\n",
+    "    runtime=timedelta(days=10),\n",
+    "    dt=timedelta(minutes=5),\n",
     "    output_file=output_file,\n",
     ")"
    ]
diff --git a/docs/examples/documentation_unstuck_Agrid.ipynb b/docs/examples/documentation_unstuck_Agrid.ipynb
index 5cb51cf39..4599fcdae 100644
--- a/docs/examples/documentation_unstuck_Agrid.ipynb
+++ b/docs/examples/documentation_unstuck_Agrid.ipynb
@@ -43,7 +43,7 @@
    "outputs": [],
    "source": [
     "from copy import copy\n",
-    "from datetime import timedelta as delta\n",
+    "from datetime import timedelta\n",
     "\n",
     "import cmocean\n",
     "import matplotlib.gridspec as gridspec\n",
@@ -56,17 +56,7 @@
     "from netCDF4 import Dataset\n",
     "from scipy import interpolate\n",
     "\n",
-    "from parcels import (\n",
-    "    AdvectionRK4,\n",
-    "    Field,\n",
-    "    FieldSet,\n",
-    "    Geographic,\n",
-    "    GeographicPolar,\n",
-    "    JITParticle,\n",
-    "    ParticleSet,\n",
-    "    ScipyParticle,\n",
-    "    Variable,\n",
-    ")"
+    "import parcels"
    ]
   },
   {
@@ -809,11 +799,11 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "DisplacementParticle = JITParticle.add_variables(\n",
+    "DisplacementParticle = parcels.JITParticle.add_variables(\n",
     "    [\n",
-    "        Variable(\"dU\"),\n",
-    "        Variable(\"dV\"),\n",
-    "        Variable(\"d2s\", initial=1e3),\n",
+    "        parcels.Variable(\"dU\"),\n",
+    "        parcels.Variable(\"dV\"),\n",
+    "        parcels.Variable(\"d2s\", initial=1e3),\n",
     "    ]\n",
     ")\n",
     "\n",
@@ -867,7 +857,9 @@
     "    \"lat\": range(latmin, latmax),\n",
     "}  # to load only a small part of the domain\n",
     "\n",
-    "fieldset = FieldSet.from_netcdf(filenames, variables, dimensions, indices=indices)"
+    "fieldset = parcels.FieldSet.from_netcdf(\n",
+    "    filenames, variables, dimensions, indices=indices\n",
+    ")"
    ]
   },
   {
@@ -890,8 +882,8 @@
     "lons, lats = np.meshgrid(lon, lat)\n",
     "time = np.zeros(lons.size)\n",
     "\n",
-    "runtime = delta(hours=100)\n",
-    "dt = delta(minutes=10)"
+    "runtime = timedelta(hours=100)\n",
+    "dt = timedelta(minutes=10)"
    ]
   },
   {
@@ -909,11 +901,13 @@
     }
    ],
    "source": [
-    "pset = ParticleSet(fieldset=fieldset, pclass=JITParticle, lon=lons, lat=lats, time=time)\n",
+    "pset = parcels.ParticleSet(\n",
+    "    fieldset=fieldset, pclass=parcels.JITParticle, lon=lons, lat=lats, time=time\n",
+    ")\n",
     "\n",
-    "kernels = AdvectionRK4\n",
+    "kernels = parcels.AdvectionRK4\n",
     "\n",
-    "output_file = pset.ParticleFile(name=\"SMOC.zarr\", outputdt=delta(hours=1))\n",
+    "output_file = pset.ParticleFile(name=\"SMOC.zarr\", outputdt=timedelta(hours=1))\n",
     "\n",
     "pset.execute(kernels, runtime=runtime, dt=dt, output_file=output_file)"
    ]
@@ -932,11 +926,13 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "fieldset = FieldSet.from_netcdf(filenames, variables, dimensions, indices=indices)\n",
+    "fieldset = parcels.FieldSet.from_netcdf(\n",
+    "    filenames, variables, dimensions, indices=indices\n",
+    ")\n",
     "u_displacement = v_x\n",
     "v_displacement = v_y\n",
     "fieldset.add_field(\n",
-    "    Field(\n",
+    "    parcels.Field(\n",
     "        \"dispU\",\n",
     "        data=u_displacement[latmin:latmax, lonmin:lonmax],\n",
     "        lon=fieldset.U.grid.lon,\n",
@@ -945,7 +941,7 @@
     "    )\n",
     ")\n",
     "fieldset.add_field(\n",
-    "    Field(\n",
+    "    parcels.Field(\n",
     "        \"dispV\",\n",
     "        data=v_displacement[latmin:latmax, lonmin:lonmax],\n",
     "        lon=fieldset.U.grid.lon,\n",
@@ -953,8 +949,8 @@
     "        mesh=\"spherical\",\n",
     "    )\n",
     ")\n",
-    "fieldset.dispU.units = GeographicPolar()\n",
-    "fieldset.dispV.units = Geographic()"
+    "fieldset.dispU.units = parcels.GeographicPolar()\n",
+    "fieldset.dispV.units = parcels.Geographic()"
    ]
   },
   {
@@ -964,7 +960,7 @@
    "outputs": [],
    "source": [
     "fieldset.add_field(\n",
-    "    Field(\n",
+    "    parcels.Field(\n",
     "        \"landmask\",\n",
     "        landmask[latmin:latmax, lonmin:lonmax],\n",
     "        lon=fieldset.U.grid.lon,\n",
@@ -973,7 +969,7 @@
     "    )\n",
     ")\n",
     "fieldset.add_field(\n",
-    "    Field(\n",
+    "    parcels.Field(\n",
     "        \"distance2shore\",\n",
     "        d_2_s[latmin:latmax, lonmin:lonmax],\n",
     "        lon=fieldset.U.grid.lon,\n",
@@ -998,13 +994,13 @@
     }
    ],
    "source": [
-    "pset = ParticleSet(\n",
+    "pset = parcels.ParticleSet(\n",
     "    fieldset=fieldset, pclass=DisplacementParticle, lon=lons, lat=lats, time=time\n",
     ")\n",
     "\n",
-    "kernels = [displace, AdvectionRK4, set_displacement]\n",
+    "kernels = [displace, parcels.AdvectionRK4, set_displacement]\n",
     "\n",
-    "output_file = pset.ParticleFile(name=\"SMOC-disp.zarr\", outputdt=delta(hours=1))\n",
+    "output_file = pset.ParticleFile(name=\"SMOC-disp.zarr\", outputdt=timedelta(hours=1))\n",
     "\n",
     "pset.execute(kernels, runtime=runtime, dt=dt, output_file=output_file)"
    ]
@@ -1500,7 +1496,7 @@
     }
    ],
    "source": [
-    "fieldset = FieldSet.from_netcdf(\n",
+    "fieldset = parcels.FieldSet.from_netcdf(\n",
     "    filenames,\n",
     "    variables,\n",
     "    dimensions,\n",
@@ -1511,11 +1507,15 @@
     "    },  # Setting the interpolation for U and V\n",
     ")\n",
     "\n",
-    "pset = ParticleSet(fieldset=fieldset, pclass=JITParticle, lon=lons, lat=lats, time=time)\n",
+    "pset = parcels.ParticleSet(\n",
+    "    fieldset=fieldset, pclass=parcels.JITParticle, lon=lons, lat=lats, time=time\n",
+    ")\n",
     "\n",
-    "kernels = pset.Kernel(AdvectionRK4)\n",
+    "kernels = pset.Kernel(parcels.AdvectionRK4)\n",
     "\n",
-    "output_file = pset.ParticleFile(name=\"SMOC_partialslip.zarr\", outputdt=delta(hours=1))\n",
+    "output_file = pset.ParticleFile(\n",
+    "    name=\"SMOC_partialslip.zarr\", outputdt=timedelta(hours=1)\n",
+    ")\n",
     "\n",
     "pset.execute(kernels, runtime=runtime, dt=dt, output_file=output_file)"
    ]
@@ -1543,7 +1543,7 @@
     }
    ],
    "source": [
-    "fieldset = FieldSet.from_netcdf(\n",
+    "fieldset = parcels.FieldSet.from_netcdf(\n",
     "    filenames,\n",
     "    variables,\n",
     "    dimensions,\n",
@@ -1553,11 +1553,13 @@
     "        \"V\": \"freeslip\",\n",
     "    },  # Setting the interpolation for U and V\n",
     ")\n",
-    "pset = ParticleSet(fieldset=fieldset, pclass=JITParticle, lon=lons, lat=lats, time=time)\n",
+    "pset = parcels.ParticleSet(\n",
+    "    fieldset=fieldset, pclass=parcels.JITParticle, lon=lons, lat=lats, time=time\n",
+    ")\n",
     "\n",
-    "kernels = pset.Kernel(AdvectionRK4)\n",
+    "kernels = pset.Kernel(parcels.AdvectionRK4)\n",
     "\n",
-    "output_file = pset.ParticleFile(name=\"SMOC_freeslip.zarr\", outputdt=delta(hours=1))\n",
+    "output_file = pset.ParticleFile(name=\"SMOC_freeslip.zarr\", outputdt=timedelta(hours=1))\n",
     "\n",
     "pset.execute(kernels, runtime=runtime, dt=dt, output_file=output_file)"
    ]
diff --git a/docs/examples/example_brownian.py b/docs/examples/example_brownian.py
index 7f996c059..370bd843f 100644
--- a/docs/examples/example_brownian.py
+++ b/docs/examples/example_brownian.py
@@ -1,54 +1,54 @@
-from datetime import timedelta as delta
+from datetime import timedelta
 
 import numpy as np
 import pytest
 
-from parcels import (
-    DiffusionUniformKh,
-    Field,
-    FieldSet,
-    JITParticle,
-    ParcelsRandom,
-    ParticleSet,
-    ScipyParticle,
-)
+import parcels
 
-ptype = {'scipy': ScipyParticle, 'jit': JITParticle}
+ptype = {"scipy": parcels.ScipyParticle, "jit": parcels.JITParticle}
 
 
 def mesh_conversion(mesh):
-    return (1852. * 60) if mesh == 'spherical' else 1.
+    return (1852.0 * 60) if mesh == "spherical" else 1.0
 
 
-@pytest.mark.parametrize('mode', ['scipy', 'jit'])
-@pytest.mark.parametrize('mesh', ['flat', 'spherical'])
+@pytest.mark.parametrize("mode", ["scipy", "jit"])
+@pytest.mark.parametrize("mesh", ["flat", "spherical"])
 def test_brownian_example(mode, mesh, npart=3000):
-    fieldset = FieldSet.from_data({'U': 0, 'V': 0}, {'lon': 0, 'lat': 0}, mesh=mesh)
+    fieldset = parcels.FieldSet.from_data(
+        {"U": 0, "V": 0}, {"lon": 0, "lat": 0}, mesh=mesh
+    )
 
     # Set diffusion constants.
     kh_zonal = 100  # in m^2/s
     kh_meridional = 100  # in m^2/s
 
     # Create field of constant Kh_zonal and Kh_meridional
-    fieldset.add_field(Field('Kh_zonal', kh_zonal, lon=0, lat=0, mesh=mesh))
-    fieldset.add_field(Field('Kh_meridional', kh_meridional, lon=0, lat=0, mesh=mesh))
+    fieldset.add_field(parcels.Field("Kh_zonal", kh_zonal, lon=0, lat=0, mesh=mesh))
+    fieldset.add_field(
+        parcels.Field("Kh_meridional", kh_meridional, lon=0, lat=0, mesh=mesh)
+    )
 
     # Set random seed
-    ParcelsRandom.seed(123456)
+    parcels.ParcelsRandom.seed(123456)
 
-    runtime = delta(days=1)
+    runtime = timedelta(days=1)
 
-    ParcelsRandom.seed(1234)
-    pset = ParticleSet(fieldset=fieldset, pclass=ptype[mode],
-                       lon=np.zeros(npart), lat=np.zeros(npart))
-    pset.execute(pset.Kernel(DiffusionUniformKh),
-                 runtime=runtime, dt=delta(hours=1))
+    parcels.ParcelsRandom.seed(1234)
+    pset = parcels.ParticleSet(
+        fieldset=fieldset, pclass=ptype[mode], lon=np.zeros(npart), lat=np.zeros(npart)
+    )
+    pset.execute(
+        pset.Kernel(parcels.DiffusionUniformKh), runtime=runtime, dt=timedelta(hours=1)
+    )
 
-    expected_std_x = np.sqrt(2*kh_zonal*runtime.total_seconds())
-    expected_std_y = np.sqrt(2*kh_meridional*runtime.total_seconds())
+    expected_std_x = np.sqrt(2 * kh_zonal * runtime.total_seconds())
+    expected_std_y = np.sqrt(2 * kh_meridional * runtime.total_seconds())
 
     ys = pset.lat * mesh_conversion(mesh)
-    xs = pset.lon * mesh_conversion(mesh)  # since near equator, we do not need to care about curvature effect
+    xs = pset.lon * mesh_conversion(
+        mesh
+    )  # since near equator, we do not need to care about curvature effect
 
     tol = 250  # 250m tolerance
     assert np.allclose(np.std(xs), expected_std_x, atol=tol)
@@ -58,4 +58,4 @@ def test_brownian_example(mode, mesh, npart=3000):
 
 
 if __name__ == "__main__":
-    test_brownian_example('jit', 'spherical', npart=2000)
+    test_brownian_example("jit", "spherical", npart=2000)
diff --git a/docs/examples/example_dask_chunk_OCMs.py b/docs/examples/example_dask_chunk_OCMs.py
index def7bdd53..99c65d957 100644
--- a/docs/examples/example_dask_chunk_OCMs.py
+++ b/docs/examples/example_dask_chunk_OCMs.py
@@ -1,30 +1,21 @@
 import math
-from datetime import timedelta as delta
+from datetime import timedelta
 from glob import glob
 
 import dask
 import numpy as np
 import pytest
 
-from parcels import (
-    AdvectionRK4,
-    Field,
-    FieldSet,
-    JITParticle,
-    ParticleSet,
-    ScipyParticle,
-    Variable,
-    download_example_dataset,
-)
+import parcels
 from parcels.tools.statuscodes import DaskChunkingError
 
-ptype = {'scipy': ScipyParticle, 'jit': JITParticle}
+ptype = {"scipy": parcels.ScipyParticle, "jit": parcels.JITParticle}
 
 
 def compute_nemo_particle_advection(fieldset, mode):
     npart = 20
     lonp = 2.5 * np.ones(npart)
-    latp = [i for i in 52.0+(-1e-3+np.random.rand(npart)*2.0*1e-3)]
+    latp = [i for i in 52.0 + (-1e-3 + np.random.rand(npart) * 2.0 * 1e-3)]
 
     def periodicBC(particle, fieldSet, time):
         if particle.lon > 15.0:
@@ -36,206 +27,331 @@ def periodicBC(particle, fieldSet, time):
         if particle.lat < 49.0:
             particle_dlat += 11.0  # noqa
 
-    pset = ParticleSet.from_list(fieldset, ptype[mode], lon=lonp, lat=latp)
-    kernels = pset.Kernel(AdvectionRK4) + periodicBC
-    pset.execute(kernels, runtime=delta(days=4), dt=delta(hours=6))
+    pset = parcels.ParticleSet.from_list(fieldset, ptype[mode], lon=lonp, lat=latp)
+    kernels = pset.Kernel(parcels.AdvectionRK4) + periodicBC
+    pset.execute(kernels, runtime=timedelta(days=4), dt=timedelta(hours=6))
     return pset
 
 
-@pytest.mark.parametrize('mode', ['jit'])
-@pytest.mark.parametrize('chunk_mode', [False, 'auto', 'specific', 'failsafe'])
+@pytest.mark.parametrize("mode", ["jit"])
+@pytest.mark.parametrize("chunk_mode", [False, "auto", "specific", "failsafe"])
 def test_nemo_3D(mode, chunk_mode):
-    if chunk_mode in ['auto', ]:
-        dask.config.set({'array.chunk-size': '256KiB'})
+    if chunk_mode in [
+        "auto",
+    ]:
+        dask.config.set({"array.chunk-size": "256KiB"})
     else:
-        dask.config.set({'array.chunk-size': '128MiB'})
-    data_folder = download_example_dataset('NemoNorthSeaORCA025-N006_data')
-    ufiles = sorted(glob(f'{data_folder}/ORCA*U.nc'))
-    vfiles = sorted(glob(f'{data_folder}/ORCA*V.nc'))
-    wfiles = sorted(glob(f'{data_folder}/ORCA*W.nc'))
-    mesh_mask = f'{data_folder}/coordinates.nc'
-
-    filenames = {'U': {'lon': mesh_mask, 'lat': mesh_mask, 'depth': wfiles[0], 'data': ufiles},
-                 'V': {'lon': mesh_mask, 'lat': mesh_mask, 'depth': wfiles[0], 'data': vfiles},
-                 'W': {'lon': mesh_mask, 'lat': mesh_mask, 'depth': wfiles[0], 'data': wfiles}}
-    variables = {'U': 'uo',
-                 'V': 'vo',
-                 'W': 'wo'}
-    dimensions = {'U': {'lon': 'glamf', 'lat': 'gphif', 'depth': 'depthw', 'time': 'time_counter'},
-                  'V': {'lon': 'glamf', 'lat': 'gphif', 'depth': 'depthw', 'time': 'time_counter'},
-                  'W': {'lon': 'glamf', 'lat': 'gphif', 'depth': 'depthw', 'time': 'time_counter'}}
+        dask.config.set({"array.chunk-size": "128MiB"})
+    data_folder = parcels.download_example_dataset("NemoNorthSeaORCA025-N006_data")
+    ufiles = sorted(glob(f"{data_folder}/ORCA*U.nc"))
+    vfiles = sorted(glob(f"{data_folder}/ORCA*V.nc"))
+    wfiles = sorted(glob(f"{data_folder}/ORCA*W.nc"))
+    mesh_mask = f"{data_folder}/coordinates.nc"
+
+    filenames = {
+        "U": {"lon": mesh_mask, "lat": mesh_mask, "depth": wfiles[0], "data": ufiles},
+        "V": {"lon": mesh_mask, "lat": mesh_mask, "depth": wfiles[0], "data": vfiles},
+        "W": {"lon": mesh_mask, "lat": mesh_mask, "depth": wfiles[0], "data": wfiles},
+    }
+    variables = {"U": "uo", "V": "vo", "W": "wo"}
+    dimensions = {
+        "U": {
+            "lon": "glamf",
+            "lat": "gphif",
+            "depth": "depthw",
+            "time": "time_counter",
+        },
+        "V": {
+            "lon": "glamf",
+            "lat": "gphif",
+            "depth": "depthw",
+            "time": "time_counter",
+        },
+        "W": {
+            "lon": "glamf",
+            "lat": "gphif",
+            "depth": "depthw",
+            "time": "time_counter",
+        },
+    }
     chs = False
-    if chunk_mode == 'auto':
-        chs = 'auto'
-    elif chunk_mode == 'specific':
-        chs = {'U': {'depth': ('depthu', 75), 'lat': ('y', 16), 'lon': ('x', 16)},
-               'V': {'depth': ('depthv', 75), 'lat': ('y', 16), 'lon': ('x', 16)},
-               'W': {'depth': ('depthw', 75), 'lat': ('y', 16), 'lon': ('x', 16)}}
-    elif chunk_mode == 'failsafe':  # chunking time and but not depth
-        filenames = {'U': {'lon': mesh_mask, 'lat': mesh_mask, 'depth': wfiles[0], 'data': ufiles},
-                     'V': {'lon': mesh_mask, 'lat': mesh_mask, 'depth': wfiles[0], 'data': vfiles}}
-        variables = {'U': 'uo',
-                     'V': 'vo'}
-        dimensions = {'U': {'lon': 'glamf', 'lat': 'gphif', 'depth': 'depthw', 'time': 'time_counter'},
-                      'V': {'lon': 'glamf', 'lat': 'gphif', 'depth': 'depthw', 'time': 'time_counter'}}
-        chs = {'U': {'time': ('time_counter', 1), 'depth': ('depthu', 25), 'lat': ('y', -1), 'lon': ('x', -1)},
-               'V': {'time': ('time_counter', 1), 'depth': ('depthv', 75), 'lat': ('y', -1), 'lon': ('x', -1)}}
-
-    fieldset = FieldSet.from_nemo(filenames, variables, dimensions, chunksize=chs)
+    if chunk_mode == "auto":
+        chs = "auto"
+    elif chunk_mode == "specific":
+        chs = {
+            "U": {"depth": ("depthu", 75), "lat": ("y", 16), "lon": ("x", 16)},
+            "V": {"depth": ("depthv", 75), "lat": ("y", 16), "lon": ("x", 16)},
+            "W": {"depth": ("depthw", 75), "lat": ("y", 16), "lon": ("x", 16)},
+        }
+    elif chunk_mode == "failsafe":  # chunking time and but not depth
+        filenames = {
+            "U": {
+                "lon": mesh_mask,
+                "lat": mesh_mask,
+                "depth": wfiles[0],
+                "data": ufiles,
+            },
+            "V": {
+                "lon": mesh_mask,
+                "lat": mesh_mask,
+                "depth": wfiles[0],
+                "data": vfiles,
+            },
+        }
+        variables = {"U": "uo", "V": "vo"}
+        dimensions = {
+            "U": {
+                "lon": "glamf",
+                "lat": "gphif",
+                "depth": "depthw",
+                "time": "time_counter",
+            },
+            "V": {
+                "lon": "glamf",
+                "lat": "gphif",
+                "depth": "depthw",
+                "time": "time_counter",
+            },
+        }
+        chs = {
+            "U": {
+                "time": ("time_counter", 1),
+                "depth": ("depthu", 25),
+                "lat": ("y", -1),
+                "lon": ("x", -1),
+            },
+            "V": {
+                "time": ("time_counter", 1),
+                "depth": ("depthv", 75),
+                "lat": ("y", -1),
+                "lon": ("x", -1),
+            },
+        }
+
+    fieldset = parcels.FieldSet.from_nemo(
+        filenames, variables, dimensions, chunksize=chs
+    )
 
     compute_nemo_particle_advection(fieldset, mode)
     # Nemo sample file dimensions: depthu=75, y=201, x=151
-    if chunk_mode != 'failsafe':
-        assert (len(fieldset.U.grid.load_chunk) == len(fieldset.V.grid.load_chunk))
-        assert (len(fieldset.U.grid.load_chunk) == len(fieldset.W.grid.load_chunk))
+    if chunk_mode != "failsafe":
+        assert len(fieldset.U.grid.load_chunk) == len(fieldset.V.grid.load_chunk)
+        assert len(fieldset.U.grid.load_chunk) == len(fieldset.W.grid.load_chunk)
     if chunk_mode is False:
-        assert (len(fieldset.U.grid.load_chunk) == 1)
-    elif chunk_mode == 'auto':
-        assert fieldset.gridset.size == 3  # because three different grids in 'auto' mode
-        assert (len(fieldset.U.grid.load_chunk) != 1)
-    elif chunk_mode == 'specific':
-        assert (len(fieldset.U.grid.load_chunk) == (1 * int(math.ceil(75.0/75.0)) * int(math.ceil(201.0/16.0)) * int(math.ceil(151.0/16.0))))
-    elif chunk_mode == 'failsafe':  # chunking time and depth but not lat and lon
-        assert (len(fieldset.U.grid.load_chunk) != 1)
-        assert (len(fieldset.U.grid.load_chunk) == (1 * int(math.ceil(75.0/25.0)) * int(math.ceil(201.0/171.0)) * int(math.ceil(151.0/151.0))))
-        assert (len(fieldset.V.grid.load_chunk) != 1)
-        assert (len(fieldset.V.grid.load_chunk) == (1 * int(math.ceil(75.0/75.0)) * int(math.ceil(201.0/171.0)) * int(math.ceil(151.0/151.0))))
-
-
-@pytest.mark.parametrize('mode', ['jit'])
-@pytest.mark.parametrize('chunk_mode', [False, 'auto', 'specific', 'failsafe'])
+        assert len(fieldset.U.grid.load_chunk) == 1
+    elif chunk_mode == "auto":
+        assert (
+            fieldset.gridset.size == 3
+        )  # because three different grids in 'auto' mode
+        assert len(fieldset.U.grid.load_chunk) != 1
+    elif chunk_mode == "specific":
+        assert len(fieldset.U.grid.load_chunk) == (
+            1
+            * int(math.ceil(75.0 / 75.0))
+            * int(math.ceil(201.0 / 16.0))
+            * int(math.ceil(151.0 / 16.0))
+        )
+    elif chunk_mode == "failsafe":  # chunking time and depth but not lat and lon
+        assert len(fieldset.U.grid.load_chunk) != 1
+        assert len(fieldset.U.grid.load_chunk) == (
+            1
+            * int(math.ceil(75.0 / 25.0))
+            * int(math.ceil(201.0 / 171.0))
+            * int(math.ceil(151.0 / 151.0))
+        )
+        assert len(fieldset.V.grid.load_chunk) != 1
+        assert len(fieldset.V.grid.load_chunk) == (
+            1
+            * int(math.ceil(75.0 / 75.0))
+            * int(math.ceil(201.0 / 171.0))
+            * int(math.ceil(151.0 / 151.0))
+        )
+
+
+@pytest.mark.parametrize("mode", ["jit"])
+@pytest.mark.parametrize("chunk_mode", [False, "auto", "specific", "failsafe"])
 def test_globcurrent_2D(mode, chunk_mode):
-    if chunk_mode in ['auto', ]:
-        dask.config.set({'array.chunk-size': '16KiB'})
+    if chunk_mode in [
+        "auto",
+    ]:
+        dask.config.set({"array.chunk-size": "16KiB"})
     else:
-        dask.config.set({'array.chunk-size': '128MiB'})
-    data_folder = download_example_dataset("GlobCurrent_example_data")
-    filenames = str(data_folder / '200201*-GLOBCURRENT-L4-CUReul_hs-ALT_SUM-v02.0-fv01.0.nc')
-    variables = {'U': 'eastward_eulerian_current_velocity', 'V': 'northward_eulerian_current_velocity'}
-    dimensions = {'lat': 'lat', 'lon': 'lon', 'time': 'time'}
+        dask.config.set({"array.chunk-size": "128MiB"})
+    data_folder = parcels.download_example_dataset("GlobCurrent_example_data")
+    filenames = str(
+        data_folder / "200201*-GLOBCURRENT-L4-CUReul_hs-ALT_SUM-v02.0-fv01.0.nc"
+    )
+    variables = {
+        "U": "eastward_eulerian_current_velocity",
+        "V": "northward_eulerian_current_velocity",
+    }
+    dimensions = {"lat": "lat", "lon": "lon", "time": "time"}
     chs = False
-    if chunk_mode == 'auto':
-        chs = 'auto'
-    elif chunk_mode == 'specific':
-        chs = {'U': {'lat': ('lat', 8), 'lon': ('lon', 8)},
-               'V': {'lat': ('lat', 8), 'lon': ('lon', 8)}}
-    elif chunk_mode == 'failsafe':  # chunking time but not lat
-        chs = {'U': {'time': ('time', 1), 'lat': ('lat', 10), 'lon': ('lon', -1)},
-               'V': {'time': ('time', 1), 'lat': ('lat', -1), 'lon': ('lon', -1)}}
-
-    fieldset = FieldSet.from_netcdf(filenames, variables, dimensions, chunksize=chs)
+    if chunk_mode == "auto":
+        chs = "auto"
+    elif chunk_mode == "specific":
+        chs = {
+            "U": {"lat": ("lat", 8), "lon": ("lon", 8)},
+            "V": {"lat": ("lat", 8), "lon": ("lon", 8)},
+        }
+    elif chunk_mode == "failsafe":  # chunking time but not lat
+        chs = {
+            "U": {"time": ("time", 1), "lat": ("lat", 10), "lon": ("lon", -1)},
+            "V": {"time": ("time", 1), "lat": ("lat", -1), "lon": ("lon", -1)},
+        }
+
+    fieldset = parcels.FieldSet.from_netcdf(
+        filenames, variables, dimensions, chunksize=chs
+    )
     try:
-        pset = ParticleSet(fieldset, pclass=ptype[mode], lon=25, lat=-35)
-        pset.execute(AdvectionRK4, runtime=delta(days=1), dt=delta(minutes=5))
+        pset = parcels.ParticleSet(fieldset, pclass=ptype[mode], lon=25, lat=-35)
+        pset.execute(
+            parcels.AdvectionRK4, runtime=timedelta(days=1), dt=timedelta(minutes=5)
+        )
     except DaskChunkingError:
         # we removed the failsafe, so now if all chunksize dimensions are incorrect, there is nothing left to chunk,
         # which raises an error saying so. This is the expected behaviour
-        if chunk_mode == 'failsafe':
+        if chunk_mode == "failsafe":
             return
     # GlobCurrent sample file dimensions: time=UNLIMITED, lat=41, lon=81
-    if chunk_mode != 'failsafe':  # chunking time but not lat
-        assert (len(fieldset.U.grid.load_chunk) == len(fieldset.V.grid.load_chunk))
+    if chunk_mode != "failsafe":  # chunking time but not lat
+        assert len(fieldset.U.grid.load_chunk) == len(fieldset.V.grid.load_chunk)
     if chunk_mode is False:
-        assert (len(fieldset.U.grid.load_chunk) == 1)
-    elif chunk_mode == 'auto':
-        assert (len(fieldset.U.grid.load_chunk) != 1)
-    elif chunk_mode == 'specific':
-        assert (len(fieldset.U.grid.load_chunk) == (1 * int(math.ceil(41.0/8.0)) * int(math.ceil(81.0/8.0))))
-    elif chunk_mode == 'failsafe':  # chunking time but not lat
-        assert (len(fieldset.U.grid.load_chunk) != 1)
-        assert (len(fieldset.V.grid.load_chunk) != 1)
+        assert len(fieldset.U.grid.load_chunk) == 1
+    elif chunk_mode == "auto":
+        assert len(fieldset.U.grid.load_chunk) != 1
+    elif chunk_mode == "specific":
+        assert len(fieldset.U.grid.load_chunk) == (
+            1 * int(math.ceil(41.0 / 8.0)) * int(math.ceil(81.0 / 8.0))
+        )
+    elif chunk_mode == "failsafe":  # chunking time but not lat
+        assert len(fieldset.U.grid.load_chunk) != 1
+        assert len(fieldset.V.grid.load_chunk) != 1
     assert abs(pset[0].lon - 23.8) < 1
     assert abs(pset[0].lat - -35.3) < 1
 
 
-@pytest.mark.parametrize('mode', ['jit'])
-@pytest.mark.parametrize('chunk_mode', [False, 'auto', 'specific', 'failsafe'])
+@pytest.mark.parametrize("mode", ["jit"])
+@pytest.mark.parametrize("chunk_mode", [False, "auto", "specific", "failsafe"])
 def test_pop(mode, chunk_mode):
-    if chunk_mode in ['auto', ]:
-        dask.config.set({'array.chunk-size': '256KiB'})
+    if chunk_mode in [
+        "auto",
+    ]:
+        dask.config.set({"array.chunk-size": "256KiB"})
     else:
-        dask.config.set({'array.chunk-size': '128MiB'})
-    data_folder = download_example_dataset('POPSouthernOcean_data')
-    filenames = str(data_folder / 't.x1_SAMOC_flux.1690*.nc')
-    variables = {'U': 'UVEL', 'V': 'VVEL', 'W': 'WVEL'}
-    timestamps = np.expand_dims(np.array([np.datetime64('2000-%.2d-01' % m) for m in range(1, 7)]), axis=1)
-    dimensions = {'lon': 'ULON', 'lat': 'ULAT', 'depth': 'w_dep'}
+        dask.config.set({"array.chunk-size": "128MiB"})
+    data_folder = parcels.download_example_dataset("POPSouthernOcean_data")
+    filenames = str(data_folder / "t.x1_SAMOC_flux.1690*.nc")
+    variables = {"U": "UVEL", "V": "VVEL", "W": "WVEL"}
+    timestamps = np.expand_dims(
+        np.array([np.datetime64("2000-%.2d-01" % m) for m in range(1, 7)]), axis=1
+    )
+    dimensions = {"lon": "ULON", "lat": "ULAT", "depth": "w_dep"}
     chs = False
-    if chunk_mode == 'auto':
-        chs = 'auto'
-    elif chunk_mode == 'specific':
-        chs = {'lon': ('i', 8), 'lat': ('j', 8), 'depth': ('k', 3)}
-    elif chunk_mode == 'failsafe':  # here: bad depth entry
-        chs = {'depth': ('wz', 3), 'lat': ('j', 8), 'lon': ('i', 8)}
+    if chunk_mode == "auto":
+        chs = "auto"
+    elif chunk_mode == "specific":
+        chs = {"lon": ("i", 8), "lat": ("j", 8), "depth": ("k", 3)}
+    elif chunk_mode == "failsafe":  # here: bad depth entry
+        chs = {"depth": ("wz", 3), "lat": ("j", 8), "lon": ("i", 8)}
 
-    fieldset = FieldSet.from_pop(filenames, variables, dimensions, chunksize=chs, timestamps=timestamps)
+    fieldset = parcels.FieldSet.from_pop(
+        filenames, variables, dimensions, chunksize=chs, timestamps=timestamps
+    )
 
     npart = 20
     lonp = 70.0 * np.ones(npart)
-    latp = [i for i in -45.0+(-0.25+np.random.rand(npart)*2.0*0.25)]
-    pset = ParticleSet.from_list(fieldset, ptype[mode], lon=lonp, lat=latp)
-    pset.execute(AdvectionRK4, runtime=delta(days=90), dt=delta(days=2))
+    latp = [i for i in -45.0 + (-0.25 + np.random.rand(npart) * 2.0 * 0.25)]
+    pset = parcels.ParticleSet.from_list(fieldset, ptype[mode], lon=lonp, lat=latp)
+    pset.execute(parcels.AdvectionRK4, runtime=timedelta(days=90), dt=timedelta(days=2))
     # POP sample file dimensions: k=21, j=60, i=60
-    assert (len(fieldset.U.grid.load_chunk) == len(fieldset.V.grid.load_chunk))
-    assert (len(fieldset.U.grid.load_chunk) == len(fieldset.W.grid.load_chunk))
+    assert len(fieldset.U.grid.load_chunk) == len(fieldset.V.grid.load_chunk)
+    assert len(fieldset.U.grid.load_chunk) == len(fieldset.W.grid.load_chunk)
     if chunk_mode is False:
         assert fieldset.gridset.size == 1
-        assert (len(fieldset.U.grid.load_chunk) == 1)
-        assert (len(fieldset.V.grid.load_chunk) == 1)
-        assert (len(fieldset.W.grid.load_chunk) == 1)
-    elif chunk_mode == 'auto':
-        assert fieldset.gridset.size == 3  # because three different grids in 'auto' mode
-        assert (len(fieldset.U.grid.load_chunk) != 1)
-        assert (len(fieldset.V.grid.load_chunk) != 1)
-        assert (len(fieldset.W.grid.load_chunk) != 1)
-    elif chunk_mode == 'specific':
+        assert len(fieldset.U.grid.load_chunk) == 1
+        assert len(fieldset.V.grid.load_chunk) == 1
+        assert len(fieldset.W.grid.load_chunk) == 1
+    elif chunk_mode == "auto":
+        assert (
+            fieldset.gridset.size == 3
+        )  # because three different grids in 'auto' mode
+        assert len(fieldset.U.grid.load_chunk) != 1
+        assert len(fieldset.V.grid.load_chunk) != 1
+        assert len(fieldset.W.grid.load_chunk) != 1
+    elif chunk_mode == "specific":
         assert fieldset.gridset.size == 1
-        assert (len(fieldset.U.grid.load_chunk) == (int(math.ceil(21.0/3.0)) * int(math.ceil(60.0/8.0)) * int(math.ceil(60.0/8.0))))
-    elif chunk_mode == 'failsafe':   # here: done a typo in the netcdf dimname field
+        assert len(fieldset.U.grid.load_chunk) == (
+            int(math.ceil(21.0 / 3.0))
+            * int(math.ceil(60.0 / 8.0))
+            * int(math.ceil(60.0 / 8.0))
+        )
+    elif chunk_mode == "failsafe":  # here: done a typo in the netcdf dimname field
         assert fieldset.gridset.size == 1
-        assert (len(fieldset.U.grid.load_chunk) != 1)
-        assert (len(fieldset.V.grid.load_chunk) != 1)
-        assert (len(fieldset.W.grid.load_chunk) != 1)
-        assert (len(fieldset.U.grid.load_chunk) == (int(math.ceil(21.0/3.0)) * int(math.ceil(60.0/8.0)) * int(math.ceil(60.0/8.0))))
-
-
-@pytest.mark.parametrize('mode', ['jit'])
-@pytest.mark.parametrize('chunk_mode', [False, 'auto', 'specific', 'failsafe'])
+        assert len(fieldset.U.grid.load_chunk) != 1
+        assert len(fieldset.V.grid.load_chunk) != 1
+        assert len(fieldset.W.grid.load_chunk) != 1
+        assert len(fieldset.U.grid.load_chunk) == (
+            int(math.ceil(21.0 / 3.0))
+            * int(math.ceil(60.0 / 8.0))
+            * int(math.ceil(60.0 / 8.0))
+        )
+
+
+@pytest.mark.parametrize("mode", ["jit"])
+@pytest.mark.parametrize("chunk_mode", [False, "auto", "specific", "failsafe"])
 def test_swash(mode, chunk_mode):
-    if chunk_mode in ['auto', ]:
-        dask.config.set({'array.chunk-size': '32KiB'})
+    if chunk_mode in [
+        "auto",
+    ]:
+        dask.config.set({"array.chunk-size": "32KiB"})
     else:
-        dask.config.set({'array.chunk-size': '128MiB'})
-    data_folder = download_example_dataset('SWASH_data')
-    filenames = str(data_folder / 'field_*.nc')
-    variables = {'U': 'cross-shore velocity',
-                 'V': 'along-shore velocity',
-                 'W': 'vertical velocity',
-                 'depth_w': 'time varying depth',
-                 'depth_u': 'time varying depth_u'}
-    dimensions = {'U': {'lon': 'x', 'lat': 'y', 'depth': 'not_yet_set', 'time': 't'},
-                  'V': {'lon': 'x', 'lat': 'y', 'depth': 'not_yet_set', 'time': 't'},
-                  'W': {'lon': 'x', 'lat': 'y', 'depth': 'not_yet_set', 'time': 't'},
-                  'depth_w': {'lon': 'x', 'lat': 'y', 'depth': 'not_yet_set', 'time': 't'},
-                  'depth_u': {'lon': 'x', 'lat': 'y', 'depth': 'not_yet_set', 'time': 't'}}
+        dask.config.set({"array.chunk-size": "128MiB"})
+    data_folder = parcels.download_example_dataset("SWASH_data")
+    filenames = str(data_folder / "field_*.nc")
+    variables = {
+        "U": "cross-shore velocity",
+        "V": "along-shore velocity",
+        "W": "vertical velocity",
+        "depth_w": "time varying depth",
+        "depth_u": "time varying depth_u",
+    }
+    dimensions = {
+        "U": {"lon": "x", "lat": "y", "depth": "not_yet_set", "time": "t"},
+        "V": {"lon": "x", "lat": "y", "depth": "not_yet_set", "time": "t"},
+        "W": {"lon": "x", "lat": "y", "depth": "not_yet_set", "time": "t"},
+        "depth_w": {"lon": "x", "lat": "y", "depth": "not_yet_set", "time": "t"},
+        "depth_u": {"lon": "x", "lat": "y", "depth": "not_yet_set", "time": "t"},
+    }
     chs = False
-    if chunk_mode == 'auto':
-        chs = 'auto'
-    elif chunk_mode == 'specific':
-        chs = {'U': {'depth': ('z_u', 6), 'lat': ('y', 4), 'lon': ('x', 4)},
-               'V': {'depth': ('z_u', 6), 'lat': ('y', 4), 'lon': ('x', 4)},
-               'W': {'depth': ('z', 7), 'lat': ('y', 4), 'lon': ('x', 4)},
-               'depth_w': {'depth': ('z', 7), 'lat': ('y', 4), 'lon': ('x', 4)},
-               'depth_u': {'depth': ('z_u', 6), 'lat': ('y', 4), 'lon': ('x', 4)}
-               }
-    elif chunk_mode == 'failsafe':  # here: incorrect matching between dimension names and their attachment to the NC-variables
-        chs = {'U': {'depth': ('depth', 7), 'lat': ('y', 4), 'lon': ('x', 4)},
-               'V': {'depth': ('z_u', 6), 'lat': ('y', 4), 'lon': ('x', 4)},
-               'W': {'depth': ('z', 7), 'lat': ('y', 4), 'lon': ('x', 4)},
-               'depth_w': {'depth': ('z', 7), 'lat': ('y', 4), 'lon': ('x', 4)},
-               'depth_u': {'depth': ('z_u', 6), 'lat': ('y', 4), 'lon': ('x', 4)}
-               }
-    fieldset = FieldSet.from_netcdf(filenames, variables, dimensions, mesh='flat', allow_time_extrapolation=True, chunksize=chs)
+    if chunk_mode == "auto":
+        chs = "auto"
+    elif chunk_mode == "specific":
+        chs = {
+            "U": {"depth": ("z_u", 6), "lat": ("y", 4), "lon": ("x", 4)},
+            "V": {"depth": ("z_u", 6), "lat": ("y", 4), "lon": ("x", 4)},
+            "W": {"depth": ("z", 7), "lat": ("y", 4), "lon": ("x", 4)},
+            "depth_w": {"depth": ("z", 7), "lat": ("y", 4), "lon": ("x", 4)},
+            "depth_u": {"depth": ("z_u", 6), "lat": ("y", 4), "lon": ("x", 4)},
+        }
+    elif (
+        chunk_mode == "failsafe"
+    ):  # here: incorrect matching between dimension names and their attachment to the NC-variables
+        chs = {
+            "U": {"depth": ("depth", 7), "lat": ("y", 4), "lon": ("x", 4)},
+            "V": {"depth": ("z_u", 6), "lat": ("y", 4), "lon": ("x", 4)},
+            "W": {"depth": ("z", 7), "lat": ("y", 4), "lon": ("x", 4)},
+            "depth_w": {"depth": ("z", 7), "lat": ("y", 4), "lon": ("x", 4)},
+            "depth_u": {"depth": ("z_u", 6), "lat": ("y", 4), "lon": ("x", 4)},
+        }
+    fieldset = parcels.FieldSet.from_netcdf(
+        filenames,
+        variables,
+        dimensions,
+        mesh="flat",
+        allow_time_extrapolation=True,
+        chunksize=chs,
+    )
     fieldset.U.set_depth_from_field(fieldset.depth_u)
     fieldset.V.set_depth_from_field(fieldset.depth_u)
     fieldset.W.set_depth_from_field(fieldset.depth_w)
@@ -243,207 +359,344 @@ def test_swash(mode, chunk_mode):
     npart = 20
     lonp = [i for i in 9.5 + (-0.2 + np.random.rand(npart) * 2.0 * 0.2)]
     latp = [i for i in np.arange(start=12.3, stop=13.1, step=0.04)[0:20]]
-    depthp = [-0.1, ] * npart
-    pset = ParticleSet.from_list(fieldset, ptype[mode], lon=lonp, lat=latp, depth=depthp)
-    pset.execute(AdvectionRK4, runtime=delta(seconds=0.2), dt=delta(seconds=0.005))
+    depthp = [
+        -0.1,
+    ] * npart
+    pset = parcels.ParticleSet.from_list(
+        fieldset, ptype[mode], lon=lonp, lat=latp, depth=depthp
+    )
+    pset.execute(
+        parcels.AdvectionRK4,
+        runtime=timedelta(seconds=0.2),
+        dt=timedelta(seconds=0.005),
+    )
     # SWASH sample file dimensions: t=1, z=7, z_u=6, y=21, x=51
-    if chunk_mode not in ['failsafe', ]:
-        assert (len(fieldset.U.grid.load_chunk) == len(fieldset.V.grid.load_chunk)), f"U {fieldset.U.grid.chunk_info} vs V {fieldset.V.grid.chunk_info}"
-    if chunk_mode not in ['failsafe', 'auto']:
-        assert (len(fieldset.U.grid.load_chunk) == len(fieldset.W.grid.load_chunk)), f"U {fieldset.U.grid.chunk_info} vs W {fieldset.W.grid.chunk_info}"
+    if chunk_mode not in [
+        "failsafe",
+    ]:
+        assert len(fieldset.U.grid.load_chunk) == len(
+            fieldset.V.grid.load_chunk
+        ), f"U {fieldset.U.grid.chunk_info} vs V {fieldset.V.grid.chunk_info}"
+    if chunk_mode not in ["failsafe", "auto"]:
+        assert len(fieldset.U.grid.load_chunk) == len(
+            fieldset.W.grid.load_chunk
+        ), f"U {fieldset.U.grid.chunk_info} vs W {fieldset.W.grid.chunk_info}"
     if chunk_mode is False:
-        assert (len(fieldset.U.grid.load_chunk) == 1)
+        assert len(fieldset.U.grid.load_chunk) == 1
     else:
-        assert (len(fieldset.U.grid.load_chunk) != 1)
-        assert (len(fieldset.V.grid.load_chunk) != 1)
-        assert (len(fieldset.W.grid.load_chunk) != 1)
-    if chunk_mode == 'specific':
-        assert (len(fieldset.U.grid.load_chunk) == (1 * int(math.ceil(6.0 / 6.0)) * int(math.ceil(21.0 / 4.0)) * int(math.ceil(51.0 / 4.0))))
-        assert (len(fieldset.V.grid.load_chunk) == (1 * int(math.ceil(6.0 / 6.0)) * int(math.ceil(21.0 / 4.0)) * int(math.ceil(51.0 / 4.0))))
-        assert (len(fieldset.W.grid.load_chunk) == (1 * int(math.ceil(7.0 / 7.0)) * int(math.ceil(21.0 / 4.0)) * int(math.ceil(51.0 / 4.0))))
-
-
-@pytest.mark.parametrize('mode', ['jit'])
-@pytest.mark.parametrize('chunk_mode', [False, 'auto', 'specific'])
+        assert len(fieldset.U.grid.load_chunk) != 1
+        assert len(fieldset.V.grid.load_chunk) != 1
+        assert len(fieldset.W.grid.load_chunk) != 1
+    if chunk_mode == "specific":
+        assert len(fieldset.U.grid.load_chunk) == (
+            1
+            * int(math.ceil(6.0 / 6.0))
+            * int(math.ceil(21.0 / 4.0))
+            * int(math.ceil(51.0 / 4.0))
+        )
+        assert len(fieldset.V.grid.load_chunk) == (
+            1
+            * int(math.ceil(6.0 / 6.0))
+            * int(math.ceil(21.0 / 4.0))
+            * int(math.ceil(51.0 / 4.0))
+        )
+        assert len(fieldset.W.grid.load_chunk) == (
+            1
+            * int(math.ceil(7.0 / 7.0))
+            * int(math.ceil(21.0 / 4.0))
+            * int(math.ceil(51.0 / 4.0))
+        )
+
+
+@pytest.mark.parametrize("mode", ["jit"])
+@pytest.mark.parametrize("chunk_mode", [False, "auto", "specific"])
 def test_ofam_3D(mode, chunk_mode):
-    if chunk_mode in ['auto', ]:
-        dask.config.set({'array.chunk-size': '1024KiB'})
+    if chunk_mode in [
+        "auto",
+    ]:
+        dask.config.set({"array.chunk-size": "1024KiB"})
     else:
-        dask.config.set({'array.chunk-size': '128MiB'})
-
-    data_folder = download_example_dataset("OFAM_example_data")
-    filenames = {'U': f"{data_folder}/OFAM_simple_U.nc",
-                 'V': f"{data_folder}/OFAM_simple_V.nc"}
-    variables = {'U': 'u', 'V': 'v'}
-    dimensions = {'lat': 'yu_ocean', 'lon': 'xu_ocean', 'depth': 'st_ocean',
-                  'time': 'Time'}
+        dask.config.set({"array.chunk-size": "128MiB"})
+
+    data_folder = parcels.download_example_dataset("OFAM_example_data")
+    filenames = {
+        "U": f"{data_folder}/OFAM_simple_U.nc",
+        "V": f"{data_folder}/OFAM_simple_V.nc",
+    }
+    variables = {"U": "u", "V": "v"}
+    dimensions = {
+        "lat": "yu_ocean",
+        "lon": "xu_ocean",
+        "depth": "st_ocean",
+        "time": "Time",
+    }
 
     chs = False
-    if chunk_mode == 'auto':
-        chs = 'auto'
-    elif chunk_mode == 'specific':
-        chs = {'lon': ('xu_ocean', 100), 'lat': ('yu_ocean', 50), 'depth': ('st_edges_ocean', 60), 'time': ('Time', 1)}
-    fieldset = FieldSet.from_netcdf(filenames, variables, dimensions, allow_time_extrapolation=True, chunksize=chs)
-
-    pset = ParticleSet(fieldset, pclass=ptype[mode], lon=180, lat=10, depth=2.5)
-    pset.execute(AdvectionRK4, runtime=delta(days=10), dt=delta(minutes=5))
+    if chunk_mode == "auto":
+        chs = "auto"
+    elif chunk_mode == "specific":
+        chs = {
+            "lon": ("xu_ocean", 100),
+            "lat": ("yu_ocean", 50),
+            "depth": ("st_edges_ocean", 60),
+            "time": ("Time", 1),
+        }
+    fieldset = parcels.FieldSet.from_netcdf(
+        filenames, variables, dimensions, allow_time_extrapolation=True, chunksize=chs
+    )
+
+    pset = parcels.ParticleSet(fieldset, pclass=ptype[mode], lon=180, lat=10, depth=2.5)
+    pset.execute(
+        parcels.AdvectionRK4, runtime=timedelta(days=10), dt=timedelta(minutes=5)
+    )
     # OFAM sample file dimensions: time=UNLIMITED, st_ocean=1, st_edges_ocean=52, lat=601, lon=2001
-    assert (len(fieldset.U.grid.load_chunk) == len(fieldset.V.grid.load_chunk))
+    assert len(fieldset.U.grid.load_chunk) == len(fieldset.V.grid.load_chunk)
     if chunk_mode is False:
-        assert (len(fieldset.U.grid.load_chunk) == 1)
-    elif chunk_mode == 'auto':
-        assert (len(fieldset.U.grid.load_chunk) != 1)
-    elif chunk_mode == 'specific':
+        assert len(fieldset.U.grid.load_chunk) == 1
+    elif chunk_mode == "auto":
+        assert len(fieldset.U.grid.load_chunk) != 1
+    elif chunk_mode == "specific":
         numblocks = [i for i in fieldset.U.grid.chunk_info[1:3]]
         dblocks = 1
         vblocks = 0
-        for bsize in fieldset.U.grid.chunk_info[3:3+numblocks[0]]:
+        for bsize in fieldset.U.grid.chunk_info[3 : 3 + numblocks[0]]:
             vblocks += bsize
         ublocks = 0
-        for bsize in fieldset.U.grid.chunk_info[3+numblocks[0]:3+numblocks[0]+numblocks[1]]:
+        for bsize in fieldset.U.grid.chunk_info[
+            3 + numblocks[0] : 3 + numblocks[0] + numblocks[1]
+        ]:
             ublocks += bsize
-        matching_numblocks = (ublocks == 2001 and vblocks == 601 and dblocks == 1)
-        matching_fields = (fieldset.U.grid.chunk_info == fieldset.V.grid.chunk_info)
-        matching_uniformblocks = (len(fieldset.U.grid.load_chunk) == (1 * int(math.ceil(1.0/60.0)) * int(math.ceil(601.0/50.0)) * int(math.ceil(2001.0/100.0))))
-        assert (matching_uniformblocks or (matching_fields and matching_numblocks))
+        matching_numblocks = ublocks == 2001 and vblocks == 601 and dblocks == 1
+        matching_fields = fieldset.U.grid.chunk_info == fieldset.V.grid.chunk_info
+        matching_uniformblocks = len(fieldset.U.grid.load_chunk) == (
+            1
+            * int(math.ceil(1.0 / 60.0))
+            * int(math.ceil(601.0 / 50.0))
+            * int(math.ceil(2001.0 / 100.0))
+        )
+        assert matching_uniformblocks or (matching_fields and matching_numblocks)
     assert abs(pset[0].lon - 173) < 1
     assert abs(pset[0].lat - 11) < 1
 
 
-@pytest.mark.parametrize('mode', ['jit'])
-@pytest.mark.parametrize('chunk_mode', [False, 'auto', 'specific_same', 'specific_different'])
-@pytest.mark.parametrize('using_add_field', [False, True])
+@pytest.mark.parametrize("mode", ["jit"])
+@pytest.mark.parametrize(
+    "chunk_mode", [False, "auto", "specific_same", "specific_different"]
+)
+@pytest.mark.parametrize("using_add_field", [False, True])
 def test_mitgcm(mode, chunk_mode, using_add_field):
-    if chunk_mode in ['auto', ]:
-        dask.config.set({'array.chunk-size': '512KiB'})
+    if chunk_mode in [
+        "auto",
+    ]:
+        dask.config.set({"array.chunk-size": "512KiB"})
     else:
-        dask.config.set({'array.chunk-size': '128MiB'})
-    data_folder = download_example_dataset("MITgcm_example_data")
-    filenames = {"U": f"{data_folder}/mitgcm_UV_surface_zonally_reentrant.nc",
-                 "V": f"{data_folder}/mitgcm_UV_surface_zonally_reentrant.nc"}
+        dask.config.set({"array.chunk-size": "128MiB"})
+    data_folder = parcels.download_example_dataset("MITgcm_example_data")
+    filenames = {
+        "U": f"{data_folder}/mitgcm_UV_surface_zonally_reentrant.nc",
+        "V": f"{data_folder}/mitgcm_UV_surface_zonally_reentrant.nc",
+    }
     variables = {"U": "UVEL", "V": "VVEL"}
-    dimensions = {"U": {"lon": "XG", "lat": "YG", "time": "time"},
-                  "V": {"lon": "XG", "lat": "YG", "time": "time"}}
+    dimensions = {
+        "U": {"lon": "XG", "lat": "YG", "time": "time"},
+        "V": {"lon": "XG", "lat": "YG", "time": "time"},
+    }
 
     chs = False
-    if chunk_mode == 'auto':
-        chs = 'auto'
-    elif chunk_mode == 'specific_same':
-        chs = {'U': {'lat': ('YC', 50), 'lon': ('XG', 100)},
-               'V': {'lat': ('YG', 50), 'lon': ('XC', 100)}}
-    elif chunk_mode == 'specific_different':
-        chs = {'U': {'lat': ('YC', 50), 'lon': ('XG', 100)},
-               'V': {'lat': ('YG', 40), 'lon': ('XC', 100)}}
+    if chunk_mode == "auto":
+        chs = "auto"
+    elif chunk_mode == "specific_same":
+        chs = {
+            "U": {"lat": ("YC", 50), "lon": ("XG", 100)},
+            "V": {"lat": ("YG", 50), "lon": ("XC", 100)},
+        }
+    elif chunk_mode == "specific_different":
+        chs = {
+            "U": {"lat": ("YC", 50), "lon": ("XG", 100)},
+            "V": {"lat": ("YG", 40), "lon": ("XC", 100)},
+        }
     if using_add_field:
-        if chs in [False, 'auto']:
-            chs = {'U': chs, 'V': chs}
-        fieldset = FieldSet.from_mitgcm(filenames['U'], {'U': variables['U']}, dimensions['U'],
-                                        mesh='flat', chunksize=chs['U'])
-        fieldset2 = FieldSet.from_mitgcm(filenames['V'], {'V': variables['V']}, dimensions['V'],
-                                         mesh='flat', chunksize=chs['V'])
+        if chs in [False, "auto"]:
+            chs = {"U": chs, "V": chs}
+        fieldset = parcels.FieldSet.from_mitgcm(
+            filenames["U"],
+            {"U": variables["U"]},
+            dimensions["U"],
+            mesh="flat",
+            chunksize=chs["U"],
+        )
+        fieldset2 = parcels.FieldSet.from_mitgcm(
+            filenames["V"],
+            {"V": variables["V"]},
+            dimensions["V"],
+            mesh="flat",
+            chunksize=chs["V"],
+        )
         fieldset.add_field(fieldset2.V)
     else:
-        fieldset = FieldSet.from_mitgcm(filenames, variables, dimensions, mesh='flat', chunksize=chs)
-
-    pset = ParticleSet.from_list(fieldset=fieldset, pclass=ptype[mode], lon=5e5, lat=5e5)
-    pset.execute(AdvectionRK4, runtime=delta(days=1), dt=delta(minutes=5))
+        fieldset = parcels.FieldSet.from_mitgcm(
+            filenames, variables, dimensions, mesh="flat", chunksize=chs
+        )
+
+    pset = parcels.ParticleSet.from_list(
+        fieldset=fieldset, pclass=ptype[mode], lon=5e5, lat=5e5
+    )
+    pset.execute(
+        parcels.AdvectionRK4, runtime=timedelta(days=1), dt=timedelta(minutes=5)
+    )
     # MITgcm sample file dimensions: time=10, XG=400, YG=200
-    if chunk_mode != 'specific_different':
-        assert (len(fieldset.U.grid.load_chunk) == len(fieldset.V.grid.load_chunk))
-    if chunk_mode in [False, ]:
-        assert (len(fieldset.U.grid.load_chunk) == 1)
-    elif chunk_mode in ['auto', ]:
-        assert (len(fieldset.U.grid.load_chunk) != 1)
-    elif 'specific' in chunk_mode:
-        assert (len(fieldset.U.grid.load_chunk) == (1 * int(math.ceil(400.0/50.0)) * int(math.ceil(200.0/100.0))))
-    if chunk_mode == 'specific_same':
+    if chunk_mode != "specific_different":
+        assert len(fieldset.U.grid.load_chunk) == len(fieldset.V.grid.load_chunk)
+    if chunk_mode in [
+        False,
+    ]:
+        assert len(fieldset.U.grid.load_chunk) == 1
+    elif chunk_mode in [
+        "auto",
+    ]:
+        assert len(fieldset.U.grid.load_chunk) != 1
+    elif "specific" in chunk_mode:
+        assert len(fieldset.U.grid.load_chunk) == (
+            1 * int(math.ceil(400.0 / 50.0)) * int(math.ceil(200.0 / 100.0))
+        )
+    if chunk_mode == "specific_same":
         assert fieldset.gridset.size == 1
-    elif chunk_mode == 'specific_different':
+    elif chunk_mode == "specific_different":
         assert fieldset.gridset.size == 2
     assert np.allclose(pset[0].lon, 5.27e5, atol=1e3)
 
 
-@pytest.mark.parametrize('mode', ['jit'])
+@pytest.mark.parametrize("mode", ["jit"])
 def test_diff_entry_dimensions_chunks(mode):
-    data_folder = download_example_dataset('NemoNorthSeaORCA025-N006_data')
-    ufiles = sorted(glob(f'{data_folder}/ORCA*U.nc'))
-    vfiles = sorted(glob(f'{data_folder}/ORCA*V.nc'))
-    mesh_mask = f'{data_folder}/coordinates.nc'
-
-    filenames = {'U': {'lon': mesh_mask, 'lat': mesh_mask, 'data': ufiles},
-                 'V': {'lon': mesh_mask, 'lat': mesh_mask, 'data': vfiles}}
-    variables = {'U': 'uo',
-                 'V': 'vo'}
-    dimensions = {'U': {'lon': 'glamf', 'lat': 'gphif', 'time': 'time_counter'},
-                  'V': {'lon': 'glamf', 'lat': 'gphif', 'time': 'time_counter'}}
-    chs = {'U': {'depth': ('depthu', 75), 'lat': ('y', 16), 'lon': ('x', 16)},
-           'V': {'depth': ('depthv', 75), 'lat': ('y', 16), 'lon': ('x', 16)}}
-    fieldset = FieldSet.from_nemo(filenames, variables, dimensions, chunksize=chs)
+    data_folder = parcels.download_example_dataset("NemoNorthSeaORCA025-N006_data")
+    ufiles = sorted(glob(f"{data_folder}/ORCA*U.nc"))
+    vfiles = sorted(glob(f"{data_folder}/ORCA*V.nc"))
+    mesh_mask = f"{data_folder}/coordinates.nc"
+
+    filenames = {
+        "U": {"lon": mesh_mask, "lat": mesh_mask, "data": ufiles},
+        "V": {"lon": mesh_mask, "lat": mesh_mask, "data": vfiles},
+    }
+    variables = {"U": "uo", "V": "vo"}
+    dimensions = {
+        "U": {"lon": "glamf", "lat": "gphif", "time": "time_counter"},
+        "V": {"lon": "glamf", "lat": "gphif", "time": "time_counter"},
+    }
+    chs = {
+        "U": {"depth": ("depthu", 75), "lat": ("y", 16), "lon": ("x", 16)},
+        "V": {"depth": ("depthv", 75), "lat": ("y", 16), "lon": ("x", 16)},
+    }
+    fieldset = parcels.FieldSet.from_nemo(
+        filenames, variables, dimensions, chunksize=chs
+    )
     compute_nemo_particle_advection(fieldset, mode)
     # Nemo sample file dimensions: depthu=75, y=201, x=151
-    assert (len(fieldset.U.grid.load_chunk) == len(fieldset.V.grid.load_chunk))
+    assert len(fieldset.U.grid.load_chunk) == len(fieldset.V.grid.load_chunk)
 
 
-@pytest.mark.parametrize('mode', ['scipy', 'jit'])
+@pytest.mark.parametrize("mode", ["scipy", "jit"])
 def test_3d_2dfield_sampling(mode):
-    data_folder = download_example_dataset('NemoNorthSeaORCA025-N006_data')
-    ufiles = sorted(glob(f'{data_folder}/ORCA*U.nc'))
-    vfiles = sorted(glob(f'{data_folder}/ORCA*V.nc'))
-    mesh_mask = f'{data_folder}/coordinates.nc'
-
-    filenames = {'U': {'lon': mesh_mask, 'lat': mesh_mask, 'data': ufiles},
-                 'V': {'lon': mesh_mask, 'lat': mesh_mask, 'data': vfiles},
-                 'nav_lon': {'lon': mesh_mask, 'lat': mesh_mask, 'data': [ufiles[0], ]}}
-    variables = {'U': 'uo',
-                 'V': 'vo',
-                 'nav_lon': 'nav_lon'}
-    dimensions = {'U': {'lon': 'glamf', 'lat': 'gphif', 'time': 'time_counter'},
-                  'V': {'lon': 'glamf', 'lat': 'gphif', 'time': 'time_counter'},
-                  'nav_lon': {'lon': 'glamf', 'lat': 'gphif'}}
-    fieldset = FieldSet.from_nemo(filenames, variables, dimensions, chunksize=False)
+    data_folder = parcels.download_example_dataset("NemoNorthSeaORCA025-N006_data")
+    ufiles = sorted(glob(f"{data_folder}/ORCA*U.nc"))
+    vfiles = sorted(glob(f"{data_folder}/ORCA*V.nc"))
+    mesh_mask = f"{data_folder}/coordinates.nc"
+
+    filenames = {
+        "U": {"lon": mesh_mask, "lat": mesh_mask, "data": ufiles},
+        "V": {"lon": mesh_mask, "lat": mesh_mask, "data": vfiles},
+        "nav_lon": {
+            "lon": mesh_mask,
+            "lat": mesh_mask,
+            "data": [
+                ufiles[0],
+            ],
+        },
+    }
+    variables = {"U": "uo", "V": "vo", "nav_lon": "nav_lon"}
+    dimensions = {
+        "U": {"lon": "glamf", "lat": "gphif", "time": "time_counter"},
+        "V": {"lon": "glamf", "lat": "gphif", "time": "time_counter"},
+        "nav_lon": {"lon": "glamf", "lat": "gphif"},
+    }
+    fieldset = parcels.FieldSet.from_nemo(
+        filenames, variables, dimensions, chunksize=False
+    )
     fieldset.nav_lon.data = np.ones(fieldset.nav_lon.data.shape, dtype=np.float32)
-    fieldset.add_field(Field('rectilinear_2D', np.ones((2, 2)),
-                             lon=np.array([-10, 20]), lat=np.array([40, 80]), chunksize=False))
+    fieldset.add_field(
+        parcels.Field(
+            "rectilinear_2D",
+            np.ones((2, 2)),
+            lon=np.array([-10, 20]),
+            lat=np.array([40, 80]),
+            chunksize=False,
+        )
+    )
 
     class MyParticle(ptype[mode]):
-        sample_var_curvilinear = Variable('sample_var_curvilinear')
-        sample_var_rectilinear = Variable('sample_var_rectilinear')
-    pset = ParticleSet(fieldset, pclass=MyParticle, lon=2.5, lat=52)
+        sample_var_curvilinear = parcels.Variable("sample_var_curvilinear")
+        sample_var_rectilinear = parcels.Variable("sample_var_rectilinear")
+
+    pset = parcels.ParticleSet(fieldset, pclass=MyParticle, lon=2.5, lat=52)
 
     def Sample2D(particle, fieldset, time):
-        particle.sample_var_curvilinear += fieldset.nav_lon[time, particle.depth, particle.lat, particle.lon]
-        particle.sample_var_rectilinear += fieldset.rectilinear_2D[time, particle.depth, particle.lat, particle.lon]
+        particle.sample_var_curvilinear += fieldset.nav_lon[
+            time, particle.depth, particle.lat, particle.lon
+        ]
+        particle.sample_var_rectilinear += fieldset.rectilinear_2D[
+            time, particle.depth, particle.lat, particle.lon
+        ]
 
-    runtime, dt = 86400*4, 6*3600
-    pset.execute(pset.Kernel(AdvectionRK4) + Sample2D, runtime=runtime, dt=dt)
+    runtime, dt = 86400 * 4, 6 * 3600
+    pset.execute(pset.Kernel(parcels.AdvectionRK4) + Sample2D, runtime=runtime, dt=dt)
 
-    assert pset.sample_var_rectilinear == runtime/dt
-    assert pset.sample_var_curvilinear == runtime/dt
+    assert pset.sample_var_rectilinear == runtime / dt
+    assert pset.sample_var_curvilinear == runtime / dt
 
 
-@pytest.mark.parametrize('mode', ['jit'])
+@pytest.mark.parametrize("mode", ["jit"])
 def test_diff_entry_chunksize_error_nemo_complex_conform_depth(mode):
     # ==== this test is expected to fall-back to a pre-defined minimal chunk as ==== #
     # ==== the requested chunks don't match, or throw a value error.            ==== #
-    data_folder = download_example_dataset('NemoNorthSeaORCA025-N006_data')
-    ufiles = sorted(glob(f'{data_folder}/ORCA*U.nc'))
-    vfiles = sorted(glob(f'{data_folder}/ORCA*V.nc'))
-    wfiles = sorted(glob(f'{data_folder}/ORCA*W.nc'))
-    mesh_mask = f'{data_folder}/coordinates.nc'
-
-    filenames = {'U': {'lon': mesh_mask, 'lat': mesh_mask, 'depth': wfiles[0], 'data': ufiles},
-                 'V': {'lon': mesh_mask, 'lat': mesh_mask, 'depth': wfiles[0], 'data': vfiles},
-                 'W': {'lon': mesh_mask, 'lat': mesh_mask, 'depth': wfiles[0], 'data': wfiles}}
-    variables = {'U': 'uo',
-                 'V': 'vo',
-                 'W': 'wo'}
-    dimensions = {'U': {'lon': 'glamf', 'lat': 'gphif', 'depth': 'depthw', 'time': 'time_counter'},
-                  'V': {'lon': 'glamf', 'lat': 'gphif', 'depth': 'depthw', 'time': 'time_counter'},
-                  'W': {'lon': 'glamf', 'lat': 'gphif', 'depth': 'depthw', 'time': 'time_counter'}}
-    chs = {'U': {'depth': ('depthu', 75), 'lat': ('y', 16), 'lon': ('x', 16)},
-           'V': {'depth': ('depthv', 75), 'lat': ('y', 4), 'lon': ('x', 16)},
-           'W': {'depth': ('depthw', 75), 'lat': ('y', 16), 'lon': ('x', 4)}}
-    fieldset = FieldSet.from_nemo(filenames, variables, dimensions, chunksize=chs)
+    data_folder = parcels.download_example_dataset("NemoNorthSeaORCA025-N006_data")
+    ufiles = sorted(glob(f"{data_folder}/ORCA*U.nc"))
+    vfiles = sorted(glob(f"{data_folder}/ORCA*V.nc"))
+    wfiles = sorted(glob(f"{data_folder}/ORCA*W.nc"))
+    mesh_mask = f"{data_folder}/coordinates.nc"
+
+    filenames = {
+        "U": {"lon": mesh_mask, "lat": mesh_mask, "depth": wfiles[0], "data": ufiles},
+        "V": {"lon": mesh_mask, "lat": mesh_mask, "depth": wfiles[0], "data": vfiles},
+        "W": {"lon": mesh_mask, "lat": mesh_mask, "depth": wfiles[0], "data": wfiles},
+    }
+    variables = {"U": "uo", "V": "vo", "W": "wo"}
+    dimensions = {
+        "U": {
+            "lon": "glamf",
+            "lat": "gphif",
+            "depth": "depthw",
+            "time": "time_counter",
+        },
+        "V": {
+            "lon": "glamf",
+            "lat": "gphif",
+            "depth": "depthw",
+            "time": "time_counter",
+        },
+        "W": {
+            "lon": "glamf",
+            "lat": "gphif",
+            "depth": "depthw",
+            "time": "time_counter",
+        },
+    }
+    chs = {
+        "U": {"depth": ("depthu", 75), "lat": ("y", 16), "lon": ("x", 16)},
+        "V": {"depth": ("depthv", 75), "lat": ("y", 4), "lon": ("x", 16)},
+        "W": {"depth": ("depthw", 75), "lat": ("y", 16), "lon": ("x", 4)},
+    }
+    fieldset = parcels.FieldSet.from_nemo(
+        filenames, variables, dimensions, chunksize=chs
+    )
     compute_nemo_particle_advection(fieldset, mode)
     # Nemo sample file dimensions: depthu=75, y=201, x=151
     npart_U = 1
@@ -452,47 +705,72 @@ def test_diff_entry_chunksize_error_nemo_complex_conform_depth(mode):
     npart_V = [npart_V * k for k in fieldset.V.nchunks[1:]]
     npart_W = 1
     npart_W = [npart_W * k for k in fieldset.V.nchunks[1:]]
-    chn = {'U': {'lat': int(math.ceil(201.0/chs['U']['lat'][1])),
-                 'lon': int(math.ceil(151.0/chs['U']['lon'][1])),
-                 'depth': int(math.ceil(75.0/chs['U']['depth'][1]))},
-           'V': {'lat': int(math.ceil(201.0/chs['V']['lat'][1])),
-                 'lon': int(math.ceil(151.0/chs['V']['lon'][1])),
-                 'depth': int(math.ceil(75.0/chs['V']['depth'][1]))},
-           'W': {'lat': int(math.ceil(201.0/chs['W']['lat'][1])),
-                 'lon': int(math.ceil(151.0/chs['W']['lon'][1])),
-                 'depth': int(math.ceil(75.0/chs['W']['depth'][1]))}}
+    chn = {
+        "U": {
+            "lat": int(math.ceil(201.0 / chs["U"]["lat"][1])),
+            "lon": int(math.ceil(151.0 / chs["U"]["lon"][1])),
+            "depth": int(math.ceil(75.0 / chs["U"]["depth"][1])),
+        },
+        "V": {
+            "lat": int(math.ceil(201.0 / chs["V"]["lat"][1])),
+            "lon": int(math.ceil(151.0 / chs["V"]["lon"][1])),
+            "depth": int(math.ceil(75.0 / chs["V"]["depth"][1])),
+        },
+        "W": {
+            "lat": int(math.ceil(201.0 / chs["W"]["lat"][1])),
+            "lon": int(math.ceil(151.0 / chs["W"]["lon"][1])),
+            "depth": int(math.ceil(75.0 / chs["W"]["depth"][1])),
+        },
+    }
     npart_U_request = 1
-    npart_U_request = [npart_U_request * chn['U'][k] for k in chn['U']]
+    npart_U_request = [npart_U_request * chn["U"][k] for k in chn["U"]]
     npart_V_request = 1
-    npart_V_request = [npart_V_request * chn['V'][k] for k in chn['V']]
+    npart_V_request = [npart_V_request * chn["V"][k] for k in chn["V"]]
     npart_W_request = 1
-    npart_W_request = [npart_W_request * chn['W'][k] for k in chn['W']]
-    assert (npart_U != npart_U_request)
-    assert (npart_V != npart_V_request)
-    assert (npart_W != npart_W_request)
+    npart_W_request = [npart_W_request * chn["W"][k] for k in chn["W"]]
+    assert npart_U != npart_U_request
+    assert npart_V != npart_V_request
+    assert npart_W != npart_W_request
 
 
-@pytest.mark.parametrize('mode', ['jit'])
+@pytest.mark.parametrize("mode", ["jit"])
 def test_diff_entry_chunksize_correction_globcurrent(mode):
-    data_folder = download_example_dataset("GlobCurrent_example_data")
-    filenames = str(data_folder / '200201*-GLOBCURRENT-L4-CUReul_hs-ALT_SUM-v02.0-fv01.0.nc')
-    variables = {'U': 'eastward_eulerian_current_velocity', 'V': 'northward_eulerian_current_velocity'}
-    dimensions = {'lat': 'lat', 'lon': 'lon', 'time': 'time'}
-    chs = {'U': {'lat': ('lat', 16), 'lon': ('lon', 16)},
-           'V': {'lat': ('lat', 16), 'lon': ('lon', 4)}}
-    fieldset = FieldSet.from_netcdf(filenames, variables, dimensions, chunksize=chs)
-    pset = ParticleSet(fieldset, pclass=ptype[mode], lon=25, lat=-35)
-    pset.execute(AdvectionRK4, runtime=delta(days=1), dt=delta(minutes=5))
+    data_folder = parcels.download_example_dataset("GlobCurrent_example_data")
+    filenames = str(
+        data_folder / "200201*-GLOBCURRENT-L4-CUReul_hs-ALT_SUM-v02.0-fv01.0.nc"
+    )
+    variables = {
+        "U": "eastward_eulerian_current_velocity",
+        "V": "northward_eulerian_current_velocity",
+    }
+    dimensions = {"lat": "lat", "lon": "lon", "time": "time"}
+    chs = {
+        "U": {"lat": ("lat", 16), "lon": ("lon", 16)},
+        "V": {"lat": ("lat", 16), "lon": ("lon", 4)},
+    }
+    fieldset = parcels.FieldSet.from_netcdf(
+        filenames, variables, dimensions, chunksize=chs
+    )
+    pset = parcels.ParticleSet(fieldset, pclass=ptype[mode], lon=25, lat=-35)
+    pset.execute(
+        parcels.AdvectionRK4, runtime=timedelta(days=1), dt=timedelta(minutes=5)
+    )
     # GlobCurrent sample file dimensions: time=UNLIMITED, lat=41, lon=81
     npart_U = 1
     npart_U = [npart_U * k for k in fieldset.U.nchunks[1:]]
     npart_V = 1
     npart_V = [npart_V * k for k in fieldset.V.nchunks[1:]]
     npart_V_request = 1
-    chn = {'U': {'lat': int(math.ceil(41.0/chs['U']['lat'][1])),
-                 'lon': int(math.ceil(81.0/chs['U']['lon'][1]))},
-           'V': {'lat': int(math.ceil(41.0/chs['V']['lat'][1])),
-                 'lon': int(math.ceil(81.0/chs['V']['lon'][1]))}}
-    npart_V_request = [npart_V_request * chn['V'][k] for k in chn['V']]
-    assert (npart_V_request != npart_U)
-    assert (npart_V_request == npart_V)
+    chn = {
+        "U": {
+            "lat": int(math.ceil(41.0 / chs["U"]["lat"][1])),
+            "lon": int(math.ceil(81.0 / chs["U"]["lon"][1])),
+        },
+        "V": {
+            "lat": int(math.ceil(41.0 / chs["V"]["lat"][1])),
+            "lon": int(math.ceil(81.0 / chs["V"]["lon"][1])),
+        },
+    }
+    npart_V_request = [npart_V_request * chn["V"][k] for k in chn["V"]]
+    assert npart_V_request != npart_U
+    assert npart_V_request == npart_V
diff --git a/docs/examples/example_decaying_moving_eddy.py b/docs/examples/example_decaying_moving_eddy.py
index 8d75c066d..46bc10d5c 100644
--- a/docs/examples/example_decaying_moving_eddy.py
+++ b/docs/examples/example_decaying_moving_eddy.py
@@ -1,23 +1,27 @@
-from datetime import timedelta as delta
+from datetime import timedelta
 
 import numpy as np
 import pytest
 
-from parcels import AdvectionRK4, FieldSet, JITParticle, ParticleSet, ScipyParticle
+import parcels
 
-ptype = {'scipy': ScipyParticle, 'jit': JITParticle}
+ptype = {"scipy": parcels.ScipyParticle, "jit": parcels.JITParticle}
 
 # Define some constants.
-u_g = .04  # Geostrophic current
-u_0 = .3  # Initial speed in x dirrection. v_0 = 0
-gamma = 1./delta(days=2.89).total_seconds()  # Dissipitave effects due to viscousity.
-gamma_g = 1./delta(days=28.9).total_seconds()
-f = 1.e-4  # Coriolis parameter.
-start_lon = [10000.]  # Define the start longitude and latitude for the particle.
-start_lat = [10000.]
-
-
-def decaying_moving_eddy_fieldset(xdim=2, ydim=2):  # Define 2D flat, square fieldset for testing purposes.
+u_g = 0.04  # Geostrophic current
+u_0 = 0.3  # Initial speed in x dirrection. v_0 = 0
+gamma = (
+    1.0 / timedelta(days=2.89).total_seconds()
+)  # Dissipitave effects due to viscousity.
+gamma_g = 1.0 / timedelta(days=28.9).total_seconds()
+f = 1.0e-4  # Coriolis parameter.
+start_lon = [10000.0]  # Define the start longitude and latitude for the particle.
+start_lat = [10000.0]
+
+
+def decaying_moving_eddy_fieldset(
+    xdim=2, ydim=2
+):  # Define 2D flat, square fieldset for testing purposes.
     """Simulate an ocean that accelerates subject to Coriolis force
     and dissipative effects, upon which a geostrophic current is
     superimposed.
@@ -28,7 +32,7 @@ def decaying_moving_eddy_fieldset(xdim=2, ydim=2):  # Define 2D flat, square fie
     http://amsdottorato.unibo.it/1733/1/Fabbroni_Nicoletta_Tesi.pdf
     """
     depth = np.zeros(1, dtype=np.float32)
-    time = np.arange(0., 2. * 86400.+1e-5, 60.*5., dtype=np.float64)
+    time = np.arange(0.0, 2.0 * 86400.0 + 1e-5, 60.0 * 5.0, dtype=np.float64)
     lon = np.linspace(0, 20000, xdim, dtype=np.float32)
     lat = np.linspace(5000, 12000, ydim, dtype=np.float32)
 
@@ -36,46 +40,73 @@ def decaying_moving_eddy_fieldset(xdim=2, ydim=2):  # Define 2D flat, square fie
     V = np.zeros((time.size, lat.size, lon.size), dtype=np.float32)
 
     for t in range(time.size):
-        U[t, :, :] = u_g*np.exp(-gamma_g*time[t]) + (u_0-u_g)*np.exp(-gamma*time[t])*np.cos(f*time[t])
-        V[t, :, :] = -(u_0-u_g)*np.exp(-gamma*time[t])*np.sin(f*time[t])
-
-    data = {'U': U, 'V': V}
-    dimensions = {'lon': lon, 'lat': lat, 'depth': depth, 'time': time}
-    return FieldSet.from_data(data, dimensions, mesh='flat')
-
-
-def true_values(t, x_0, y_0):  # Calculate the expected values for particles at the endtime, given their start location.
-    x = x_0 + (u_g/gamma_g)*(1-np.exp(-gamma_g*t)) + f*((u_0-u_g)/(f**2 + gamma**2))*((gamma/f) + np.exp(-gamma*t)*(np.sin(f*t) - (gamma/f)*np.cos(f*t)))
-    y = y_0 - ((u_0-u_g)/(f**2+gamma**2))*f*(1 - np.exp(-gamma*t)*(np.cos(f*t) + (gamma/f)*np.sin(f*t)))
+        U[t, :, :] = u_g * np.exp(-gamma_g * time[t]) + (u_0 - u_g) * np.exp(
+            -gamma * time[t]
+        ) * np.cos(f * time[t])
+        V[t, :, :] = -(u_0 - u_g) * np.exp(-gamma * time[t]) * np.sin(f * time[t])
+
+    data = {"U": U, "V": V}
+    dimensions = {"lon": lon, "lat": lat, "depth": depth, "time": time}
+    return parcels.FieldSet.from_data(data, dimensions, mesh="flat")
+
+
+def true_values(
+    t, x_0, y_0
+):  # Calculate the expected values for particles at the endtime, given their start location.
+    x = (
+        x_0
+        + (u_g / gamma_g) * (1 - np.exp(-gamma_g * t))
+        + f
+        * ((u_0 - u_g) / (f**2 + gamma**2))
+        * (
+            (gamma / f)
+            + np.exp(-gamma * t) * (np.sin(f * t) - (gamma / f) * np.cos(f * t))
+        )
+    )
+    y = y_0 - ((u_0 - u_g) / (f**2 + gamma**2)) * f * (
+        1 - np.exp(-gamma * t) * (np.cos(f * t) + (gamma / f) * np.sin(f * t))
+    )
 
     return np.array([x, y])
 
 
-def decaying_moving_example(fieldset, outfile, mode='scipy', method=AdvectionRK4):
-    pset = ParticleSet(fieldset, pclass=ptype[mode], lon=start_lon, lat=start_lat)
+def decaying_moving_example(
+    fieldset, outfile, mode="scipy", method=parcels.AdvectionRK4
+):
+    pset = parcels.ParticleSet(
+        fieldset, pclass=ptype[mode], lon=start_lon, lat=start_lat
+    )
 
-    dt = delta(minutes=5)
-    runtime = delta(days=2)
-    outputdt = delta(hours=1)
+    dt = timedelta(minutes=5)
+    runtime = timedelta(days=2)
+    outputdt = timedelta(hours=1)
 
-    pset.execute(method, runtime=runtime, dt=dt,
-                 output_file=pset.ParticleFile(name=outfile, outputdt=outputdt))
+    pset.execute(
+        method,
+        runtime=runtime,
+        dt=dt,
+        output_file=pset.ParticleFile(name=outfile, outputdt=outputdt),
+    )
 
     return pset
 
 
-@pytest.mark.parametrize('mode', ['scipy', 'jit'])
+@pytest.mark.parametrize("mode", ["scipy", "jit"])
 def test_rotation_example(mode, tmpdir):
-    outfile = tmpdir.join('DecayingMovingParticle.zarr')
+    outfile = tmpdir.join("DecayingMovingParticle.zarr")
     fieldset = decaying_moving_eddy_fieldset()
     pset = decaying_moving_example(fieldset, outfile, mode=mode)
-    vals = true_values(pset[0].time, start_lon, start_lat)  # Calculate values for the particle.
-    assert (np.allclose(np.array([[pset[0].lon], [pset[0].lat]]), vals, 1e-2))   # Check advected values against calculated values.
+    vals = true_values(
+        pset[0].time, start_lon, start_lat
+    )  # Calculate values for the particle.
+    assert np.allclose(
+        np.array([[pset[0].lon], [pset[0].lat]]), vals, 1e-2
+    )  # Check advected values against calculated values.
 
 
 def main():
-    fset_filename = 'decaying_moving_eddy'
-    outfile = 'DecayingMovingParticle.zarr'
+    fset_filename = "decaying_moving_eddy"
+    outfile = "DecayingMovingParticle.zarr"
     fieldset = decaying_moving_eddy_fieldset()
     fieldset.write(fset_filename)
 
diff --git a/docs/examples/example_globcurrent.py b/docs/examples/example_globcurrent.py
index dfca927ef..663d0dd31 100755
--- a/docs/examples/example_globcurrent.py
+++ b/docs/examples/example_globcurrent.py
@@ -1,41 +1,54 @@
-from datetime import timedelta as delta
+from datetime import timedelta
 from glob import glob
 
 import numpy as np
 import pytest
 import xarray as xr
 
-from parcels import (
-    AdvectionRK4,
-    Field,
-    FieldSet,
-    JITParticle,
-    ParticleSet,
-    ScipyParticle,
-    TimeExtrapolationError,
-    download_example_dataset,
-)
+import parcels
 
-ptype = {'scipy': ScipyParticle, 'jit': JITParticle}
+ptype = {"scipy": parcels.ScipyParticle, "jit": parcels.JITParticle}
 
 
-def set_globcurrent_fieldset(filename=None, indices=None, deferred_load=True, use_xarray=False, time_periodic=False, timestamps=None):
+def set_globcurrent_fieldset(
+    filename=None,
+    indices=None,
+    deferred_load=True,
+    use_xarray=False,
+    time_periodic=False,
+    timestamps=None,
+):
     if filename is None:
-        data_folder = download_example_dataset("GlobCurrent_example_data")
-        filename = str(data_folder / '2002*-GLOBCURRENT-L4-CUReul_hs-ALT_SUM-v02.0-fv01.0.nc')
-    variables = {'U': 'eastward_eulerian_current_velocity', 'V': 'northward_eulerian_current_velocity'}
+        data_folder = parcels.download_example_dataset("GlobCurrent_example_data")
+        filename = str(
+            data_folder / "2002*-GLOBCURRENT-L4-CUReul_hs-ALT_SUM-v02.0-fv01.0.nc"
+        )
+    variables = {
+        "U": "eastward_eulerian_current_velocity",
+        "V": "northward_eulerian_current_velocity",
+    }
     if timestamps is None:
-        dimensions = {'lat': 'lat', 'lon': 'lon', 'time': 'time'}
+        dimensions = {"lat": "lat", "lon": "lon", "time": "time"}
     else:
-        dimensions = {'lat': 'lat', 'lon': 'lon'}
+        dimensions = {"lat": "lat", "lon": "lon"}
     if use_xarray:
-        ds = xr.open_mfdataset(filename, combine='by_coords')
-        return FieldSet.from_xarray_dataset(ds, variables, dimensions, time_periodic=time_periodic)
+        ds = xr.open_mfdataset(filename, combine="by_coords")
+        return parcels.FieldSet.from_xarray_dataset(
+            ds, variables, dimensions, time_periodic=time_periodic
+        )
     else:
-        return FieldSet.from_netcdf(filename, variables, dimensions, indices, deferred_load=deferred_load, time_periodic=time_periodic, timestamps=timestamps)
-
-
-@pytest.mark.parametrize('use_xarray', [True, False])
+        return parcels.FieldSet.from_netcdf(
+            filename,
+            variables,
+            dimensions,
+            indices,
+            deferred_load=deferred_load,
+            time_periodic=time_periodic,
+            timestamps=timestamps,
+        )
+
+
+@pytest.mark.parametrize("use_xarray", [True, False])
 def test_globcurrent_fieldset(use_xarray):
     fieldset = set_globcurrent_fieldset(use_xarray=use_xarray)
     assert fieldset.U.lon.size == 81
@@ -44,102 +57,124 @@ def test_globcurrent_fieldset(use_xarray):
     assert fieldset.V.lat.size == 41
 
     if not use_xarray:
-        indices = {'lon': [5], 'lat': range(20, 30)}
+        indices = {"lon": [5], "lat": range(20, 30)}
         fieldsetsub = set_globcurrent_fieldset(indices=indices, use_xarray=use_xarray)
-        assert np.allclose(fieldsetsub.U.lon, fieldset.U.lon[indices['lon']])
-        assert np.allclose(fieldsetsub.U.lat, fieldset.U.lat[indices['lat']])
-        assert np.allclose(fieldsetsub.V.lon, fieldset.V.lon[indices['lon']])
-        assert np.allclose(fieldsetsub.V.lat, fieldset.V.lat[indices['lat']])
+        assert np.allclose(fieldsetsub.U.lon, fieldset.U.lon[indices["lon"]])
+        assert np.allclose(fieldsetsub.U.lat, fieldset.U.lat[indices["lat"]])
+        assert np.allclose(fieldsetsub.V.lon, fieldset.V.lon[indices["lon"]])
+        assert np.allclose(fieldsetsub.V.lat, fieldset.V.lat[indices["lat"]])
 
 
-@pytest.mark.parametrize('mode', ['scipy', 'jit'])
-@pytest.mark.parametrize('dt, lonstart, latstart', [(3600., 25, -35), (-3600., 20, -39)])
-@pytest.mark.parametrize('use_xarray', [True, False])
+@pytest.mark.parametrize("mode", ["scipy", "jit"])
+@pytest.mark.parametrize(
+    "dt, lonstart, latstart", [(3600.0, 25, -35), (-3600.0, 20, -39)]
+)
+@pytest.mark.parametrize("use_xarray", [True, False])
 def test_globcurrent_fieldset_advancetime(mode, dt, lonstart, latstart, use_xarray):
-    data_folder = download_example_dataset("GlobCurrent_example_data")
-    basepath = str(data_folder / '20*-GLOBCURRENT-L4-CUReul_hs-ALT_SUM-v02.0-fv01.0.nc')
+    data_folder = parcels.download_example_dataset("GlobCurrent_example_data")
+    basepath = str(data_folder / "20*-GLOBCURRENT-L4-CUReul_hs-ALT_SUM-v02.0-fv01.0.nc")
     files = sorted(glob(str(basepath)))
 
     fieldsetsub = set_globcurrent_fieldset(files[0:10], use_xarray=use_xarray)
-    psetsub = ParticleSet.from_list(fieldset=fieldsetsub, pclass=ptype[mode], lon=[lonstart], lat=[latstart])
-
-    fieldsetall = set_globcurrent_fieldset(files[0:10], deferred_load=False, use_xarray=use_xarray)
-    psetall = ParticleSet.from_list(fieldset=fieldsetall, pclass=ptype[mode], lon=[lonstart], lat=[latstart])
+    psetsub = parcels.ParticleSet.from_list(
+        fieldset=fieldsetsub, pclass=ptype[mode], lon=[lonstart], lat=[latstart]
+    )
+
+    fieldsetall = set_globcurrent_fieldset(
+        files[0:10], deferred_load=False, use_xarray=use_xarray
+    )
+    psetall = parcels.ParticleSet.from_list(
+        fieldset=fieldsetall, pclass=ptype[mode], lon=[lonstart], lat=[latstart]
+    )
     if dt < 0:
         psetsub[0].time_nextloop = fieldsetsub.U.grid.time[-1]
         psetall[0].time_nextloop = fieldsetall.U.grid.time[-1]
 
-    psetsub.execute(AdvectionRK4, runtime=delta(days=7), dt=dt)
-    psetall.execute(AdvectionRK4, runtime=delta(days=7), dt=dt)
+    psetsub.execute(parcels.AdvectionRK4, runtime=timedelta(days=7), dt=dt)
+    psetall.execute(parcels.AdvectionRK4, runtime=timedelta(days=7), dt=dt)
 
     assert abs(psetsub[0].lon - psetall[0].lon) < 1e-4
 
 
-@pytest.mark.parametrize('mode', ['scipy', 'jit'])
-@pytest.mark.parametrize('use_xarray', [True, False])
+@pytest.mark.parametrize("mode", ["scipy", "jit"])
+@pytest.mark.parametrize("use_xarray", [True, False])
 def test_globcurrent_particles(mode, use_xarray):
     fieldset = set_globcurrent_fieldset(use_xarray=use_xarray)
 
     lonstart = [25]
     latstart = [-35]
 
-    pset = ParticleSet(fieldset, pclass=ptype[mode], lon=lonstart, lat=latstart)
+    pset = parcels.ParticleSet(fieldset, pclass=ptype[mode], lon=lonstart, lat=latstart)
 
-    pset.execute(AdvectionRK4, runtime=delta(days=1), dt=delta(minutes=5))
+    pset.execute(
+        parcels.AdvectionRK4, runtime=timedelta(days=1), dt=timedelta(minutes=5)
+    )
 
     assert abs(pset[0].lon - 23.8) < 1
     assert abs(pset[0].lat - -35.3) < 1
 
 
-@pytest.mark.parametrize('mode', ['scipy', 'jit'])
-@pytest.mark.parametrize('rundays', [300, 900])
+@pytest.mark.parametrize("mode", ["scipy", "jit"])
+@pytest.mark.parametrize("rundays", [300, 900])
 def test_globcurrent_time_periodic(mode, rundays):
     sample_var = []
     for deferred_load in [True, False]:
-        fieldset = set_globcurrent_fieldset(time_periodic=delta(days=365), deferred_load=deferred_load)
+        fieldset = set_globcurrent_fieldset(
+            time_periodic=timedelta(days=365), deferred_load=deferred_load
+        )
 
-        MyParticle = ptype[mode].add_variable('sample_var', initial=0.)
+        MyParticle = ptype[mode].add_variable("sample_var", initial=0.0)
 
-        pset = ParticleSet(fieldset, pclass=MyParticle, lon=25, lat=-35, time=fieldset.U.grid.time[0])
+        pset = parcels.ParticleSet(
+            fieldset, pclass=MyParticle, lon=25, lat=-35, time=fieldset.U.grid.time[0]
+        )
 
         def SampleU(particle, fieldset, time):
             u, v = fieldset.UV[time, particle.depth, particle.lat, particle.lon]
             particle.sample_var += u
 
-        pset.execute(SampleU, runtime=delta(days=rundays), dt=delta(days=1))
+        pset.execute(SampleU, runtime=timedelta(days=rundays), dt=timedelta(days=1))
         sample_var.append(pset[0].sample_var)
 
     assert np.allclose(sample_var[0], sample_var[1])
 
 
-@pytest.mark.parametrize('dt', [-300, 300])
+@pytest.mark.parametrize("dt", [-300, 300])
 def test_globcurrent_xarray_vs_netcdf(dt):
     fieldsetNetcdf = set_globcurrent_fieldset(use_xarray=False)
     fieldsetxarray = set_globcurrent_fieldset(use_xarray=True)
-    lonstart, latstart, runtime = (25, -35, delta(days=7))
+    lonstart, latstart, runtime = (25, -35, timedelta(days=7))
 
-    psetN = ParticleSet(fieldsetNetcdf, pclass=JITParticle, lon=lonstart, lat=latstart)
-    psetN.execute(AdvectionRK4, runtime=runtime, dt=dt)
+    psetN = parcels.ParticleSet(
+        fieldsetNetcdf, pclass=parcels.JITParticle, lon=lonstart, lat=latstart
+    )
+    psetN.execute(parcels.AdvectionRK4, runtime=runtime, dt=dt)
 
-    psetX = ParticleSet(fieldsetxarray, pclass=JITParticle, lon=lonstart, lat=latstart)
-    psetX.execute(AdvectionRK4, runtime=runtime, dt=dt)
+    psetX = parcels.ParticleSet(
+        fieldsetxarray, pclass=parcels.JITParticle, lon=lonstart, lat=latstart
+    )
+    psetX.execute(parcels.AdvectionRK4, runtime=runtime, dt=dt)
 
     assert np.allclose(psetN[0].lon, psetX[0].lon)
     assert np.allclose(psetN[0].lat, psetX[0].lat)
 
 
-@pytest.mark.parametrize('dt', [-300, 300])
+@pytest.mark.parametrize("dt", [-300, 300])
 def test_globcurrent_netcdf_timestamps(dt):
     fieldsetNetcdf = set_globcurrent_fieldset()
     timestamps = fieldsetNetcdf.U.grid.timeslices
     fieldsetTimestamps = set_globcurrent_fieldset(timestamps=timestamps)
-    lonstart, latstart, runtime = (25, -35, delta(days=7))
+    lonstart, latstart, runtime = (25, -35, timedelta(days=7))
 
-    psetN = ParticleSet(fieldsetNetcdf, pclass=JITParticle, lon=lonstart, lat=latstart)
-    psetN.execute(AdvectionRK4, runtime=runtime, dt=dt)
+    psetN = parcels.ParticleSet(
+        fieldsetNetcdf, pclass=parcels.JITParticle, lon=lonstart, lat=latstart
+    )
+    psetN.execute(parcels.AdvectionRK4, runtime=runtime, dt=dt)
 
-    psetT = ParticleSet(fieldsetTimestamps, pclass=JITParticle, lon=lonstart, lat=latstart)
-    psetT.execute(AdvectionRK4, runtime=runtime, dt=dt)
+    psetT = parcels.ParticleSet(
+        fieldsetTimestamps, pclass=parcels.JITParticle, lon=lonstart, lat=latstart
+    )
+    psetT.execute(parcels.AdvectionRK4, runtime=runtime, dt=dt)
 
     assert np.allclose(psetN.lon[0], psetT.lon[0])
     assert np.allclose(psetN.lat[0], psetT.lat[0])
@@ -152,57 +187,105 @@ def test__particles_init_time():
     latstart = [-35]
 
     # tests the different ways of initialising the time of a particle
-    pset = ParticleSet(fieldset, pclass=JITParticle, lon=lonstart, lat=latstart, time=np.datetime64('2002-01-15'))
-    pset2 = ParticleSet(fieldset, pclass=JITParticle, lon=lonstart, lat=latstart, time=14*86400)
-    pset3 = ParticleSet(fieldset, pclass=JITParticle, lon=lonstart, lat=latstart, time=np.array([np.datetime64('2002-01-15')]))
-    pset4 = ParticleSet(fieldset, pclass=JITParticle, lon=lonstart, lat=latstart, time=[np.datetime64('2002-01-15')])
+    pset = parcels.ParticleSet(
+        fieldset,
+        pclass=parcels.JITParticle,
+        lon=lonstart,
+        lat=latstart,
+        time=np.datetime64("2002-01-15"),
+    )
+    pset2 = parcels.ParticleSet(
+        fieldset,
+        pclass=parcels.JITParticle,
+        lon=lonstart,
+        lat=latstart,
+        time=14 * 86400,
+    )
+    pset3 = parcels.ParticleSet(
+        fieldset,
+        pclass=parcels.JITParticle,
+        lon=lonstart,
+        lat=latstart,
+        time=np.array([np.datetime64("2002-01-15")]),
+    )
+    pset4 = parcels.ParticleSet(
+        fieldset,
+        pclass=parcels.JITParticle,
+        lon=lonstart,
+        lat=latstart,
+        time=[np.datetime64("2002-01-15")],
+    )
     assert pset[0].time - pset2[0].time == 0
     assert pset[0].time - pset3[0].time == 0
     assert pset[0].time - pset4[0].time == 0
 
 
 @pytest.mark.xfail(reason="Time extrapolation error expected to be thrown", strict=True)
-@pytest.mark.parametrize('mode', ['scipy', 'jit'])
-@pytest.mark.parametrize('use_xarray', [True, False])
+@pytest.mark.parametrize("mode", ["scipy", "jit"])
+@pytest.mark.parametrize("use_xarray", [True, False])
 def test_globcurrent_time_extrapolation_error(mode, use_xarray):
     fieldset = set_globcurrent_fieldset(use_xarray=use_xarray)
 
-    pset = ParticleSet(fieldset, pclass=ptype[mode], lon=[25], lat=[-35],
-                       time=fieldset.U.time[0]-delta(days=1).total_seconds())
+    pset = parcels.ParticleSet(
+        fieldset,
+        pclass=ptype[mode],
+        lon=[25],
+        lat=[-35],
+        time=fieldset.U.time[0] - timedelta(days=1).total_seconds(),
+    )
 
-    pset.execute(AdvectionRK4, runtime=delta(days=1), dt=delta(minutes=5))
+    pset.execute(
+        parcels.AdvectionRK4, runtime=timedelta(days=1), dt=timedelta(minutes=5)
+    )
 
 
-@pytest.mark.parametrize('mode', ['scipy', 'jit'])
-@pytest.mark.parametrize('dt', [-300, 300])
-@pytest.mark.parametrize('with_starttime', [True, False])
+@pytest.mark.parametrize("mode", ["scipy", "jit"])
+@pytest.mark.parametrize("dt", [-300, 300])
+@pytest.mark.parametrize("with_starttime", [True, False])
 def test_globcurrent_startparticles_between_time_arrays(mode, dt, with_starttime):
     fieldset = set_globcurrent_fieldset()
 
-    data_folder = download_example_dataset("GlobCurrent_example_data")
+    data_folder = parcels.download_example_dataset("GlobCurrent_example_data")
     fnamesFeb = sorted(glob(f"{data_folder}/200202*.nc"))
-    fieldset.add_field(Field.from_netcdf(fnamesFeb, ('P', 'eastward_eulerian_current_velocity'),
-                                         {'lat': 'lat', 'lon': 'lon', 'time': 'time'}))
+    fieldset.add_field(
+        parcels.Field.from_netcdf(
+            fnamesFeb,
+            ("P", "eastward_eulerian_current_velocity"),
+            {"lat": "lat", "lon": "lon", "time": "time"},
+        )
+    )
 
-    MyParticle = ptype[mode].add_variable('sample_var', initial=0.)
+    MyParticle = ptype[mode].add_variable("sample_var", initial=0.0)
 
     def SampleP(particle, fieldset, time):
-        particle.sample_var += fieldset.P[time, particle.depth, particle.lat, particle.lon]
+        particle.sample_var += fieldset.P[
+            time, particle.depth, particle.lat, particle.lon
+        ]
 
     if with_starttime:
         time = fieldset.U.grid.time[0] if dt > 0 else fieldset.U.grid.time[-1]
-        pset = ParticleSet(fieldset, pclass=MyParticle, lon=[25], lat=[-35], time=time)
+        pset = parcels.ParticleSet(
+            fieldset, pclass=MyParticle, lon=[25], lat=[-35], time=time
+        )
     else:
-        pset = ParticleSet(fieldset, pclass=MyParticle, lon=[25], lat=[-35])
+        pset = parcels.ParticleSet(fieldset, pclass=MyParticle, lon=[25], lat=[-35])
 
     if with_starttime:
-        with pytest.raises(TimeExtrapolationError):
-            pset.execute(pset.Kernel(AdvectionRK4)+SampleP, runtime=delta(days=1), dt=dt)
+        with pytest.raises(parcels.TimeExtrapolationError):
+            pset.execute(
+                pset.Kernel(parcels.AdvectionRK4) + SampleP,
+                runtime=timedelta(days=1),
+                dt=dt,
+            )
     else:
-        pset.execute(pset.Kernel(AdvectionRK4) + SampleP, runtime=delta(days=1), dt=dt)
+        pset.execute(
+            pset.Kernel(parcels.AdvectionRK4) + SampleP,
+            runtime=timedelta(days=1),
+            dt=dt,
+        )
 
 
-@pytest.mark.parametrize('mode', ['scipy', 'jit'])
+@pytest.mark.parametrize("mode", ["scipy", "jit"])
 def test_globcurrent_particle_independence(mode, rundays=5):
     fieldset = set_globcurrent_fieldset()
     time0 = fieldset.U.grid.time[0]
@@ -211,50 +294,56 @@ def DeleteP0(particle, fieldset, time):
         if particle.id == 0:
             particle.delete()
 
-    pset0 = ParticleSet(fieldset, pclass=ptype[mode],
-                        lon=[25, 25],
-                        lat=[-35, -35],
-                        time=time0)
+    pset0 = parcels.ParticleSet(
+        fieldset, pclass=ptype[mode], lon=[25, 25], lat=[-35, -35], time=time0
+    )
 
-    pset0.execute(pset0.Kernel(DeleteP0)+AdvectionRK4,
-                  runtime=delta(days=rundays),
-                  dt=delta(minutes=5))
+    pset0.execute(
+        pset0.Kernel(DeleteP0) + parcels.AdvectionRK4,
+        runtime=timedelta(days=rundays),
+        dt=timedelta(minutes=5),
+    )
 
-    pset1 = ParticleSet(fieldset, pclass=ptype[mode],
-                        lon=[25, 25],
-                        lat=[-35, -35],
-                        time=time0)
+    pset1 = parcels.ParticleSet(
+        fieldset, pclass=ptype[mode], lon=[25, 25], lat=[-35, -35], time=time0
+    )
 
-    pset1.execute(AdvectionRK4,
-                  runtime=delta(days=rundays),
-                  dt=delta(minutes=5))
+    pset1.execute(
+        parcels.AdvectionRK4, runtime=timedelta(days=rundays), dt=timedelta(minutes=5)
+    )
 
     assert np.allclose([pset0[-1].lon, pset0[-1].lat], [pset1[-1].lon, pset1[-1].lat])
 
 
-@pytest.mark.parametrize('mode', ['scipy', 'jit'])
-@pytest.mark.parametrize('dt', [-300, 300])
-@pytest.mark.parametrize('pid_offset', [0, 20])
+@pytest.mark.parametrize("mode", ["scipy", "jit"])
+@pytest.mark.parametrize("dt", [-300, 300])
+@pytest.mark.parametrize("pid_offset", [0, 20])
 def test_globcurrent_pset_fromfile(mode, dt, pid_offset, tmpdir):
     filename = tmpdir.join("pset_fromparticlefile.zarr")
     fieldset = set_globcurrent_fieldset()
 
     ptype[mode].setLastID(pid_offset)
-    pset = ParticleSet(fieldset, pclass=ptype[mode], lon=25, lat=-35)
-    pfile = pset.ParticleFile(filename, outputdt=delta(hours=6))
-    pset.execute(AdvectionRK4, runtime=delta(days=1), dt=dt, output_file=pfile)
+    pset = parcels.ParticleSet(fieldset, pclass=ptype[mode], lon=25, lat=-35)
+    pfile = pset.ParticleFile(filename, outputdt=timedelta(hours=6))
+    pset.execute(
+        parcels.AdvectionRK4, runtime=timedelta(days=1), dt=dt, output_file=pfile
+    )
     pfile.write_latest_locations(pset, max(pset.time_nextloop))
 
     restarttime = np.nanmax if dt > 0 else np.nanmin
-    pset_new = ParticleSet.from_particlefile(fieldset, pclass=ptype[mode], filename=filename, restarttime=restarttime)
-    pset.execute(AdvectionRK4, runtime=delta(days=1), dt=dt)
-    pset_new.execute(AdvectionRK4, runtime=delta(days=1), dt=dt)
+    pset_new = parcels.ParticleSet.from_particlefile(
+        fieldset, pclass=ptype[mode], filename=filename, restarttime=restarttime
+    )
+    pset.execute(parcels.AdvectionRK4, runtime=timedelta(days=1), dt=dt)
+    pset_new.execute(parcels.AdvectionRK4, runtime=timedelta(days=1), dt=dt)
 
-    for var in ['lon', 'lat', 'depth', 'time', 'id']:
-        assert np.allclose([getattr(p, var) for p in pset], [getattr(p, var) for p in pset_new])
+    for var in ["lon", "lat", "depth", "time", "id"]:
+        assert np.allclose(
+            [getattr(p, var) for p in pset], [getattr(p, var) for p in pset_new]
+        )
 
 
-@pytest.mark.parametrize('mode', ['scipy', 'jit'])
+@pytest.mark.parametrize("mode", ["scipy", "jit"])
 def test_error_outputdt_not_multiple_dt(mode, tmpdir):
     # Test that outputdt is a multiple of dt
     fieldset = set_globcurrent_fieldset()
@@ -263,11 +352,11 @@ def test_error_outputdt_not_multiple_dt(mode, tmpdir):
 
     dt = 81.2584344538292  # number for which output writing fails
 
-    pset = ParticleSet(fieldset, pclass=ptype[mode], lon=[0], lat=[0])
-    ofile = pset.ParticleFile(name=filepath, outputdt=delta(days=1))
+    pset = parcels.ParticleSet(fieldset, pclass=ptype[mode], lon=[0], lat=[0])
+    ofile = pset.ParticleFile(name=filepath, outputdt=timedelta(days=1))
 
     def DoNothing(particle, fieldset, time):
         pass
 
     with pytest.raises(ValueError):
-        pset.execute(DoNothing, runtime=delta(days=10), dt=dt, output_file=ofile)
+        pset.execute(DoNothing, runtime=timedelta(days=10), dt=dt, output_file=ofile)
diff --git a/docs/examples/example_mitgcm.py b/docs/examples/example_mitgcm.py
index f4f86d471..dcc52781a 100644
--- a/docs/examples/example_mitgcm.py
+++ b/docs/examples/example_mitgcm.py
@@ -1,24 +1,16 @@
-from datetime import timedelta as delta
+from datetime import timedelta
 
 import numpy as np
 import xarray as xr
 
-from parcels import (
-    AdvectionRK4,
-    FieldSet,
-    JITParticle,
-    ParticleFile,
-    ParticleSet,
-    ScipyParticle,
-    download_example_dataset,
-)
+import parcels
 
-ptype = {"scipy": ScipyParticle, "jit": JITParticle}
+ptype = {"scipy": parcels.ScipyParticle, "jit": parcels.JITParticle}
 
 
 def run_mitgcm_zonally_reentrant(mode):
     """Function that shows how to load MITgcm data in a zonally periodic domain."""
-    data_folder = download_example_dataset("MITgcm_example_data")
+    data_folder = parcels.download_example_dataset("MITgcm_example_data")
     filenames = {
         "U": f"{data_folder}/mitgcm_UV_surface_zonally_reentrant.nc",
         "V": f"{data_folder}/mitgcm_UV_surface_zonally_reentrant.nc",
@@ -28,10 +20,12 @@ def run_mitgcm_zonally_reentrant(mode):
         "U": {"lon": "XG", "lat": "YG", "time": "time"},
         "V": {"lon": "XG", "lat": "YG", "time": "time"},
     }
-    fieldset = FieldSet.from_mitgcm(filenames, variables, dimensions, mesh="flat")
+    fieldset = parcels.FieldSet.from_mitgcm(
+        filenames, variables, dimensions, mesh="flat"
+    )
 
     fieldset.add_periodic_halo(zonal=True)
-    fieldset.add_constant('domain_width', 1000000)
+    fieldset.add_constant("domain_width", 1000000)
 
     def periodicBC(particle, fieldset, time):
         if particle.lon < 0:
@@ -40,19 +34,22 @@ def periodicBC(particle, fieldset, time):
             particle_dlon -= fieldset.domain_width  # noqa
 
     # Release particles 5 cells away from the Eastern boundary
-    pset = ParticleSet.from_line(
+    pset = parcels.ParticleSet.from_line(
         fieldset,
         pclass=ptype[mode],
         start=(fieldset.U.grid.lon[-5], fieldset.U.grid.lat[5]),
         finish=(fieldset.U.grid.lon[-5], fieldset.U.grid.lat[-5]),
         size=10,
     )
-    pfile = ParticleFile(
-        "MIT_particles_" + str(mode) + ".zarr", pset, outputdt=delta(days=1), chunks=(len(pset), 1)
+    pfile = parcels.ParticleFile(
+        "MIT_particles_" + str(mode) + ".zarr",
+        pset,
+        outputdt=timedelta(days=1),
+        chunks=(len(pset), 1),
     )
-    kernels = AdvectionRK4 + pset.Kernel(periodicBC)
+    kernels = parcels.AdvectionRK4 + pset.Kernel(periodicBC)
     pset.execute(
-        kernels, runtime=delta(days=5), dt=delta(minutes=30), output_file=pfile
+        kernels, runtime=timedelta(days=5), dt=timedelta(minutes=30), output_file=pfile
     )
 
 
diff --git a/docs/examples/example_moving_eddies.py b/docs/examples/example_moving_eddies.py
index 25fafa950..21b5fd211 100644
--- a/docs/examples/example_moving_eddies.py
+++ b/docs/examples/example_moving_eddies.py
@@ -1,27 +1,22 @@
 import gc
 import math
 from argparse import ArgumentParser
-from datetime import timedelta as delta
+from datetime import timedelta
 
 import numpy as np
 import pytest
 
-from parcels import (
-    AdvectionEE,
-    AdvectionRK4,
-    AdvectionRK45,
-    FieldSet,
-    JITParticle,
-    ParticleSet,
-    ScipyParticle,
-    download_example_dataset,
-)
+import parcels
 
-ptype = {'scipy': ScipyParticle, 'jit': JITParticle}
-method = {'RK4': AdvectionRK4, 'EE': AdvectionEE, 'RK45': AdvectionRK45}
+ptype = {"scipy": parcels.ScipyParticle, "jit": parcels.JITParticle}
+method = {
+    "RK4": parcels.AdvectionRK4,
+    "EE": parcels.AdvectionEE,
+    "RK45": parcels.AdvectionRK45,
+}
 
 
-def moving_eddies_fieldset(xdim=200, ydim=350, mesh='flat'):
+def moving_eddies_fieldset(xdim=200, ydim=350, mesh="flat"):
     """Generate a fieldset encapsulating the flow field consisting of two
     moving eddies, one moving westward and the other moving northwestward.
 
@@ -49,21 +44,26 @@ def moving_eddies_fieldset(xdim=200, ydim=350, mesh='flat'):
 
     """
     # Set Parcels FieldSet variables
-    time = np.arange(0., 8. * 86400., 86400., dtype=np.float64)
+    time = np.arange(0.0, 8.0 * 86400.0, 86400.0, dtype=np.float64)
 
     # Coordinates of the test fieldset (on A-grid in m)
-    if mesh == 'spherical':
+    if mesh == "spherical":
         lon = np.linspace(0, 4, xdim, dtype=np.float32)
         lat = np.linspace(45, 52, ydim, dtype=np.float32)
     else:
-        lon = np.linspace(0, 4.e5, xdim, dtype=np.float32)
-        lat = np.linspace(0, 7.e5, ydim, dtype=np.float32)
+        lon = np.linspace(0, 4.0e5, xdim, dtype=np.float32)
+        lat = np.linspace(0, 7.0e5, ydim, dtype=np.float32)
 
     # Grid spacing in m
     def cosd(x):
         return math.cos(math.radians(float(x)))
-    dx = (lon[1] - lon[0]) * 1852 * 60 * cosd(lat.mean()) if mesh == 'spherical' else lon[1] - lon[0]
-    dy = (lat[1] - lat[0]) * 1852 * 60 if mesh == 'spherical' else lat[1] - lat[0]
+
+    dx = (
+        (lon[1] - lon[0]) * 1852 * 60 * cosd(lat.mean())
+        if mesh == "spherical"
+        else lon[1] - lon[0]
+    )
+    dy = (lat[1] - lat[0]) * 1852 * 60 if mesh == "spherical" else lat[1] - lat[0]
 
     # Define arrays U (zonal), V (meridional), and P (sea surface height) on A-grid
     U = np.zeros((lon.size, lat.size, time.size), dtype=np.float32)
@@ -71,7 +71,7 @@ def cosd(x):
     P = np.zeros((lon.size, lat.size, time.size), dtype=np.float32)
 
     # Some constants
-    corio_0 = 1.e-4  # Coriolis parameter
+    corio_0 = 1.0e-4  # Coriolis parameter
     h0 = 1  # Max eddy height
     sig = 0.5  # Eddy e-folding decay scale (in degrees)
     g = 10  # Gravitational constant
@@ -79,15 +79,21 @@ def cosd(x):
     dX = eddyspeed * 86400 / dx  # Grid cell movement of eddy max each day
     dY = eddyspeed * 86400 / dy  # Grid cell movement of eddy max each day
 
-    [x, y] = np.mgrid[:lon.size, :lat.size]
+    [x, y] = np.mgrid[: lon.size, : lat.size]
     for t in range(time.size):
-        hymax_1 = lat.size / 7.
-        hxmax_1 = .75 * lon.size - dX * t
-        hymax_2 = 3. * lat.size / 7. + dY * t
-        hxmax_2 = .75 * lon.size - dX * t
-
-        P[:, :, t] = h0 * np.exp(-(x-hxmax_1)**2/(sig*lon.size/4.)**2-(y-hymax_1)**2/(sig*lat.size/7.)**2)
-        P[:, :, t] += h0 * np.exp(-(x-hxmax_2)**2/(sig*lon.size/4.)**2-(y-hymax_2)**2/(sig*lat.size/7.)**2)
+        hymax_1 = lat.size / 7.0
+        hxmax_1 = 0.75 * lon.size - dX * t
+        hymax_2 = 3.0 * lat.size / 7.0 + dY * t
+        hxmax_2 = 0.75 * lon.size - dX * t
+
+        P[:, :, t] = h0 * np.exp(
+            -((x - hxmax_1) ** 2) / (sig * lon.size / 4.0) ** 2
+            - (y - hymax_1) ** 2 / (sig * lat.size / 7.0) ** 2
+        )
+        P[:, :, t] += h0 * np.exp(
+            -((x - hxmax_2) ** 2) / (sig * lon.size / 4.0) ** 2
+            - (y - hymax_2) ** 2 / (sig * lat.size / 7.0) ** 2
+        )
 
         V[:-1, :, t] = -np.diff(P[:, :, t], axis=0) / dx / corio_0 * g
         V[-1, :, t] = V[-2, :, t]  # Fill in the last column
@@ -95,10 +101,10 @@ def cosd(x):
         U[:, :-1, t] = np.diff(P[:, :, t], axis=1) / dy / corio_0 * g
         U[:, -1, t] = U[:, -2, t]  # Fill in the last row
 
-    data = {'U': U, 'V': V, 'P': P}
-    dimensions = {'lon': lon, 'lat': lat, 'time': time}
+    data = {"U": U, "V": V, "P": P}
+    dimensions = {"lon": lon, "lat": lat, "time": time}
 
-    fieldset = FieldSet.from_data(data, dimensions, transpose=True, mesh=mesh)
+    fieldset = parcels.FieldSet.from_data(data, dimensions, transpose=True, mesh=mesh)
 
     # setting some constants for AdvectionRK45 kernel
     fieldset.RK45_min_dt = 1e-3
@@ -107,8 +113,9 @@ def cosd(x):
     return fieldset
 
 
-def moving_eddies_example(fieldset, outfile, npart=2, mode='jit', verbose=False,
-                          method=AdvectionRK4):
+def moving_eddies_example(
+    fieldset, outfile, npart=2, mode="jit", verbose=False, method=parcels.AdvectionRK4
+):
     """Configuration of a particle set that follows two moving eddies.
 
 
@@ -128,19 +135,24 @@ def moving_eddies_example(fieldset, outfile, npart=2, mode='jit', verbose=False,
          (Default value = AdvectionRK4)
     """
     # Determine particle class according to mode
-    start = (3.3, 46.) if fieldset.U.grid.mesh == 'spherical' else (3.3e5, 1e5)
-    finish = (3.3, 47.8) if fieldset.U.grid.mesh == 'spherical' else (3.3e5, 2.8e5)
-    pset = ParticleSet.from_line(fieldset=fieldset, size=npart, pclass=ptype[mode],
-                                 start=start, finish=finish)
+    start = (3.3, 46.0) if fieldset.U.grid.mesh == "spherical" else (3.3e5, 1e5)
+    finish = (3.3, 47.8) if fieldset.U.grid.mesh == "spherical" else (3.3e5, 2.8e5)
+    pset = parcels.ParticleSet.from_line(
+        fieldset=fieldset, size=npart, pclass=ptype[mode], start=start, finish=finish
+    )
 
     if verbose:
         print(f"Initial particle positions:\n{pset}")
 
     # Execute for 1 week, with 1 hour timesteps and hourly output
-    runtime = delta(days=7)
+    runtime = timedelta(days=7)
     print("MovingEddies: Advecting %d particles for %s" % (npart, str(runtime)))
-    pset.execute(method, runtime=runtime, dt=delta(hours=1),
-                 output_file=pset.ParticleFile(name=outfile, outputdt=delta(hours=1)))
+    pset.execute(
+        method,
+        runtime=runtime,
+        dt=timedelta(hours=1),
+        output_file=pset.ParticleFile(name=outfile, outputdt=timedelta(hours=1)),
+    )
 
     if verbose:
         print(f"Final particle positions:\n{pset}")
@@ -148,97 +160,114 @@ def moving_eddies_example(fieldset, outfile, npart=2, mode='jit', verbose=False,
     return pset
 
 
-@pytest.mark.parametrize('mode', ['scipy', 'jit'])
-@pytest.mark.parametrize('mesh', ['flat', 'spherical'])
+@pytest.mark.parametrize("mode", ["scipy", "jit"])
+@pytest.mark.parametrize("mesh", ["flat", "spherical"])
 def test_moving_eddies_fwdbwd(mode, mesh, tmpdir, npart=2):
-    method = AdvectionRK4
+    method = parcels.AdvectionRK4
     fieldset = moving_eddies_fieldset(mesh=mesh)
 
     # Determine particle class according to mode
-    lons = [3.3, 3.3] if fieldset.U.grid.mesh == 'spherical' else [3.3e5, 3.3e5]
-    lats = [46., 47.8] if fieldset.U.grid.mesh == 'spherical' else [1e5, 2.8e5]
-    pset = ParticleSet(fieldset=fieldset, pclass=ptype[mode], lon=lons, lat=lats)
+    lons = [3.3, 3.3] if fieldset.U.grid.mesh == "spherical" else [3.3e5, 3.3e5]
+    lats = [46.0, 47.8] if fieldset.U.grid.mesh == "spherical" else [1e5, 2.8e5]
+    pset = parcels.ParticleSet(
+        fieldset=fieldset, pclass=ptype[mode], lon=lons, lat=lats
+    )
 
     # Execte for 14 days, with 30sec timesteps and hourly output
-    runtime = delta(days=1)
-    dt = delta(minutes=5)
-    outputdt = delta(hours=1)
+    runtime = timedelta(days=1)
+    dt = timedelta(minutes=5)
+    outputdt = timedelta(hours=1)
     print("MovingEddies: Advecting %d particles for %s" % (npart, str(runtime)))
     outfile = tmpdir.join("EddyParticlefwd")
-    pset.execute(method, runtime=runtime, dt=dt,
-                 output_file=pset.ParticleFile(name=outfile, outputdt=outputdt))
+    pset.execute(
+        method,
+        runtime=runtime,
+        dt=dt,
+        output_file=pset.ParticleFile(name=outfile, outputdt=outputdt),
+    )
 
     print("Now running in backward time mode")
     outfile = tmpdir.join("EddyParticlebwd")
-    pset.execute(method, endtime=0, dt=-dt,
-                 output_file=pset.ParticleFile(name=outfile, outputdt=outputdt))
+    pset.execute(
+        method,
+        endtime=0,
+        dt=-dt,
+        output_file=pset.ParticleFile(name=outfile, outputdt=outputdt),
+    )
 
     # Also include last timestep
-    for var in ['lon', 'lat', 'depth', 'time']:
-        pset.particledata.setallvardata(f"{var}", pset.particledata.getvardata(f"{var}_nextloop"))
+    for var in ["lon", "lat", "depth", "time"]:
+        pset.particledata.setallvardata(
+            f"{var}", pset.particledata.getvardata(f"{var}_nextloop")
+        )
 
     assert np.allclose(pset.lon, lons)
     assert np.allclose(pset.lat, lats)
 
 
-@pytest.mark.parametrize('mode', ['scipy', 'jit'])
-@pytest.mark.parametrize('mesh', ['flat', 'spherical'])
+@pytest.mark.parametrize("mode", ["scipy", "jit"])
+@pytest.mark.parametrize("mesh", ["flat", "spherical"])
 def test_moving_eddies_fieldset(mode, mesh, tmpdir):
     fieldset = moving_eddies_fieldset(mesh=mesh)
     outfile = tmpdir.join("EddyParticle")
     pset = moving_eddies_example(fieldset, outfile, 2, mode=mode)
     # Also include last timestep
-    for var in ['lon', 'lat', 'depth', 'time']:
-        pset.particledata.setallvardata(f"{var}", pset.particledata.getvardata(f"{var}_nextloop"))
-    if mesh == 'flat':
-        assert (pset[0].lon < 2.2e5 and 1.1e5 < pset[0].lat < 1.2e5)
-        assert (pset[1].lon < 2.2e5 and 3.7e5 < pset[1].lat < 3.8e5)
+    for var in ["lon", "lat", "depth", "time"]:
+        pset.particledata.setallvardata(
+            f"{var}", pset.particledata.getvardata(f"{var}_nextloop")
+        )
+    if mesh == "flat":
+        assert pset[0].lon < 2.2e5 and 1.1e5 < pset[0].lat < 1.2e5
+        assert pset[1].lon < 2.2e5 and 3.7e5 < pset[1].lat < 3.8e5
     else:
-        assert (pset[0].lon < 2.0 and 46.2 < pset[0].lat < 46.25)
-        assert (pset[1].lon < 2.0 and 48.8 < pset[1].lat < 48.85)
+        assert pset[0].lon < 2.0 and 46.2 < pset[0].lat < 46.25
+        assert pset[1].lon < 2.0 and 48.8 < pset[1].lat < 48.85
 
 
 def fieldsetfile(mesh, tmpdir):
     """Generate fieldset files for moving_eddies test."""
-    filename = tmpdir.join('moving_eddies')
+    filename = tmpdir.join("moving_eddies")
     fieldset = moving_eddies_fieldset(200, 350, mesh=mesh)
     fieldset.write(filename)
     return filename
 
 
-@pytest.mark.parametrize('mode', ['scipy', 'jit'])
-@pytest.mark.parametrize('mesh', ['flat', 'spherical'])
+@pytest.mark.parametrize("mode", ["scipy", "jit"])
+@pytest.mark.parametrize("mesh", ["flat", "spherical"])
 def test_moving_eddies_file(mode, mesh, tmpdir):
     gc.collect()
-    fieldset = FieldSet.from_parcels(fieldsetfile(mesh, tmpdir), extra_fields={'P': 'P'})
+    fieldset = parcels.FieldSet.from_parcels(
+        fieldsetfile(mesh, tmpdir), extra_fields={"P": "P"}
+    )
     outfile = tmpdir.join("EddyParticle")
     pset = moving_eddies_example(fieldset, outfile, 2, mode=mode)
     # Also include last timestep
-    for var in ['lon', 'lat', 'depth', 'time']:
-        pset.particledata.setallvardata(f"{var}", pset.particledata.getvardata(f"{var}_nextloop"))
-    if mesh == 'flat':
-        assert (pset[0].lon < 2.2e5 and 1.1e5 < pset[0].lat < 1.2e5)
-        assert (pset[1].lon < 2.2e5 and 3.7e5 < pset[1].lat < 3.8e5)
+    for var in ["lon", "lat", "depth", "time"]:
+        pset.particledata.setallvardata(
+            f"{var}", pset.particledata.getvardata(f"{var}_nextloop")
+        )
+    if mesh == "flat":
+        assert pset[0].lon < 2.2e5 and 1.1e5 < pset[0].lat < 1.2e5
+        assert pset[1].lon < 2.2e5 and 3.7e5 < pset[1].lat < 3.8e5
     else:
-        assert (pset[0].lon < 2.0 and 46.2 < pset[0].lat < 46.25)
-        assert (pset[1].lon < 2.0 and 48.8 < pset[1].lat < 48.85)
+        assert pset[0].lon < 2.0 and 46.2 < pset[0].lat < 46.25
+        assert pset[1].lon < 2.0 and 48.8 < pset[1].lat < 48.85
 
 
-@pytest.mark.parametrize('mode', ['scipy', 'jit'])
+@pytest.mark.parametrize("mode", ["scipy", "jit"])
 def test_periodic_and_computeTimeChunk_eddies(mode):
-    data_folder = download_example_dataset("MovingEddies_data")
+    data_folder = parcels.download_example_dataset("MovingEddies_data")
     filename = str(data_folder / "moving_eddies")
 
-    fieldset = FieldSet.from_parcels(filename)
-    fieldset.add_constant('halo_west', fieldset.U.grid.lon[0])
-    fieldset.add_constant('halo_east', fieldset.U.grid.lon[-1])
-    fieldset.add_constant('halo_south', fieldset.U.grid.lat[0])
-    fieldset.add_constant('halo_north', fieldset.U.grid.lat[-1])
+    fieldset = parcels.FieldSet.from_parcels(filename)
+    fieldset.add_constant("halo_west", fieldset.U.grid.lon[0])
+    fieldset.add_constant("halo_east", fieldset.U.grid.lon[-1])
+    fieldset.add_constant("halo_south", fieldset.U.grid.lat[0])
+    fieldset.add_constant("halo_north", fieldset.U.grid.lat[-1])
     fieldset.add_periodic_halo(zonal=True, meridional=True)
-    pset = ParticleSet.from_list(fieldset=fieldset,
-                                 pclass=ptype[mode],
-                                 lon=[3.3, 3.3],
-                                 lat=[46.0, 47.8])
+    pset = parcels.ParticleSet.from_list(
+        fieldset=fieldset, pclass=ptype[mode], lon=[3.3, 3.3], lat=[46.0, 47.8]
+    )
 
     def periodicBC(particle, fieldset, time):
         if particle.lon < fieldset.halo_west:
@@ -254,46 +283,87 @@ def slowlySouthWestward(particle, fieldset, time):
         particle_dlon -= 5 * particle.dt / 1e5  # noqa
         particle_dlat -= 3 * particle.dt / 1e5  # noqa
 
-    kernels = pset.Kernel(AdvectionRK4)+slowlySouthWestward+periodicBC
-    pset.execute(kernels, runtime=delta(days=6), dt=delta(hours=1))
+    kernels = pset.Kernel(parcels.AdvectionRK4) + slowlySouthWestward + periodicBC
+    pset.execute(kernels, runtime=timedelta(days=6), dt=timedelta(hours=1))
 
 
 def main(args=None):
-    p = ArgumentParser(description="""
-Example of particle advection around an idealised peninsula""")
-    p.add_argument('mode', choices=('scipy', 'jit'), nargs='?', default='jit',
-                   help='Execution mode for performing RK4 computation')
-    p.add_argument('-p', '--particles', type=int, default=2,
-                   help='Number of particles to advect')
-    p.add_argument('-v', '--verbose', action='store_true', default=False,
-                   help='Print particle information before and after execution')
-    p.add_argument('--profiling', action='store_true', default=False,
-                   help='Print profiling information after run')
-    p.add_argument('-f', '--fieldset', type=int, nargs=2, default=None,
-                   help='Generate fieldset file with given dimensions')
-    p.add_argument('-m', '--method', choices=('RK4', 'EE', 'RK45'), default='RK4',
-                   help='Numerical method used for advection')
+    p = ArgumentParser(
+        description="""
+Example of particle advection around an idealised peninsula"""
+    )
+    p.add_argument(
+        "mode",
+        choices=("scipy", "jit"),
+        nargs="?",
+        default="jit",
+        help="Execution mode for performing RK4 computation",
+    )
+    p.add_argument(
+        "-p", "--particles", type=int, default=2, help="Number of particles to advect"
+    )
+    p.add_argument(
+        "-v",
+        "--verbose",
+        action="store_true",
+        default=False,
+        help="Print particle information before and after execution",
+    )
+    p.add_argument(
+        "--profiling",
+        action="store_true",
+        default=False,
+        help="Print profiling information after run",
+    )
+    p.add_argument(
+        "-f",
+        "--fieldset",
+        type=int,
+        nargs=2,
+        default=None,
+        help="Generate fieldset file with given dimensions",
+    )
+    p.add_argument(
+        "-m",
+        "--method",
+        choices=("RK4", "EE", "RK45"),
+        default="RK4",
+        help="Numerical method used for advection",
+    )
     args = p.parse_args(args)
-    data_folder = download_example_dataset("MovingEddies_data")
+    data_folder = parcels.download_example_dataset("MovingEddies_data")
     filename = str(data_folder / "moving_eddies")
 
     # Generate fieldset files according to given dimensions
     if args.fieldset is not None:
-        fieldset = moving_eddies_fieldset(args.fieldset[0], args.fieldset[1], mesh='flat')
+        fieldset = moving_eddies_fieldset(
+            args.fieldset[0], args.fieldset[1], mesh="flat"
+        )
     else:
-        fieldset = moving_eddies_fieldset(mesh='flat')
+        fieldset = moving_eddies_fieldset(mesh="flat")
     outfile = "EddyParticle"
 
     if args.profiling:
         from cProfile import runctx
         from pstats import Stats
-        runctx("moving_eddies_example(fieldset, outfile, args.particles, mode=args.mode, \
+
+        runctx(
+            "moving_eddies_example(fieldset, outfile, args.particles, mode=args.mode, \
                               verbose=args.verbose, method=method[args.method])",
-               globals(), locals(), "Profile.prof")
+            globals(),
+            locals(),
+            "Profile.prof",
+        )
         Stats("Profile.prof").strip_dirs().sort_stats("time").print_stats(10)
     else:
-        moving_eddies_example(fieldset, outfile, args.particles, mode=args.mode,
-                              verbose=args.verbose, method=method[args.method])
+        moving_eddies_example(
+            fieldset,
+            outfile,
+            args.particles,
+            mode=args.mode,
+            verbose=args.verbose,
+            method=method[args.method],
+        )
 
 
 if __name__ == "__main__":
diff --git a/docs/examples/example_nemo_curvilinear.py b/docs/examples/example_nemo_curvilinear.py
index efe095fec..181733a37 100644
--- a/docs/examples/example_nemo_curvilinear.py
+++ b/docs/examples/example_nemo_curvilinear.py
@@ -1,97 +1,113 @@
 """Example script that runs a set of particles in a NEMO curvilinear grid."""
+
 from argparse import ArgumentParser
-from datetime import timedelta as delta
+from datetime import timedelta
 from glob import glob
 
 import numpy as np
 import pytest
 
-from parcels import (
-    AdvectionAnalytical,
-    AdvectionRK4,
-    FieldSet,
-    JITParticle,
-    ParticleFile,
-    ParticleSet,
-    ScipyParticle,
-    download_example_dataset,
-)
+import parcels
 
-ptype = {'scipy': ScipyParticle, 'jit': JITParticle}
-advection = {'RK4': AdvectionRK4, 'AA': AdvectionAnalytical}
+ptype = {"scipy": parcels.ScipyParticle, "jit": parcels.JITParticle}
+advection = {"RK4": parcels.AdvectionRK4, "AA": parcels.AdvectionAnalytical}
 
 
-def run_nemo_curvilinear(mode, outfile, advtype='RK4'):
+def run_nemo_curvilinear(mode, outfile, advtype="RK4"):
     """Run parcels on the NEMO curvilinear grid."""
-    data_folder = download_example_dataset('NemoCurvilinear_data')
-
-    filenames = {'U': {'lon': f'{data_folder}/mesh_mask.nc4',
-                       'lat': f'{data_folder}/mesh_mask.nc4',
-                       'data': f'{data_folder}/U_purely_zonal-ORCA025_grid_U.nc4'},
-                 'V': {'lon': f'{data_folder}/mesh_mask.nc4',
-                       'lat': f'{data_folder}/mesh_mask.nc4',
-                       'data': f'{data_folder}/V_purely_zonal-ORCA025_grid_V.nc4'}}
-    variables = {'U': 'U', 'V': 'V'}
-    dimensions = {'lon': 'glamf', 'lat': 'gphif'}
-    chunksize = {'lat': ('y', 256), 'lon': ('x', 512)}
-    fieldset = FieldSet.from_nemo(filenames, variables, dimensions, chunksize=chunksize)
+    data_folder = parcels.download_example_dataset("NemoCurvilinear_data")
+
+    filenames = {
+        "U": {
+            "lon": f"{data_folder}/mesh_mask.nc4",
+            "lat": f"{data_folder}/mesh_mask.nc4",
+            "data": f"{data_folder}/U_purely_zonal-ORCA025_grid_U.nc4",
+        },
+        "V": {
+            "lon": f"{data_folder}/mesh_mask.nc4",
+            "lat": f"{data_folder}/mesh_mask.nc4",
+            "data": f"{data_folder}/V_purely_zonal-ORCA025_grid_V.nc4",
+        },
+    }
+    variables = {"U": "U", "V": "V"}
+    dimensions = {"lon": "glamf", "lat": "gphif"}
+    chunksize = {"lat": ("y", 256), "lon": ("x", 512)}
+    fieldset = parcels.FieldSet.from_nemo(
+        filenames, variables, dimensions, chunksize=chunksize
+    )
     assert fieldset.U.chunksize == chunksize
 
     # Now run particles as normal
     npart = 20
     lonp = 30 * np.ones(npart)
-    if advtype == 'RK4':
+    if advtype == "RK4":
         latp = np.linspace(-70, 88, npart)
-        runtime = delta(days=160)
+        runtime = timedelta(days=160)
     else:
         latp = np.linspace(-70, 70, npart)
-        runtime = delta(days=15)
+        runtime = timedelta(days=15)
 
     def periodicBC(particle, fieldSet, time):
         if particle.lon > 180:
             particle_dlon -= 360  # noqa
 
-    pset = ParticleSet.from_list(fieldset, ptype[mode], lon=lonp, lat=latp)
-    pfile = ParticleFile(outfile, pset, outputdt=delta(days=1))
+    pset = parcels.ParticleSet.from_list(fieldset, ptype[mode], lon=lonp, lat=latp)
+    pfile = parcels.ParticleFile(outfile, pset, outputdt=timedelta(days=1))
     kernels = pset.Kernel(advection[advtype]) + periodicBC
-    pset.execute(kernels, runtime=runtime, dt=delta(hours=6),
-                 output_file=pfile)
+    pset.execute(kernels, runtime=runtime, dt=timedelta(hours=6), output_file=pfile)
     assert np.allclose(pset.lat - latp, 0, atol=2e-2)
 
 
-@pytest.mark.parametrize('mode', ['jit'])  # Only testing jit as scipy is very slow
+@pytest.mark.parametrize("mode", ["jit"])  # Only testing jit as scipy is very slow
 def test_nemo_curvilinear(mode, tmpdir):
     """Test the NEMO curvilinear example."""
-    outfile = tmpdir.join('nemo_particles')
+    outfile = tmpdir.join("nemo_particles")
     run_nemo_curvilinear(mode, outfile)
 
 
 def test_nemo_curvilinear_AA(tmpdir):
     """Test the NEMO curvilinear example with analytical advection."""
-    outfile = tmpdir.join('nemo_particlesAA')
-    run_nemo_curvilinear('scipy', outfile, 'AA')
+    outfile = tmpdir.join("nemo_particlesAA")
+    run_nemo_curvilinear("scipy", outfile, "AA")
 
 
 def test_nemo_3D_samegrid():
     """Test that the same grid is used for U and V in 3D NEMO fields."""
-    data_folder = download_example_dataset('NemoNorthSeaORCA025-N006_data')
-    ufiles = sorted(glob(f'{data_folder}/ORCA*U.nc'))
-    vfiles = sorted(glob(f'{data_folder}/ORCA*V.nc'))
-    wfiles = sorted(glob(f'{data_folder}/ORCA*W.nc'))
-    mesh_mask = f'{data_folder}/coordinates.nc'
-
-    filenames = {'U': {'lon': mesh_mask, 'lat': mesh_mask, 'depth': wfiles[0], 'data': ufiles},
-                 'V': {'lon': mesh_mask, 'lat': mesh_mask, 'depth': wfiles[0], 'data': vfiles},
-                 'W': {'lon': mesh_mask, 'lat': mesh_mask, 'depth': wfiles[0], 'data': wfiles}}
-
-    variables = {'U': 'uo',
-                 'V': 'vo',
-                 'W': 'wo'}
-    dimensions = {'U': {'lon': 'glamf', 'lat': 'gphif', 'depth': 'depthw', 'time': 'time_counter'},
-                  'V': {'lon': 'glamf', 'lat': 'gphif', 'depth': 'depthw', 'time': 'time_counter'},
-                  'W': {'lon': 'glamf', 'lat': 'gphif', 'depth': 'depthw', 'time': 'time_counter'}}
-
-    fieldset = FieldSet.from_nemo(filenames, variables, dimensions)
+    data_folder = parcels.download_example_dataset("NemoNorthSeaORCA025-N006_data")
+    ufiles = sorted(glob(f"{data_folder}/ORCA*U.nc"))
+    vfiles = sorted(glob(f"{data_folder}/ORCA*V.nc"))
+    wfiles = sorted(glob(f"{data_folder}/ORCA*W.nc"))
+    mesh_mask = f"{data_folder}/coordinates.nc"
+
+    filenames = {
+        "U": {"lon": mesh_mask, "lat": mesh_mask, "depth": wfiles[0], "data": ufiles},
+        "V": {"lon": mesh_mask, "lat": mesh_mask, "depth": wfiles[0], "data": vfiles},
+        "W": {"lon": mesh_mask, "lat": mesh_mask, "depth": wfiles[0], "data": wfiles},
+    }
+
+    variables = {"U": "uo", "V": "vo", "W": "wo"}
+    dimensions = {
+        "U": {
+            "lon": "glamf",
+            "lat": "gphif",
+            "depth": "depthw",
+            "time": "time_counter",
+        },
+        "V": {
+            "lon": "glamf",
+            "lat": "gphif",
+            "depth": "depthw",
+            "time": "time_counter",
+        },
+        "W": {
+            "lon": "glamf",
+            "lat": "gphif",
+            "depth": "depthw",
+            "time": "time_counter",
+        },
+    }
+
+    fieldset = parcels.FieldSet.from_nemo(filenames, variables, dimensions)
 
     assert fieldset.U.dataFiles is not fieldset.W.dataFiles
 
@@ -99,8 +115,13 @@ def test_nemo_3D_samegrid():
 def main(args=None):
     """Run the example with given arguments."""
     p = ArgumentParser(description="""Chose the mode using mode option""")
-    p.add_argument('mode', choices=('scipy', 'jit'), nargs='?', default='jit',
-                   help='Execution mode for performing computation')
+    p.add_argument(
+        "mode",
+        choices=("scipy", "jit"),
+        nargs="?",
+        default="jit",
+        help="Execution mode for performing computation",
+    )
     args = p.parse_args(args)
 
     outfile = "nemo_particles"
diff --git a/docs/examples/example_ofam.py b/docs/examples/example_ofam.py
index 251bc3cf7..791d890ff 100644
--- a/docs/examples/example_ofam.py
+++ b/docs/examples/example_ofam.py
@@ -1,61 +1,73 @@
 import gc
-from datetime import timedelta as delta
+from datetime import timedelta
 
 import numpy as np
 import pytest
 import xarray as xr
 
-from parcels import (
-    AdvectionRK4,
-    FieldSet,
-    JITParticle,
-    ParticleSet,
-    ScipyParticle,
-    download_example_dataset,
-)
+import parcels
 
-ptype = {'scipy': ScipyParticle, 'jit': JITParticle}
+ptype = {"scipy": parcels.ScipyParticle, "jit": parcels.JITParticle}
 
 
 def set_ofam_fieldset(deferred_load=True, use_xarray=False):
-    data_folder = download_example_dataset("OFAM_example_data")
-    filenames = {'U': f"{data_folder}/OFAM_simple_U.nc",
-                 'V': f"{data_folder}/OFAM_simple_V.nc"}
-    variables = {'U': 'u', 'V': 'v'}
-    dimensions = {'lat': 'yu_ocean', 'lon': 'xu_ocean', 'depth': 'st_ocean',
-                  'time': 'Time'}
+    data_folder = parcels.download_example_dataset("OFAM_example_data")
+    filenames = {
+        "U": f"{data_folder}/OFAM_simple_U.nc",
+        "V": f"{data_folder}/OFAM_simple_V.nc",
+    }
+    variables = {"U": "u", "V": "v"}
+    dimensions = {
+        "lat": "yu_ocean",
+        "lon": "xu_ocean",
+        "depth": "st_ocean",
+        "time": "Time",
+    }
     if use_xarray:
-        ds = xr.open_mfdataset([filenames['U'], filenames['V']], combine='by_coords')
-        return FieldSet.from_xarray_dataset(ds, variables, dimensions, allow_time_extrapolation=True)
+        ds = xr.open_mfdataset([filenames["U"], filenames["V"]], combine="by_coords")
+        return parcels.FieldSet.from_xarray_dataset(
+            ds, variables, dimensions, allow_time_extrapolation=True
+        )
     else:
-        return FieldSet.from_netcdf(filenames, variables, dimensions, allow_time_extrapolation=True, deferred_load=deferred_load, chunksize=False)
+        return parcels.FieldSet.from_netcdf(
+            filenames,
+            variables,
+            dimensions,
+            allow_time_extrapolation=True,
+            deferred_load=deferred_load,
+            chunksize=False,
+        )
 
 
-@pytest.mark.parametrize('use_xarray', [True, False])
+@pytest.mark.parametrize("use_xarray", [True, False])
 def test_ofam_fieldset_fillvalues(use_xarray):
     fieldset = set_ofam_fieldset(deferred_load=False, use_xarray=use_xarray)
     # V.data[0, 0, 150] is a landpoint, that makes NetCDF4 generate a masked array, instead of an ndarray
     assert fieldset.V.data[0, 0, 150] == 0
 
 
-@pytest.mark.parametrize('dt', [delta(minutes=-5), delta(minutes=5)])
+@pytest.mark.parametrize("dt", [timedelta(minutes=-5), timedelta(minutes=5)])
 def test_ofam_xarray_vs_netcdf(dt):
     fieldsetNetcdf = set_ofam_fieldset(use_xarray=False)
     fieldsetxarray = set_ofam_fieldset(use_xarray=True)
-    lonstart, latstart, runtime = (180, 10, delta(days=7))
+    lonstart, latstart, runtime = (180, 10, timedelta(days=7))
 
-    psetN = ParticleSet(fieldsetNetcdf, pclass=JITParticle, lon=lonstart, lat=latstart)
-    psetN.execute(AdvectionRK4, runtime=runtime, dt=dt)
+    psetN = parcels.ParticleSet(
+        fieldsetNetcdf, pclass=parcels.JITParticle, lon=lonstart, lat=latstart
+    )
+    psetN.execute(parcels.AdvectionRK4, runtime=runtime, dt=dt)
 
-    psetX = ParticleSet(fieldsetxarray, pclass=JITParticle, lon=lonstart, lat=latstart)
-    psetX.execute(AdvectionRK4, runtime=runtime, dt=dt)
+    psetX = parcels.ParticleSet(
+        fieldsetxarray, pclass=parcels.JITParticle, lon=lonstart, lat=latstart
+    )
+    psetX.execute(parcels.AdvectionRK4, runtime=runtime, dt=dt)
 
     assert np.allclose(psetN[0].lon, psetX[0].lon)
     assert np.allclose(psetN[0].lat, psetX[0].lat)
 
 
-@pytest.mark.parametrize('use_xarray', [True, False])
-@pytest.mark.parametrize('mode', ['scipy', 'jit'])
+@pytest.mark.parametrize("use_xarray", [True, False])
+@pytest.mark.parametrize("mode", ["scipy", "jit"])
 def test_ofam_particles(mode, use_xarray):
     gc.collect()
     fieldset = set_ofam_fieldset(use_xarray=use_xarray)
@@ -64,9 +76,13 @@ def test_ofam_particles(mode, use_xarray):
     latstart = [10]
     depstart = [2.5]  # the depth of the first layer in OFAM
 
-    pset = ParticleSet(fieldset, pclass=ptype[mode], lon=lonstart, lat=latstart, depth=depstart)
+    pset = parcels.ParticleSet(
+        fieldset, pclass=ptype[mode], lon=lonstart, lat=latstart, depth=depstart
+    )
 
-    pset.execute(AdvectionRK4, runtime=delta(days=10), dt=delta(minutes=5))
+    pset.execute(
+        parcels.AdvectionRK4, runtime=timedelta(days=10), dt=timedelta(minutes=5)
+    )
 
     assert abs(pset[0].lon - 173) < 1
     assert abs(pset[0].lat - 11) < 1
diff --git a/docs/examples/example_peninsula.py b/docs/examples/example_peninsula.py
index 4597f90a4..3299d638c 100644
--- a/docs/examples/example_peninsula.py
+++ b/docs/examples/example_peninsula.py
@@ -1,28 +1,22 @@
 import gc
 import math  # NOQA
 from argparse import ArgumentParser
-from datetime import timedelta as delta
+from datetime import timedelta
 
 import numpy as np
 import pytest
 
-from parcels import (
-    AdvectionAnalytical,
-    AdvectionEE,
-    AdvectionRK4,
-    AdvectionRK45,
-    FieldSet,
-    JITParticle,
-    ParticleSet,
-    ScipyParticle,
-    Variable,
-)
+import parcels
 
-ptype = {'scipy': ScipyParticle, 'jit': JITParticle}
-method = {'RK4': AdvectionRK4, 'EE': AdvectionEE, 'RK45': AdvectionRK45}
+ptype = {"scipy": parcels.ScipyParticle, "jit": parcels.JITParticle}
+method = {
+    "RK4": parcels.AdvectionRK4,
+    "EE": parcels.AdvectionEE,
+    "RK45": parcels.AdvectionRK45,
+}
 
 
-def peninsula_fieldset(xdim, ydim, mesh='flat', grid_type='A'):
+def peninsula_fieldset(xdim, ydim, mesh="flat", grid_type="A"):
     """Construct a fieldset encapsulating the flow field around an idealised peninsula.
 
     Parameters
@@ -54,7 +48,7 @@ def peninsula_fieldset(xdim, ydim, mesh='flat', grid_type='A'):
     # Set Parcels FieldSet variables
 
     # Generate the original test setup on A-grid in m
-    domainsizeX, domainsizeY = (1.e5, 5.e4)
+    domainsizeX, domainsizeY = (1.0e5, 5.0e4)
     La = np.linspace(1e3, domainsizeX, xdim, dtype=np.float32)
     Wa = np.linspace(1e3, domainsizeY, ydim, dtype=np.float32)
 
@@ -63,37 +57,37 @@ def peninsula_fieldset(xdim, ydim, mesh='flat', grid_type='A'):
     R = 0.32 * domainsizeX / 2
 
     # Create the fields
-    x, y = np.meshgrid(La, Wa, sparse=True, indexing='xy')
-    P = (u0*R**2*y/((x-x0)**2+y**2)-u0*y) / 1e3
+    x, y = np.meshgrid(La, Wa, sparse=True, indexing="xy")
+    P = (u0 * R**2 * y / ((x - x0) ** 2 + y**2) - u0 * y) / 1e3
 
-    if grid_type == 'A':
-        U = u0-u0*R**2*((x-x0)**2-y**2)/(((x-x0)**2+y**2)**2)
-        V = -2*u0*R**2*((x-x0)*y)/(((x-x0)**2+y**2)**2)
-    elif grid_type == 'C':
+    if grid_type == "A":
+        U = u0 - u0 * R**2 * ((x - x0) ** 2 - y**2) / (((x - x0) ** 2 + y**2) ** 2)
+        V = -2 * u0 * R**2 * ((x - x0) * y) / (((x - x0) ** 2 + y**2) ** 2)
+    elif grid_type == "C":
         U = np.zeros(P.shape)
         V = np.zeros(P.shape)
-        V[:, 1:] = (P[:, 1:] - P[:, :-1])
+        V[:, 1:] = P[:, 1:] - P[:, :-1]
         U[1:, :] = -(P[1:, :] - P[:-1, :])
     else:
-        raise RuntimeError(f'Grid_type {grid_type} is not a valid option')
+        raise RuntimeError(f"Grid_type {grid_type} is not a valid option")
 
     # Set land points to NaN
-    landpoints = P >= 0.
+    landpoints = P >= 0.0
     P[landpoints] = np.nan
     U[landpoints] = np.nan
     V[landpoints] = np.nan
 
     # Convert from m to lat/lon for spherical meshes
-    lon = La / 1852. / 60. if mesh == 'spherical' else La
-    lat = Wa / 1852. / 60. if mesh == 'spherical' else Wa
+    lon = La / 1852.0 / 60.0 if mesh == "spherical" else La
+    lat = Wa / 1852.0 / 60.0 if mesh == "spherical" else Wa
 
-    data = {'U': U, 'V': V, 'P': P}
-    dimensions = {'lon': lon, 'lat': lat}
+    data = {"U": U, "V": V, "P": P}
+    dimensions = {"lon": lon, "lat": lat}
 
-    fieldset = FieldSet.from_data(data, dimensions, mesh=mesh)
-    if grid_type == 'C':
-        fieldset.U.interp_method = 'cgrid_velocity'
-        fieldset.V.interp_method = 'cgrid_velocity'
+    fieldset = parcels.FieldSet.from_data(data, dimensions, mesh=mesh)
+    if grid_type == "C":
+        fieldset.U.interp_method = "cgrid_velocity"
+        fieldset.V.interp_method = "cgrid_velocity"
     return fieldset
 
 
@@ -103,8 +97,16 @@ def UpdateP(particle, fieldset, time):
     particle.p = fieldset.P[time, particle.depth, particle.lat, particle.lon]
 
 
-def peninsula_example(fieldset, outfile, npart, mode='jit', degree=1,
-                      verbose=False, output=True, method=AdvectionRK4):
+def peninsula_example(
+    fieldset,
+    outfile,
+    npart,
+    mode="jit",
+    degree=1,
+    verbose=False,
+    output=True,
+    method=parcels.AdvectionRK4,
+):
     """Example configuration of particle flow around an idealised Peninsula
 
     Parameters
@@ -130,27 +132,42 @@ def peninsula_example(fieldset, outfile, npart, mode='jit', degree=1,
     # First, we define a custom Particle class to which we add a
     # custom variable, the initial stream function value p.
     # We determine the particle base class according to mode.
-    MyParticle = ptype[mode].add_variable([Variable('p', dtype=np.float32, initial=0.),
-                                           Variable('p_start', dtype=np.float32, initial=0)])
+    MyParticle = ptype[mode].add_variable(
+        [
+            parcels.Variable("p", dtype=np.float32, initial=0.0),
+            parcels.Variable("p_start", dtype=np.float32, initial=0),
+        ]
+    )
 
     # Initialise particles
-    if fieldset.U.grid.mesh == 'flat':
+    if fieldset.U.grid.mesh == "flat":
         x = 3000  # 3 km offset from boundary
     else:
-        x = 3. * (1. / 1.852 / 60)  # 3 km offset from boundary
-    y = (fieldset.U.lat[0] + x, fieldset.U.lat[-1] - x)  # latitude range, including offsets
-    pset = ParticleSet.from_line(fieldset, size=npart, pclass=MyParticle,
-                                 start=(x, y[0]), finish=(x, y[1]), time=0)
+        x = 3.0 * (1.0 / 1.852 / 60)  # 3 km offset from boundary
+    y = (
+        fieldset.U.lat[0] + x,
+        fieldset.U.lat[-1] - x,
+    )  # latitude range, including offsets
+    pset = parcels.ParticleSet.from_line(
+        fieldset,
+        size=npart,
+        pclass=MyParticle,
+        start=(x, y[0]),
+        finish=(x, y[1]),
+        time=0,
+    )
 
     if verbose:
         print(f"Initial particle positions:\n{pset}")
 
     # Advect the particles for 24h
-    time = delta(hours=24)
-    dt = delta(minutes=5)
+    time = timedelta(hours=24)
+    dt = timedelta(minutes=5)
     k_adv = pset.Kernel(method)
     k_p = pset.Kernel(UpdateP)
-    out = pset.ParticleFile(name=outfile, outputdt=delta(hours=1)) if output else None
+    out = (
+        pset.ParticleFile(name=outfile, outputdt=timedelta(hours=1)) if output else None
+    )
     print("Peninsula: Advecting %d particles for %s" % (npart, str(time)))
     pset.execute(k_adv + k_p, runtime=time, dt=dt, output_file=out)
 
@@ -160,8 +177,8 @@ def peninsula_example(fieldset, outfile, npart, mode='jit', degree=1,
     return pset
 
 
-@pytest.mark.parametrize('mode', ['scipy', 'jit'])
-@pytest.mark.parametrize('mesh', ['flat', 'spherical'])
+@pytest.mark.parametrize("mode", ["scipy", "jit"])
+@pytest.mark.parametrize("mesh", ["flat", "spherical"])
 def test_peninsula_fieldset(mode, mesh, tmpdir):
     """Execute peninsula test from fieldset generated in memory."""
     fieldset = peninsula_fieldset(100, 50, mesh)
@@ -169,95 +186,166 @@ def test_peninsula_fieldset(mode, mesh, tmpdir):
     pset = peninsula_example(fieldset, outfile, 5, mode=mode, degree=1)
     # Test advection accuracy by comparing streamline values
     err_adv = np.abs(pset.p_start - pset.p)
-    assert (err_adv <= 1.e-3).all()
+    assert (err_adv <= 1.0e-3).all()
     # Test Field sampling accuracy by comparing kernel against Field sampling
-    err_smpl = np.array([abs(pset.p[i] - pset.fieldset.P[0., pset.depth[i], pset.lat[i], pset.lon[i]]) for i in range(pset.size)])
-    assert (err_smpl <= 1.e-3).all()
-
-
-@pytest.mark.parametrize('mode', ['scipy'])  # Analytical Advection only implemented in Scipy mode
-@pytest.mark.parametrize('mesh', ['flat', 'spherical'])
+    err_smpl = np.array(
+        [
+            abs(
+                pset.p[i]
+                - pset.fieldset.P[0.0, pset.depth[i], pset.lat[i], pset.lon[i]]
+            )
+            for i in range(pset.size)
+        ]
+    )
+    assert (err_smpl <= 1.0e-3).all()
+
+
+@pytest.mark.parametrize(
+    "mode", ["scipy"]
+)  # Analytical Advection only implemented in Scipy mode
+@pytest.mark.parametrize("mesh", ["flat", "spherical"])
 def test_peninsula_fieldset_AnalyticalAdvection(mode, mesh, tmpdir):
     """Execute peninsula test using Analytical Advection on C grid."""
-    fieldset = peninsula_fieldset(101, 51, 'flat', grid_type='C')
+    fieldset = peninsula_fieldset(101, 51, "flat", grid_type="C")
     outfile = tmpdir.join("PeninsulaAA")
-    pset = peninsula_example(fieldset, outfile, npart=10, mode=mode,
-                             method=AdvectionAnalytical)
+    pset = peninsula_example(
+        fieldset, outfile, npart=10, mode=mode, method=parcels.AdvectionAnalytical
+    )
     # Test advection accuracy by comparing streamline values
     err_adv = np.array([abs(p.p_start - p.p) for p in pset])
 
-    tol = {"scipy": 3.e-1, "jit": 1.e-1}.get(mode)
+    tol = {"scipy": 3.0e-1, "jit": 1.0e-1}.get(mode)
     assert (err_adv <= tol).all()
 
 
 def fieldsetfile(mesh, tmpdir):
     """Generate fieldset files for peninsula test."""
-    filename = tmpdir.join('peninsula')
+    filename = tmpdir.join("peninsula")
     fieldset = peninsula_fieldset(100, 50, mesh=mesh)
     fieldset.write(filename)
     return filename
 
 
-@pytest.mark.parametrize('mode', ['scipy', 'jit'])
-@pytest.mark.parametrize('mesh', ['flat', 'spherical'])
+@pytest.mark.parametrize("mode", ["scipy", "jit"])
+@pytest.mark.parametrize("mesh", ["flat", "spherical"])
 def test_peninsula_file(mode, mesh, tmpdir):
     """Open fieldset files and execute."""
     gc.collect()
-    fieldset = FieldSet.from_parcels(fieldsetfile(mesh, tmpdir), extra_fields={'P': 'P'}, allow_time_extrapolation=True)
+    fieldset = parcels.FieldSet.from_parcels(
+        fieldsetfile(mesh, tmpdir),
+        extra_fields={"P": "P"},
+        allow_time_extrapolation=True,
+    )
     outfile = tmpdir.join("Peninsula")
     pset = peninsula_example(fieldset, outfile, 5, mode=mode, degree=1)
     # Test advection accuracy by comparing streamline values
     err_adv = np.abs(pset.p_start - pset.p)
-    assert (err_adv <= 1.e-3).all()
+    assert (err_adv <= 1.0e-3).all()
     # Test Field sampling accuracy by comparing kernel against Field sampling
-    err_smpl = np.array([abs(pset.p[i] - pset.fieldset.P[0., pset.depth[i], pset.lat[i], pset.lon[i]]) for i in range(pset.size)])
-    assert (err_smpl <= 1.e-3).all()
+    err_smpl = np.array(
+        [
+            abs(
+                pset.p[i]
+                - pset.fieldset.P[0.0, pset.depth[i], pset.lat[i], pset.lon[i]]
+            )
+            for i in range(pset.size)
+        ]
+    )
+    assert (err_smpl <= 1.0e-3).all()
 
 
 def main(args=None):
-    p = ArgumentParser(description="""
-Example of particle advection around an idealised peninsula""")
-    p.add_argument('mode', choices=('scipy', 'jit'), nargs='?', default='jit',
-                   help='Execution mode for performing RK4 computation')
-    p.add_argument('-p', '--particles', type=int, default=20,
-                   help='Number of particles to advect')
-    p.add_argument('-d', '--degree', type=int, default=1,
-                   help='Degree of spatial interpolation')
-    p.add_argument('-v', '--verbose', action='store_true', default=False,
-                   help='Print particle information before and after execution')
-    p.add_argument('-o', '--nooutput', action='store_true', default=False,
-                   help='Suppress trajectory output')
-    p.add_argument('--profiling', action='store_true', default=False,
-                   help='Print profiling information after run')
-    p.add_argument('-f', '--fieldset', type=int, nargs=2, default=None,
-                   help='Generate fieldset file with given dimensions')
-    p.add_argument('-m', '--method', choices=('RK4', 'EE', 'RK45'), default='RK4',
-                   help='Numerical method used for advection')
+    p = ArgumentParser(
+        description="""
+Example of particle advection around an idealised peninsula"""
+    )
+    p.add_argument(
+        "mode",
+        choices=("scipy", "jit"),
+        nargs="?",
+        default="jit",
+        help="Execution mode for performing RK4 computation",
+    )
+    p.add_argument(
+        "-p", "--particles", type=int, default=20, help="Number of particles to advect"
+    )
+    p.add_argument(
+        "-d", "--degree", type=int, default=1, help="Degree of spatial interpolation"
+    )
+    p.add_argument(
+        "-v",
+        "--verbose",
+        action="store_true",
+        default=False,
+        help="Print particle information before and after execution",
+    )
+    p.add_argument(
+        "-o",
+        "--nooutput",
+        action="store_true",
+        default=False,
+        help="Suppress trajectory output",
+    )
+    p.add_argument(
+        "--profiling",
+        action="store_true",
+        default=False,
+        help="Print profiling information after run",
+    )
+    p.add_argument(
+        "-f",
+        "--fieldset",
+        type=int,
+        nargs=2,
+        default=None,
+        help="Generate fieldset file with given dimensions",
+    )
+    p.add_argument(
+        "-m",
+        "--method",
+        choices=("RK4", "EE", "RK45"),
+        default="RK4",
+        help="Numerical method used for advection",
+    )
     args = p.parse_args(args)
 
-    filename = 'peninsula'
+    filename = "peninsula"
     if args.fieldset is not None:
-        fieldset = peninsula_fieldset(args.fieldset[0], args.fieldset[1], mesh='flat')
+        fieldset = peninsula_fieldset(args.fieldset[0], args.fieldset[1], mesh="flat")
     else:
-        fieldset = peninsula_fieldset(100, 50, mesh='flat')
+        fieldset = peninsula_fieldset(100, 50, mesh="flat")
     fieldset.write(filename)
 
     # Open fieldset file set
-    fieldset = FieldSet.from_parcels('peninsula', extra_fields={'P': 'P'}, allow_time_extrapolation=True)
+    fieldset = parcels.FieldSet.from_parcels(
+        "peninsula", extra_fields={"P": "P"}, allow_time_extrapolation=True
+    )
     outfile = "Peninsula"
 
     if args.profiling:
         from cProfile import runctx
         from pstats import Stats
-        runctx("peninsula_example(fieldset, outfile, args.particles, mode=args.mode,\
+
+        runctx(
+            "peninsula_example(fieldset, outfile, args.particles, mode=args.mode,\
                                    degree=args.degree, verbose=args.verbose,\
                                    output=not args.nooutput, method=method[args.method])",
-               globals(), locals(), "Profile.prof")
+            globals(),
+            locals(),
+            "Profile.prof",
+        )
         Stats("Profile.prof").strip_dirs().sort_stats("time").print_stats(10)
     else:
-        peninsula_example(fieldset, outfile, args.particles, mode=args.mode,
-                          degree=args.degree, verbose=args.verbose,
-                          output=not args.nooutput, method=method[args.method])
+        peninsula_example(
+            fieldset,
+            outfile,
+            args.particles,
+            mode=args.mode,
+            degree=args.degree,
+            verbose=args.verbose,
+            output=not args.nooutput,
+            method=method[args.method],
+        )
 
 
 if __name__ == "__main__":
diff --git a/docs/examples/example_radial_rotation.py b/docs/examples/example_radial_rotation.py
index cd00aba18..12ddb6379 100644
--- a/docs/examples/example_radial_rotation.py
+++ b/docs/examples/example_radial_rotation.py
@@ -1,84 +1,100 @@
 import math
-from datetime import timedelta as delta
+from datetime import timedelta
 
 import numpy as np
 import pytest
 
-from parcels import AdvectionRK4, FieldSet, JITParticle, ParticleSet, ScipyParticle
+import parcels
 
-ptype = {'scipy': ScipyParticle, 'jit': JITParticle}
+ptype = {"scipy": parcels.ScipyParticle, "jit": parcels.JITParticle}
 
 
-def radial_rotation_fieldset(xdim=200, ydim=200):  # Define 2D flat, square fieldset for testing purposes.
+def radial_rotation_fieldset(
+    xdim=200, ydim=200
+):  # Define 2D flat, square fieldset for testing purposes.
 
     lon = np.linspace(0, 60, xdim, dtype=np.float32)
     lat = np.linspace(0, 60, ydim, dtype=np.float32)
 
-    x0 = 30.                                   # Define the origin to be the centre of the Field.
-    y0 = 30.
+    x0 = 30.0  # Define the origin to be the centre of the Field.
+    y0 = 30.0
 
     U = np.zeros((ydim, xdim), dtype=np.float32)
     V = np.zeros((ydim, xdim), dtype=np.float32)
 
-    T = delta(days=1)
-    omega = 2*np.pi/T.total_seconds()          # Define the rotational period as 1 day.
+    T = timedelta(days=1)
+    omega = 2 * np.pi / T.total_seconds()  # Define the rotational period as 1 day.
 
     for i in range(lon.size):
         for j in range(lat.size):
 
-            r = np.sqrt((lon[i]-x0)**2 + (lat[j]-y0)**2)  # Define radial displacement.
-            assert r >= 0.
+            r = np.sqrt(
+                (lon[i] - x0) ** 2 + (lat[j] - y0) ** 2
+            )  # Define radial displacement.
+            assert r >= 0.0
             assert r <= np.sqrt(x0**2 + y0**2)
 
-            theta = math.atan2((lat[j]-y0), (lon[i]-x0))  # Define the polar angle.
+            theta = math.atan2((lat[j] - y0), (lon[i] - x0))  # Define the polar angle.
             assert abs(theta) <= np.pi
 
             U[j, i] = r * math.sin(theta) * omega
             V[j, i] = -r * math.cos(theta) * omega
 
-    data = {'U': U, 'V': V}
-    dimensions = {'lon': lon, 'lat': lat}
-    return FieldSet.from_data(data, dimensions, mesh='flat')
+    data = {"U": U, "V": V}
+    dimensions = {"lon": lon, "lat": lat}
+    return parcels.FieldSet.from_data(data, dimensions, mesh="flat")
 
 
 def true_values(age):  # Calculate the expected values for particle 2 at the endtime.
 
-    x = 20*math.sin(2*np.pi*age/(24.*60.**2)) + 30.
-    y = 20*math.cos(2*np.pi*age/(24.*60.**2)) + 30.
+    x = 20 * math.sin(2 * np.pi * age / (24.0 * 60.0**2)) + 30.0
+    y = 20 * math.cos(2 * np.pi * age / (24.0 * 60.0**2)) + 30.0
 
     return [x, y]
 
 
-def rotation_example(fieldset, outfile, mode='jit', method=AdvectionRK4):
+def rotation_example(fieldset, outfile, mode="jit", method=parcels.AdvectionRK4):
 
-    npart = 2          # Test two particles on the rotating fieldset.
-    pset = ParticleSet.from_line(fieldset, size=npart, pclass=ptype[mode],
-                                 start=(30., 30.),
-                                 finish=(30., 50.))  # One particle in centre, one on periphery of Field.
+    npart = 2  # Test two particles on the rotating fieldset.
+    pset = parcels.ParticleSet.from_line(
+        fieldset,
+        size=npart,
+        pclass=ptype[mode],
+        start=(30.0, 30.0),
+        finish=(30.0, 50.0),
+    )  # One particle in centre, one on periphery of Field.
 
-    runtime = delta(hours=17)
-    dt = delta(minutes=5)
-    outputdt = delta(hours=1)
+    runtime = timedelta(hours=17)
+    dt = timedelta(minutes=5)
+    outputdt = timedelta(hours=1)
 
-    pset.execute(method, runtime=runtime, dt=dt,
-                 output_file=pset.ParticleFile(name=outfile, outputdt=outputdt))
+    pset.execute(
+        method,
+        runtime=runtime,
+        dt=dt,
+        output_file=pset.ParticleFile(name=outfile, outputdt=outputdt),
+    )
 
     return pset
 
 
-@pytest.mark.parametrize('mode', ['scipy', 'jit'])
+@pytest.mark.parametrize("mode", ["scipy", "jit"])
 def test_rotation_example(mode, tmpdir):
     fieldset = radial_rotation_fieldset()
     outfile = tmpdir.join("RadialParticle")
     pset = rotation_example(fieldset, outfile, mode=mode)
-    assert (pset[0].lon == 30. and pset[0].lat == 30.)  # Particle at centre of Field remains stationary.
+    assert (
+        pset[0].lon == 30.0 and pset[0].lat == 30.0
+    )  # Particle at centre of Field remains stationary.
     vals = true_values(pset.time[1])
-    assert np.allclose(pset[1].lon, vals[0], 1e-5)    # Check advected values against calculated values.
+    assert np.allclose(
+        pset[1].lon, vals[0], 1e-5
+    )  # Check advected values against calculated values.
     assert np.allclose(pset[1].lat, vals[1], 1e-5)
 
 
 def main():
-    filename = 'radial_rotation'
+    filename = "radial_rotation"
     fieldset = radial_rotation_fieldset()
     fieldset.write(filename)
 
diff --git a/docs/examples/example_stommel.py b/docs/examples/example_stommel.py
index 052987638..58150eec6 100755
--- a/docs/examples/example_stommel.py
+++ b/docs/examples/example_stommel.py
@@ -1,27 +1,21 @@
 import math
 from argparse import ArgumentParser
-from datetime import timedelta as delta
+from datetime import timedelta
 
 import numpy as np
 import pytest
 
-from parcels import (
-    AdvectionEE,
-    AdvectionRK4,
-    AdvectionRK45,
-    FieldSet,
-    JITParticle,
-    ParticleSet,
-    ScipyParticle,
-    Variable,
-    timer,
-)
+import parcels
 
-ptype = {'scipy': ScipyParticle, 'jit': JITParticle}
-method = {'RK4': AdvectionRK4, 'EE': AdvectionEE, 'RK45': AdvectionRK45}
+ptype = {"scipy": parcels.ScipyParticle, "jit": parcels.JITParticle}
+method = {
+    "RK4": parcels.AdvectionRK4,
+    "EE": parcels.AdvectionEE,
+    "RK45": parcels.AdvectionRK45,
+}
 
 
-def stommel_fieldset(xdim=200, ydim=200, grid_type='A'):
+def stommel_fieldset(xdim=200, ydim=200, grid_type="A"):
     """Simulate a periodic current along a western boundary, with significantly
     larger velocities along the western edge than the rest of the region
 
@@ -44,27 +38,42 @@ def stommel_fieldset(xdim=200, ydim=200, grid_type='A'):
     P = np.zeros((lat.size, lon.size), dtype=np.float32)
 
     beta = 2e-11
-    r = 1/(11.6*86400)
-    es = r/(beta*a)
+    r = 1 / (11.6 * 86400)
+    es = r / (beta * a)
 
     for j in range(lat.size):
         for i in range(lon.size):
             xi = lon[i] / a
             yi = lat[j] / b
-            P[j, i] = (1 - math.exp(-xi / es) - xi) * math.pi * np.sin(math.pi * yi) * scalefac
-            if grid_type == 'A':
-                U[j, i] = -(1 - math.exp(-xi / es) - xi) * math.pi ** 2 * np.cos(math.pi * yi) * scalefac
-                V[j, i] = (math.exp(-xi / es) / es - 1) * math.pi * np.sin(math.pi * yi) * scalefac
-    if grid_type == 'C':
+            P[j, i] = (
+                (1 - math.exp(-xi / es) - xi)
+                * math.pi
+                * np.sin(math.pi * yi)
+                * scalefac
+            )
+            if grid_type == "A":
+                U[j, i] = (
+                    -(1 - math.exp(-xi / es) - xi)
+                    * math.pi**2
+                    * np.cos(math.pi * yi)
+                    * scalefac
+                )
+                V[j, i] = (
+                    (math.exp(-xi / es) / es - 1)
+                    * math.pi
+                    * np.sin(math.pi * yi)
+                    * scalefac
+                )
+    if grid_type == "C":
         V[:, 1:] = (P[:, 1:] - P[:, 0:-1]) / dx * a
         U[1:, :] = -(P[1:, :] - P[0:-1, :]) / dy * b
 
-    data = {'U': U, 'V': V, 'P': P}
-    dimensions = {'lon': lon, 'lat': lat}
-    fieldset = FieldSet.from_data(data, dimensions, mesh='flat')
-    if grid_type == 'C':
-        fieldset.U.interp_method = 'cgrid_velocity'
-        fieldset.V.interp_method = 'cgrid_velocity'
+    data = {"U": U, "V": V, "P": P}
+    dimensions = {"lon": lon, "lat": lat}
+    fieldset = parcels.FieldSet.from_data(data, dimensions, mesh="flat")
+    if grid_type == "C":
+        fieldset.U.interp_method = "cgrid_velocity"
+        fieldset.V.interp_method = "cgrid_velocity"
     return fieldset
 
 
@@ -85,111 +94,207 @@ def simple_partition_function(coords, mpi_size=1):
     return np.linspace(0, mpi_size, coords.shape[0], endpoint=False, dtype=np.int32)
 
 
-def stommel_example(npart=1, mode='jit', verbose=False, method=AdvectionRK4, grid_type='A',
-                    outfile="StommelParticle.zarr", repeatdt=None, maxage=None, write_fields=True,
-                    custom_partition_function=False):
-    timer.fieldset = timer.Timer('FieldSet', parent=timer.stommel)
+def stommel_example(
+    npart=1,
+    mode="jit",
+    verbose=False,
+    method=parcels.AdvectionRK4,
+    grid_type="A",
+    outfile="StommelParticle.zarr",
+    repeatdt=None,
+    maxage=None,
+    write_fields=True,
+    custom_partition_function=False,
+):
+    parcels.timer.fieldset = parcels.timer.Timer(
+        "FieldSet", parent=parcels.timer.stommel
+    )
     fieldset = stommel_fieldset(grid_type=grid_type)
     if write_fields:
-        filename = 'stommel'
+        filename = "stommel"
         fieldset.write(filename)
-    timer.fieldset.stop()
+    parcels.timer.fieldset.stop()
 
     # Determine particle class according to mode
-    timer.pset = timer.Timer('Pset', parent=timer.stommel)
-    timer.psetinit = timer.Timer('Pset_init', parent=timer.pset)
-    ParticleClass = JITParticle if mode == 'jit' else ScipyParticle
+    parcels.timer.pset = parcels.timer.Timer("Pset", parent=parcels.timer.stommel)
+    parcels.timer.psetinit = parcels.timer.Timer("Pset_init", parent=parcels.timer.pset)
+    ParticleClass = parcels.JITParticle if mode == "jit" else parcels.ScipyParticle
 
     # Execute for 600 days, with 1-hour timesteps and 5-day output
-    runtime = delta(days=600)
-    dt = delta(hours=1)
-    outputdt = delta(days=5)
-
-    extra_vars = [Variable('p', dtype=np.float32, initial=0.),
-                  Variable('p_start', dtype=np.float32, initial=0.),
-                  Variable('next_dt', dtype=np.float64, initial=dt.total_seconds()),
-                  Variable('age', dtype=np.float32, initial=0.)]
+    runtime = timedelta(days=600)
+    dt = timedelta(hours=1)
+    outputdt = timedelta(days=5)
+
+    extra_vars = [
+        parcels.Variable("p", dtype=np.float32, initial=0.0),
+        parcels.Variable("p_start", dtype=np.float32, initial=0.0),
+        parcels.Variable("next_dt", dtype=np.float64, initial=dt.total_seconds()),
+        parcels.Variable("age", dtype=np.float32, initial=0.0),
+    ]
     MyParticle = ParticleClass.add_variables(extra_vars)
 
     if custom_partition_function:
-        pset = ParticleSet.from_line(fieldset, size=npart, pclass=MyParticle, repeatdt=repeatdt,
-                                     start=(10e3, 5000e3), finish=(100e3, 5000e3), time=0,
-                                     partition_function=simple_partition_function)
+        pset = parcels.ParticleSet.from_line(
+            fieldset,
+            size=npart,
+            pclass=MyParticle,
+            repeatdt=repeatdt,
+            start=(10e3, 5000e3),
+            finish=(100e3, 5000e3),
+            time=0,
+            partition_function=simple_partition_function,
+        )
     else:
-        pset = ParticleSet.from_line(fieldset, size=npart, pclass=MyParticle, repeatdt=repeatdt,
-                                     start=(10e3, 5000e3), finish=(100e3, 5000e3), time=0)
+        pset = parcels.ParticleSet.from_line(
+            fieldset,
+            size=npart,
+            pclass=MyParticle,
+            repeatdt=repeatdt,
+            start=(10e3, 5000e3),
+            finish=(100e3, 5000e3),
+            time=0,
+        )
 
     if verbose:
         print(f"Initial particle positions:\n{pset}")
 
     maxage = runtime.total_seconds() if maxage is None else maxage
-    fieldset.add_constant('maxage', maxage)
+    fieldset.add_constant("maxage", maxage)
     print("Stommel: Advecting %d particles for %s" % (npart, runtime))
-    timer.psetinit.stop()
-    timer.psetrun = timer.Timer('Pset_run', parent=timer.pset)
-    pset.execute(method + pset.Kernel(UpdateP) + pset.Kernel(AgeP), runtime=runtime, dt=dt,
-                 output_file=pset.ParticleFile(name=outfile, outputdt=outputdt))
+    parcels.timer.psetinit.stop()
+    parcels.timer.psetrun = parcels.timer.Timer("Pset_run", parent=parcels.timer.pset)
+    pset.execute(
+        method + pset.Kernel(UpdateP) + pset.Kernel(AgeP),
+        runtime=runtime,
+        dt=dt,
+        output_file=pset.ParticleFile(name=outfile, outputdt=outputdt),
+    )
 
     if verbose:
         print(f"Final particle positions:\n{pset}")
-    timer.psetrun.stop()
-    timer.pset.stop()
+    parcels.timer.psetrun.stop()
+    parcels.timer.pset.stop()
 
     return pset
 
 
-@pytest.mark.parametrize('grid_type', ['A', 'C'])
-@pytest.mark.parametrize('mode', ['jit', 'scipy'])
+@pytest.mark.parametrize("grid_type", ["A", "C"])
+@pytest.mark.parametrize("mode", ["jit", "scipy"])
 def test_stommel_fieldset(mode, grid_type, tmpdir):
-    timer.root = timer.Timer('Main')
-    timer.stommel = timer.Timer('Stommel', parent=timer.root)
+    parcels.timer.root = parcels.timer.Timer("Main")
+    parcels.timer.stommel = parcels.timer.Timer("Stommel", parent=parcels.timer.root)
     outfile = tmpdir.join("StommelParticle")
-    psetRK4 = stommel_example(1, mode=mode, method=method['RK4'], grid_type=grid_type, outfile=outfile, write_fields=False)
-    psetRK45 = stommel_example(1, mode=mode, method=method['RK45'], grid_type=grid_type, outfile=outfile, write_fields=False)
+    psetRK4 = stommel_example(
+        1,
+        mode=mode,
+        method=method["RK4"],
+        grid_type=grid_type,
+        outfile=outfile,
+        write_fields=False,
+    )
+    psetRK45 = stommel_example(
+        1,
+        mode=mode,
+        method=method["RK45"],
+        grid_type=grid_type,
+        outfile=outfile,
+        write_fields=False,
+    )
     assert np.allclose(psetRK4.lon, psetRK45.lon, rtol=1e-3)
     assert np.allclose(psetRK4.lat, psetRK45.lat, rtol=1.1e-3)
     err_adv = np.abs(psetRK4.p_start - psetRK4.p)
-    assert (err_adv <= 1.e-1).all()
-    err_smpl = np.array([abs(psetRK4.p[i] - psetRK4.fieldset.P[0., psetRK4.lon[i], psetRK4.lat[i], psetRK4.depth[i]]) for i in range(psetRK4.size)])
-    assert (err_smpl <= 1.e-1).all()
-    timer.stommel.stop()
-    timer.root.stop()
-    timer.root.print_tree()
+    assert (err_adv <= 1.0e-1).all()
+    err_smpl = np.array(
+        [
+            abs(
+                psetRK4.p[i]
+                - psetRK4.fieldset.P[
+                    0.0, psetRK4.lon[i], psetRK4.lat[i], psetRK4.depth[i]
+                ]
+            )
+            for i in range(psetRK4.size)
+        ]
+    )
+    assert (err_smpl <= 1.0e-1).all()
+    parcels.timer.stommel.stop()
+    parcels.timer.root.stop()
+    parcels.timer.root.print_tree()
 
 
 def main(args=None):
-    timer.root = timer.Timer('Main')
-    timer.args = timer.Timer('Args', parent=timer.root)
-    p = ArgumentParser(description="""
-Example of particle advection in the steady-state solution of the Stommel equation""")
-    p.add_argument('mode', choices=('scipy', 'jit'), nargs='?', default='jit',
-                   help='Execution mode for performing computation')
-    p.add_argument('-p', '--particles', type=int, default=1,
-                   help='Number of particles to advect')
-    p.add_argument('-v', '--verbose', action='store_true', default=False,
-                   help='Print particle information before and after execution')
-    p.add_argument('-m', '--method', choices=('RK4', 'EE', 'RK45'), default='RK4',
-                   help='Numerical method used for advection')
-    p.add_argument('-o', '--outfile', default='StommelParticle.zarr',
-                   help='Name of output file')
-    p.add_argument('-r', '--repeatdt', default=None, type=int,
-                   help='repeatdt of the ParticleSet')
-    p.add_argument('-a', '--maxage', default=None, type=int,
-                   help='max age of the particles (after which particles are deleted)')
-    p.add_argument('-wf', '--write_fields', default=True,
-                   help='Write the hydrodynamic fields to NetCDF')
-    p.add_argument('-cpf', '--custom_partition_function', default=False,
-                   help='Use a custom partition_function (for MPI testing purposes)')
+    parcels.timer.root = parcels.timer.Timer("Main")
+    parcels.timer.args = parcels.timer.Timer("Args", parent=parcels.timer.root)
+    p = ArgumentParser(
+        description="""
+Example of particle advection in the steady-state solution of the Stommel equation"""
+    )
+    p.add_argument(
+        "mode",
+        choices=("scipy", "jit"),
+        nargs="?",
+        default="jit",
+        help="Execution mode for performing computation",
+    )
+    p.add_argument(
+        "-p", "--particles", type=int, default=1, help="Number of particles to advect"
+    )
+    p.add_argument(
+        "-v",
+        "--verbose",
+        action="store_true",
+        default=False,
+        help="Print particle information before and after execution",
+    )
+    p.add_argument(
+        "-m",
+        "--method",
+        choices=("RK4", "EE", "RK45"),
+        default="RK4",
+        help="Numerical method used for advection",
+    )
+    p.add_argument(
+        "-o", "--outfile", default="StommelParticle.zarr", help="Name of output file"
+    )
+    p.add_argument(
+        "-r", "--repeatdt", default=None, type=int, help="repeatdt of the ParticleSet"
+    )
+    p.add_argument(
+        "-a",
+        "--maxage",
+        default=None,
+        type=int,
+        help="max age of the particles (after which particles are deleted)",
+    )
+    p.add_argument(
+        "-wf",
+        "--write_fields",
+        default=True,
+        help="Write the hydrodynamic fields to NetCDF",
+    )
+    p.add_argument(
+        "-cpf",
+        "--custom_partition_function",
+        default=False,
+        help="Use a custom partition_function (for MPI testing purposes)",
+    )
     args = p.parse_args(args)
 
-    timer.args.stop()
-    timer.stommel = timer.Timer('Stommel', parent=timer.root)
-    stommel_example(args.particles, mode=args.mode, verbose=args.verbose, method=method[args.method],
-                    outfile=args.outfile, repeatdt=args.repeatdt, maxage=args.maxage, write_fields=args.write_fields,
-                    custom_partition_function=args.custom_partition_function)
-    timer.stommel.stop()
-    timer.root.stop()
-    timer.root.print_tree()
+    parcels.timer.args.stop()
+    parcels.timer.stommel = parcels.timer.Timer("Stommel", parent=parcels.timer.root)
+    stommel_example(
+        args.particles,
+        mode=args.mode,
+        verbose=args.verbose,
+        method=method[args.method],
+        outfile=args.outfile,
+        repeatdt=args.repeatdt,
+        maxage=args.maxage,
+        write_fields=args.write_fields,
+        custom_partition_function=args.custom_partition_function,
+    )
+    parcels.timer.stommel.stop()
+    parcels.timer.root.stop()
+    parcels.timer.root.print_tree()
 
 
 if __name__ == "__main__":
diff --git a/docs/examples/parcels_tutorial.ipynb b/docs/examples/parcels_tutorial.ipynb
index 62acc6f18..c98513f6c 100644
--- a/docs/examples/parcels_tutorial.ipynb
+++ b/docs/examples/parcels_tutorial.ipynb
@@ -49,14 +49,7 @@
     "from IPython.display import HTML\n",
     "from matplotlib.animation import FuncAnimation\n",
     "\n",
-    "from parcels import (\n",
-    "    AdvectionRK4,\n",
-    "    FieldSet,\n",
-    "    JITParticle,\n",
-    "    ParticleSet,\n",
-    "    Variable,\n",
-    "    download_example_dataset,\n",
-    ")"
+    "import parcels"
    ]
   },
   {
@@ -81,9 +74,9 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "example_dataset_folder = download_example_dataset(\"MovingEddies_data\")\n",
+    "example_dataset_folder = parcels.download_example_dataset(\"MovingEddies_data\")\n",
     "\n",
-    "fieldset = FieldSet.from_parcels(f\"{example_dataset_folder}/moving_eddies\")"
+    "fieldset = parcels.FieldSet.from_parcels(f\"{example_dataset_folder}/moving_eddies\")"
    ]
   },
   {
@@ -134,9 +127,9 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "pset = ParticleSet.from_list(\n",
+    "pset = parcels.ParticleSet.from_list(\n",
     "    fieldset=fieldset,  # the fields on which the particles are advected\n",
-    "    pclass=JITParticle,  # the type of particles (JITParticle or ScipyParticle)\n",
+    "    pclass=parcels.JITParticle,  # the type of particles (JITParticle or ScipyParticle)\n",
     "    lon=[3.3e5, 3.3e5],  # a vector of release longitudes\n",
     "    lat=[1e5, 2.8e5],  # a vector of release latitudes\n",
     ")"
@@ -238,7 +231,7 @@
     "    outputdt=timedelta(hours=1),  # the time step of the outputs\n",
     ")\n",
     "pset.execute(\n",
-    "    AdvectionRK4,  # the kernel (which defines how particles move)\n",
+    "    parcels.AdvectionRK4,  # the kernel (which defines how particles move)\n",
     "    runtime=timedelta(days=6),  # the total length of the run\n",
     "    dt=timedelta(minutes=5),  # the timestep of the kernel\n",
     "    output_file=output_file,\n",
@@ -13211,7 +13204,7 @@
     "    outputdt=timedelta(hours=1),  # the time step of the outputs\n",
     ")\n",
     "pset.execute(\n",
-    "    AdvectionRK4,\n",
+    "    parcels.AdvectionRK4,\n",
     "    dt=-timedelta(minutes=5),  # negative timestep for backward run\n",
     "    runtime=timedelta(days=6),  # the run time\n",
     "    output_file=output_file,\n",
@@ -13328,15 +13321,15 @@
     }
    ],
    "source": [
-    "pset = ParticleSet.from_list(\n",
-    "    fieldset=fieldset, pclass=JITParticle, lon=[3.3e5, 3.3e5], lat=[1e5, 2.8e5]\n",
+    "pset = parcels.ParticleSet.from_list(\n",
+    "    fieldset=fieldset, pclass=parcels.JITParticle, lon=[3.3e5, 3.3e5], lat=[1e5, 2.8e5]\n",
     ")\n",
     "\n",
     "output_file = pset.ParticleFile(\n",
     "    name=\"EddyParticles_WestVel.zarr\", outputdt=timedelta(hours=1)\n",
     ")\n",
     "pset.execute(\n",
-    "    [AdvectionRK4, WestVel],  # simply combine the Kernels in a list\n",
+    "    [parcels.AdvectionRK4, WestVel],  # simply combine the Kernels in a list\n",
     "    runtime=timedelta(days=2),\n",
     "    dt=timedelta(minutes=5),\n",
     "    output_file=output_file,\n",
@@ -13416,7 +13409,7 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "example_dataset_folder = download_example_dataset(\"GlobCurrent_example_data\")\n",
+    "example_dataset_folder = parcels.download_example_dataset(\"GlobCurrent_example_data\")\n",
     "\n",
     "filenames = {\n",
     "    \"U\": f\"{example_dataset_folder}/20*.nc\",\n",
@@ -13459,7 +13452,7 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "fieldset = FieldSet.from_netcdf(filenames, variables, dimensions)"
+    "fieldset = parcels.FieldSet.from_netcdf(filenames, variables, dimensions)"
    ]
   },
   {
@@ -13476,9 +13469,9 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "pset = ParticleSet.from_line(\n",
+    "pset = parcels.ParticleSet.from_line(\n",
     "    fieldset=fieldset,\n",
-    "    pclass=JITParticle,\n",
+    "    pclass=parcels.JITParticle,\n",
     "    size=5,  # releasing 5 particles\n",
     "    start=(28, -33),  # releasing on a line: the start longitude and latitude\n",
     "    finish=(30, -33),  # releasing on a line: the end longitude and latitude\n",
@@ -13512,7 +13505,7 @@
     "    name=\"GlobCurrentParticles.zarr\", outputdt=timedelta(hours=6)\n",
     ")\n",
     "pset.execute(\n",
-    "    AdvectionRK4,\n",
+    "    parcels.AdvectionRK4,\n",
     "    runtime=timedelta(days=10),\n",
     "    dt=timedelta(minutes=5),\n",
     "    output_file=output_file,\n",
@@ -13579,8 +13572,8 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "example_dataset_folder = download_example_dataset(\"Peninsula_data\")\n",
-    "fieldset = FieldSet.from_parcels(\n",
+    "example_dataset_folder = parcels.download_example_dataset(\"Peninsula_data\")\n",
+    "fieldset = parcels.FieldSet.from_parcels(\n",
     "    f\"{example_dataset_folder}/peninsula\",\n",
     "    extra_fields={\"P\": \"P\"},\n",
     "    allow_time_extrapolation=True,\n",
@@ -13601,7 +13594,7 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "SampleParticle = JITParticle.add_variable(\"p\")"
+    "SampleParticle = parcels.JITParticle.add_variable(\"p\")"
    ]
   },
   {
@@ -13642,7 +13635,7 @@
     }
    ],
    "source": [
-    "pset = ParticleSet.from_line(\n",
+    "pset = parcels.ParticleSet.from_line(\n",
     "    fieldset=fieldset,\n",
     "    pclass=SampleParticle,\n",
     "    start=(3000, 3000),\n",
@@ -13706,7 +13699,7 @@
     "    name=\"PeninsulaPressure.zarr\", outputdt=timedelta(hours=1)\n",
     ")\n",
     "pset.execute(\n",
-    "    [AdvectionRK4, SampleP],  # list of kernels to be executed\n",
+    "    [parcels.AdvectionRK4, SampleP],  # list of kernels to be executed\n",
     "    runtime=timedelta(hours=20),\n",
     "    dt=timedelta(minutes=5),\n",
     "    output_file=output_file,\n",
@@ -13787,12 +13780,16 @@
    "outputs": [],
    "source": [
     "extra_vars = [\n",
-    "    Variable(\"distance\", initial=0.0, dtype=np.float32),\n",
-    "    Variable(\"prev_lon\", dtype=np.float32, to_write=False, initial=attrgetter(\"lon\")),\n",
-    "    Variable(\"prev_lat\", dtype=np.float32, to_write=False, initial=attrgetter(\"lat\")),\n",
+    "    parcels.Variable(\"distance\", initial=0.0, dtype=np.float32),\n",
+    "    parcels.Variable(\n",
+    "        \"prev_lon\", dtype=np.float32, to_write=False, initial=attrgetter(\"lon\")\n",
+    "    ),\n",
+    "    parcels.Variable(\n",
+    "        \"prev_lat\", dtype=np.float32, to_write=False, initial=attrgetter(\"lat\")\n",
+    "    ),\n",
     "]\n",
     "\n",
-    "DistParticle = JITParticle.add_variables(extra_vars)"
+    "DistParticle = parcels.JITParticle.add_variables(extra_vars)"
    ]
   },
   {
@@ -13848,7 +13845,7 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "example_dataset_folder = download_example_dataset(\"GlobCurrent_example_data\")\n",
+    "example_dataset_folder = parcels.download_example_dataset(\"GlobCurrent_example_data\")\n",
     "filenames = {\n",
     "    \"U\": f\"{example_dataset_folder}/20*.nc\",\n",
     "    \"V\": f\"{example_dataset_folder}/20*.nc\",\n",
@@ -13858,8 +13855,8 @@
     "    \"V\": \"northward_eulerian_current_velocity\",\n",
     "}\n",
     "dimensions = {\"lat\": \"lat\", \"lon\": \"lon\", \"time\": \"time\"}\n",
-    "fieldset = FieldSet.from_netcdf(filenames, variables, dimensions)\n",
-    "pset = ParticleSet.from_line(\n",
+    "fieldset = parcels.FieldSet.from_netcdf(filenames, variables, dimensions)\n",
+    "pset = parcels.ParticleSet.from_line(\n",
     "    fieldset=fieldset, pclass=DistParticle, size=5, start=(28, -33), finish=(30, -33)\n",
     ")"
    ]
@@ -13888,7 +13885,7 @@
    ],
    "source": [
     "pset.execute(\n",
-    "    [AdvectionRK4, TotalDistance],  # list of kernels to be executed\n",
+    "    [parcels.AdvectionRK4, TotalDistance],  # list of kernels to be executed\n",
     "    runtime=timedelta(days=6),\n",
     "    dt=timedelta(minutes=5),\n",
     "    output_file=pset.ParticleFile(\n",
diff --git a/docs/examples/tutorial_Argofloats.ipynb b/docs/examples/tutorial_Argofloats.ipynb
index 96c5ab81b..368a12068 100644
--- a/docs/examples/tutorial_Argofloats.ipynb
+++ b/docs/examples/tutorial_Argofloats.ipynb
@@ -103,18 +103,10 @@
     "\n",
     "import numpy as np\n",
     "\n",
-    "from parcels import (\n",
-    "    AdvectionRK4,\n",
-    "    FieldSet,\n",
-    "    JITParticle,\n",
-    "    ParticleSet,\n",
-    "    StatusCode,\n",
-    "    Variable,\n",
-    "    download_example_dataset,\n",
-    ")\n",
+    "import parcels\n",
     "\n",
     "# Load the GlobCurrent data in the Agulhas region from the example_data\n",
-    "example_dataset_folder = download_example_dataset(\"GlobCurrent_example_data\")\n",
+    "example_dataset_folder = parcels.download_example_dataset(\"GlobCurrent_example_data\")\n",
     "filenames = {\n",
     "    \"U\": f\"{example_dataset_folder}/20*.nc\",\n",
     "    \"V\": f\"{example_dataset_folder}/20*.nc\",\n",
@@ -124,13 +116,13 @@
     "    \"V\": \"northward_eulerian_current_velocity\",\n",
     "}\n",
     "dimensions = {\"lat\": \"lat\", \"lon\": \"lon\", \"time\": \"time\"}\n",
-    "fieldset = FieldSet.from_netcdf(filenames, variables, dimensions)\n",
+    "fieldset = parcels.FieldSet.from_netcdf(filenames, variables, dimensions)\n",
     "# uppermost layer in the hydrodynamic data\n",
     "fieldset.mindepth = fieldset.U.depth[0]\n",
     "\n",
     "\n",
     "# Define a new Particle type including extra Variables\n",
-    "ArgoParticle = JITParticle.add_variables(\n",
+    "ArgoParticle = parcels.JITParticle.add_variables(\n",
     "    [\n",
     "        # Phase of cycle:\n",
     "        # init_descend=0,\n",
@@ -138,21 +130,21 @@
     "        # profile_descend=2,\n",
     "        # profile_ascend=3,\n",
     "        # transmit=4\n",
-    "        Variable(\"cycle_phase\", dtype=np.int32, initial=0.0),\n",
-    "        Variable(\"cycle_age\", dtype=np.float32, initial=0.0),\n",
-    "        Variable(\"drift_age\", dtype=np.float32, initial=0.0),\n",
+    "        parcels.Variable(\"cycle_phase\", dtype=np.int32, initial=0.0),\n",
+    "        parcels.Variable(\"cycle_age\", dtype=np.float32, initial=0.0),\n",
+    "        parcels.Variable(\"drift_age\", dtype=np.float32, initial=0.0),\n",
     "        # if fieldset has temperature\n",
     "        # Variable('temp', dtype=np.float32, initial=np.nan),\n",
     "    ]\n",
     ")\n",
     "\n",
     "# Initiate one Argo float in the Agulhas Current\n",
-    "pset = ParticleSet(\n",
+    "pset = parcels.ParticleSet(\n",
     "    fieldset=fieldset, pclass=ArgoParticle, lon=[32], lat=[-31], depth=[0]\n",
     ")\n",
     "\n",
     "# combine Argo vertical movement kernel with built-in Advection kernel\n",
-    "kernels = [ArgoVerticalMovement, AdvectionRK4]\n",
+    "kernels = [ArgoVerticalMovement, parcels.AdvectionRK4]\n",
     "\n",
     "# Create a ParticleFile object to store the output\n",
     "output_file = pset.ParticleFile(\n",
diff --git a/docs/examples/tutorial_NestedFields.ipynb b/docs/examples/tutorial_NestedFields.ipynb
index 664e01365..9ea16da61 100644
--- a/docs/examples/tutorial_NestedFields.ipynb
+++ b/docs/examples/tutorial_NestedFields.ipynb
@@ -46,7 +46,7 @@
     "import numpy as np\n",
     "import xarray as xr\n",
     "\n",
-    "from parcels import AdvectionRK4, Field, FieldSet, JITParticle, NestedField, ParticleSet"
+    "import parcels"
    ]
   },
   {
@@ -68,8 +68,8 @@
     "lat = np.linspace(0.0, 2e3, dim, dtype=np.float32)\n",
     "lon_g, lat_g = np.meshgrid(lon, lat)\n",
     "V1_data = np.cos(lon_g / 200 * np.pi / 2)\n",
-    "U1 = Field(\"U1\", np.ones((dim, dim), dtype=np.float32), lon=lon, lat=lat)\n",
-    "V1 = Field(\"V1\", V1_data, grid=U1.grid)"
+    "U1 = parcels.Field(\"U1\", np.ones((dim, dim), dtype=np.float32), lon=lon, lat=lat)\n",
+    "V1 = parcels.Field(\"V1\", V1_data, grid=U1.grid)"
    ]
   },
   {
@@ -92,8 +92,8 @@
     "lat = np.linspace(-1e3, 3e3, ydim, dtype=np.float32)\n",
     "lon_g, lat_g = np.meshgrid(lon, lat)\n",
     "V2_data = np.cos(lon_g / 200 * np.pi / 2)\n",
-    "U2 = Field(\"U2\", np.ones((ydim, xdim), dtype=np.float32), lon=lon, lat=lat)\n",
-    "V2 = Field(\"V2\", V2_data, grid=U2.grid)"
+    "U2 = parcels.Field(\"U2\", np.ones((ydim, xdim), dtype=np.float32), lon=lon, lat=lat)\n",
+    "V2 = parcels.Field(\"V2\", V2_data, grid=U2.grid)"
    ]
   },
   {
@@ -110,9 +110,9 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "U = NestedField(\"U\", [U1, U2])\n",
-    "V = NestedField(\"V\", [V1, V2])\n",
-    "fieldset = FieldSet(U, V)"
+    "U = parcels.NestedField(\"U\", [U1, U2])\n",
+    "V = parcels.NestedField(\"V\", [V1, V2])\n",
+    "fieldset = parcels.FieldSet(U, V)"
    ]
   },
   {
@@ -140,13 +140,13 @@
     }
    ],
    "source": [
-    "pset = ParticleSet(fieldset, pclass=JITParticle, lon=[0], lat=[1000])\n",
+    "pset = parcels.ParticleSet(fieldset, pclass=parcels.JITParticle, lon=[0], lat=[1000])\n",
     "\n",
     "output_file = pset.ParticleFile(\n",
     "    name=\"NestedFieldParticle.zarr\", outputdt=50, chunks=(1, 100)\n",
     ")\n",
     "\n",
-    "pset.execute(AdvectionRK4, runtime=14000, dt=10, output_file=output_file)\n",
+    "pset.execute(parcels.AdvectionRK4, runtime=14000, dt=10, output_file=output_file)\n",
     "\n",
     "ds = xr.open_zarr(\"NestedFieldParticle.zarr\")\n",
     "plt.plot(ds.lon.T, ds.lat.T, \".-\")\n",
@@ -197,15 +197,15 @@
    "outputs": [],
    "source": [
     "# Need to redefine fieldset\n",
-    "fieldset = FieldSet(U, V)\n",
+    "fieldset = parcels.FieldSet(U, V)\n",
     "\n",
     "ones_array1 = np.ones((U1.grid.ydim, U1.grid.xdim), dtype=np.float32)\n",
-    "F1 = Field(\"F1\", ones_array1, grid=U1.grid)\n",
+    "F1 = parcels.Field(\"F1\", ones_array1, grid=U1.grid)\n",
     "\n",
     "ones_array2 = np.ones((U2.grid.ydim, U2.grid.xdim), dtype=np.float32)\n",
-    "F2 = Field(\"F2\", 2 * ones_array2, grid=U2.grid)\n",
+    "F2 = parcels.Field(\"F2\", 2 * ones_array2, grid=U2.grid)\n",
     "\n",
-    "F = NestedField(\"F\", [F1, F2])\n",
+    "F = parcels.NestedField(\"F\", [F1, F2])\n",
     "fieldset.add_field(F)"
    ]
   },
@@ -230,9 +230,9 @@
     "    particle.f = fieldset.F[time, particle.depth, particle.lat, particle.lon]\n",
     "\n",
     "\n",
-    "SampleParticle = JITParticle.add_variable(\"f\", dtype=np.int32)\n",
+    "SampleParticle = parcels.JITParticle.add_variable(\"f\", dtype=np.int32)\n",
     "\n",
-    "pset = ParticleSet(fieldset, pclass=SampleParticle, lon=[1000], lat=[500])\n",
+    "pset = parcels.ParticleSet(fieldset, pclass=SampleParticle, lon=[1000], lat=[500])\n",
     "pset.execute(SampleNestedFieldIndex, runtime=1)\n",
     "print(\n",
     "    f\"Particle ({pset[0].lon:g}, {pset[0].lat:g}) \"\n",
diff --git a/docs/examples/tutorial_analyticaladvection.ipynb b/docs/examples/tutorial_analyticaladvection.ipynb
index 84d7f96dc..59f036ea9 100644
--- a/docs/examples/tutorial_analyticaladvection.ipynb
+++ b/docs/examples/tutorial_analyticaladvection.ipynb
@@ -52,7 +52,7 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "from datetime import timedelta as delta\n",
+    "from datetime import timedelta\n",
     "\n",
     "import matplotlib.pyplot as plt\n",
     "import numpy as np\n",
@@ -60,15 +60,7 @@
     "from IPython.display import HTML\n",
     "from matplotlib.animation import FuncAnimation\n",
     "\n",
-    "from parcels import (\n",
-    "    AdvectionAnalytical,\n",
-    "    AdvectionRK4,\n",
-    "    FieldSet,\n",
-    "    JITParticle,\n",
-    "    ParticleSet,\n",
-    "    ScipyParticle,\n",
-    "    Variable,\n",
-    ")"
+    "import parcels"
    ]
   },
   {
@@ -102,7 +94,7 @@
     "    def calc_r_phi(ln, lt):\n",
     "        return np.sqrt(ln**2 + lt**2), np.arctan2(ln, lt)\n",
     "\n",
-    "    omega = 2 * np.pi / delta(days=1).total_seconds()\n",
+    "    omega = 2 * np.pi / timedelta(days=1).total_seconds()\n",
     "    for i in range(lon.size):\n",
     "        for j in range(lat.size):\n",
     "            r, phi = calc_r_phi(lon[i], lat[j])\n",
@@ -114,7 +106,7 @@
     "\n",
     "    data = {\"U\": U, \"V\": V, \"R\": R}\n",
     "    dimensions = {\"lon\": lon, \"lat\": lat}\n",
-    "    fieldset = FieldSet.from_data(data, dimensions, mesh=\"flat\")\n",
+    "    fieldset = parcels.FieldSet.from_data(data, dimensions, mesh=\"flat\")\n",
     "    fieldset.U.interp_method = \"cgrid_velocity\"\n",
     "    fieldset.V.interp_method = \"cgrid_velocity\"\n",
     "    return fieldset\n",
@@ -154,22 +146,22 @@
     "    particle.radius = fieldset.R[time, particle.depth, particle.lat, particle.lon]\n",
     "\n",
     "\n",
-    "MyParticle = ScipyParticle.add_variables(\n",
+    "MyParticle = parcels.ScipyParticle.add_variables(\n",
     "    [\n",
-    "        Variable(\"radius\", dtype=np.float32, initial=0.0),\n",
-    "        Variable(\"radius_start\", dtype=np.float32, initial=0.0),\n",
+    "        parcels.Variable(\"radius\", dtype=np.float32, initial=0.0),\n",
+    "        parcels.Variable(\"radius_start\", dtype=np.float32, initial=0.0),\n",
     "    ]\n",
     ")\n",
     "\n",
     "\n",
-    "pset = ParticleSet(fieldsetRR, pclass=MyParticle, lon=0, lat=4e3, time=0)\n",
+    "pset = parcels.ParticleSet(fieldsetRR, pclass=MyParticle, lon=0, lat=4e3, time=0)\n",
     "\n",
-    "output = pset.ParticleFile(name=\"radialAnalytical.zarr\", outputdt=delta(hours=1))\n",
+    "output = pset.ParticleFile(name=\"radialAnalytical.zarr\", outputdt=timedelta(hours=1))\n",
     "\n",
     "pset.execute(\n",
-    "    pset.Kernel(UpdateR) + AdvectionAnalytical,\n",
-    "    runtime=delta(hours=25),\n",
-    "    dt=delta(hours=1),  # needs to be the same as outputdt for Analytical Advection\n",
+    "    pset.Kernel(UpdateR) + parcels.AdvectionAnalytical,\n",
+    "    runtime=timedelta(hours=25),\n",
+    "    dt=timedelta(hours=1),  # needs to be the same as outputdt for Analytical Advection\n",
     "    output_file=output,\n",
     ")"
    ]
@@ -273,7 +265,7 @@
     "    data = {\"U\": U, \"V\": V}\n",
     "    dimensions = {\"lon\": lon, \"lat\": lat, \"time\": times}\n",
     "    allow_time_extrapolation = True if len(times) == 1 else False\n",
-    "    fieldset = FieldSet.from_data(\n",
+    "    fieldset = parcels.FieldSet.from_data(\n",
     "        data, dimensions, mesh=\"flat\", allow_time_extrapolation=allow_time_extrapolation\n",
     "    )\n",
     "    fieldset.U.interp_method = \"cgrid_velocity\"\n",
@@ -309,12 +301,12 @@
    "source": [
     "X, Y = np.meshgrid(np.arange(0.15, 1.85, 0.1), np.arange(0.15, 0.85, 0.1))\n",
     "\n",
-    "psetAA = ParticleSet(fieldsetDG, pclass=ScipyParticle, lon=X, lat=Y)\n",
+    "psetAA = parcels.ParticleSet(fieldsetDG, pclass=parcels.ScipyParticle, lon=X, lat=Y)\n",
     "\n",
     "output = psetAA.ParticleFile(name=\"doublegyreAA.zarr\", outputdt=0.1)\n",
     "\n",
     "psetAA.execute(\n",
-    "    AdvectionAnalytical,\n",
+    "    parcels.AdvectionAnalytical,\n",
     "    dt=0.1,  # needs to be the same as outputdt for Analytical Advection\n",
     "    runtime=3,\n",
     "    output_file=output,\n",
@@ -14699,8 +14691,8 @@
     }
    ],
    "source": [
-    "psetRK4 = ParticleSet(fieldsetDG, pclass=JITParticle, lon=X, lat=Y)\n",
-    "psetRK4.execute(AdvectionRK4, dt=0.01, runtime=3)"
+    "psetRK4 = parcels.ParticleSet(fieldsetDG, pclass=parcels.JITParticle, lon=X, lat=Y)\n",
+    "psetRK4.execute(parcels.AdvectionRK4, dt=0.01, runtime=3)"
    ]
   },
   {
@@ -14807,7 +14799,7 @@
     "    data = {\"U\": U, \"V\": V, \"P\": P}\n",
     "    dimensions = {\"lon\": lon, \"lat\": lat, \"time\": times}\n",
     "    allow_time_extrapolation = True if len(times) == 1 else False\n",
-    "    fieldset = FieldSet.from_data(\n",
+    "    fieldset = parcels.FieldSet.from_data(\n",
     "        data, dimensions, mesh=\"flat\", allow_time_extrapolation=allow_time_extrapolation\n",
     "    )\n",
     "    fieldset.U.interp_method = \"cgrid_velocity\"\n",
@@ -14869,14 +14861,16 @@
    "source": [
     "X, Y = np.meshgrid(np.arange(0, 19900, 100), np.arange(-100, 100, 100))\n",
     "\n",
-    "psetAA = ParticleSet(fieldsetBJ, pclass=ScipyParticle, lon=X, lat=Y, time=0)\n",
+    "psetAA = parcels.ParticleSet(\n",
+    "    fieldsetBJ, pclass=parcels.ScipyParticle, lon=X, lat=Y, time=0\n",
+    ")\n",
     "\n",
-    "output = psetAA.ParticleFile(name=\"bickleyjetAA.zarr\", outputdt=delta(hours=1))\n",
+    "output = psetAA.ParticleFile(name=\"bickleyjetAA.zarr\", outputdt=timedelta(hours=1))\n",
     "\n",
     "psetAA.execute(\n",
-    "    AdvectionAnalytical + psetAA.Kernel(ZonalBC),\n",
-    "    dt=delta(hours=1),  # needs to be the same as outputdt for Analytical Advection\n",
-    "    runtime=delta(days=1),\n",
+    "    parcels.AdvectionAnalytical + psetAA.Kernel(ZonalBC),\n",
+    "    dt=timedelta(hours=1),  # needs to be the same as outputdt for Analytical Advection\n",
+    "    runtime=timedelta(days=1),\n",
     "    output_file=output,\n",
     ")"
    ]
@@ -28012,9 +28006,11 @@
     }
    ],
    "source": [
-    "psetRK4 = ParticleSet(fieldsetBJ, pclass=JITParticle, lon=X, lat=Y)\n",
+    "psetRK4 = parcels.ParticleSet(fieldsetBJ, pclass=parcels.JITParticle, lon=X, lat=Y)\n",
     "\n",
-    "psetRK4.execute([AdvectionRK4, ZonalBC], dt=delta(minutes=5), runtime=delta(days=1))"
+    "psetRK4.execute(\n",
+    "    [parcels.AdvectionRK4, ZonalBC], dt=timedelta(minutes=5), runtime=timedelta(days=1)\n",
+    ")"
    ]
   },
   {
diff --git a/docs/examples/tutorial_delaystart.ipynb b/docs/examples/tutorial_delaystart.ipynb
index 68d0bce87..1ed477b14 100644
--- a/docs/examples/tutorial_delaystart.ipynb
+++ b/docs/examples/tutorial_delaystart.ipynb
@@ -24,7 +24,7 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "from datetime import timedelta as delta\n",
+    "from datetime import timedelta\n",
     "\n",
     "import matplotlib.pyplot as plt\n",
     "import numpy as np\n",
@@ -32,15 +32,7 @@
     "from IPython.display import HTML\n",
     "from matplotlib.animation import FuncAnimation\n",
     "\n",
-    "from parcels import (\n",
-    "    AdvectionRK4,\n",
-    "    FieldSet,\n",
-    "    JITParticle,\n",
-    "    ParticleFile,\n",
-    "    ParticleSet,\n",
-    "    Variable,\n",
-    "    download_example_dataset,\n",
-    ")"
+    "import parcels"
    ]
   },
   {
@@ -57,8 +49,8 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "example_dataset_folder = download_example_dataset(\"Peninsula_data\")\n",
-    "fieldset = FieldSet.from_parcels(\n",
+    "example_dataset_folder = parcels.download_example_dataset(\"Peninsula_data\")\n",
+    "fieldset = parcels.FieldSet.from_parcels(\n",
     "    f\"{example_dataset_folder}/peninsula\", allow_time_extrapolation=True\n",
     ")"
    ]
@@ -98,9 +90,11 @@
     "lat = np.linspace(3e3, 45e3, npart, dtype=np.float32)\n",
     "\n",
     "# release every particle one hour later\n",
-    "time = np.arange(0, npart) * delta(hours=1).total_seconds()\n",
+    "time = np.arange(0, npart) * timedelta(hours=1).total_seconds()\n",
     "\n",
-    "pset = ParticleSet(fieldset=fieldset, pclass=JITParticle, lon=lon, lat=lat, time=time)"
+    "pset = parcels.ParticleSet(\n",
+    "    fieldset=fieldset, pclass=parcels.JITParticle, lon=lon, lat=lat, time=time\n",
+    ")"
    ]
   },
   {
@@ -126,10 +120,15 @@
     }
    ],
    "source": [
-    "output_file = pset.ParticleFile(name=\"DelayParticle_time.zarr\", outputdt=delta(hours=1))\n",
+    "output_file = pset.ParticleFile(\n",
+    "    name=\"DelayParticle_time.zarr\", outputdt=timedelta(hours=1)\n",
+    ")\n",
     "\n",
     "pset.execute(\n",
-    "    AdvectionRK4, runtime=delta(hours=24), dt=delta(minutes=5), output_file=output_file\n",
+    "    parcels.AdvectionRK4,\n",
+    "    runtime=timedelta(hours=24),\n",
+    "    dt=timedelta(minutes=5),\n",
+    "    output_file=output_file,\n",
     ")"
    ]
   },
@@ -10046,10 +10045,10 @@
     "npart = 10  # number of particles to be released\n",
     "lon = 3e3 * np.ones(npart)\n",
     "lat = np.linspace(3e3, 45e3, npart, dtype=np.float32)\n",
-    "repeatdt = delta(hours=3)  # release from the same set of locations every 3h\n",
+    "repeatdt = timedelta(hours=3)  # release from the same set of locations every 3h\n",
     "\n",
-    "pset = ParticleSet(\n",
-    "    fieldset=fieldset, pclass=JITParticle, lon=lon, lat=lat, repeatdt=repeatdt\n",
+    "pset = parcels.ParticleSet(\n",
+    "    fieldset=fieldset, pclass=parcels.JITParticle, lon=lon, lat=lat, repeatdt=repeatdt\n",
     ")"
    ]
   },
@@ -10077,10 +10076,15 @@
     }
    ],
    "source": [
-    "output_file = pset.ParticleFile(name=\"DelayParticle_releasedt\", outputdt=delta(hours=1))\n",
+    "output_file = pset.ParticleFile(\n",
+    "    name=\"DelayParticle_releasedt\", outputdt=timedelta(hours=1)\n",
+    ")\n",
     "\n",
     "pset.execute(\n",
-    "    AdvectionRK4, runtime=delta(hours=24), dt=delta(minutes=5), output_file=output_file\n",
+    "    parcels.AdvectionRK4,\n",
+    "    runtime=timedelta(hours=24),\n",
+    "    dt=timedelta(minutes=5),\n",
+    "    output_file=output_file,\n",
     ")"
    ]
   },
@@ -21258,16 +21262,19 @@
     }
    ],
    "source": [
-    "pset = ParticleSet(\n",
-    "    fieldset=fieldset, pclass=JITParticle, lon=lon, lat=lat, repeatdt=repeatdt\n",
+    "pset = parcels.ParticleSet(\n",
+    "    fieldset=fieldset, pclass=parcels.JITParticle, lon=lon, lat=lat, repeatdt=repeatdt\n",
     ")\n",
     "output_file = pset.ParticleFile(\n",
-    "    name=\"DelayParticle_releasedt_9hrs\", outputdt=delta(hours=1)\n",
+    "    name=\"DelayParticle_releasedt_9hrs\", outputdt=timedelta(hours=1)\n",
     ")\n",
     "\n",
     "# first run for 3 * 3 hrs\n",
     "pset.execute(\n",
-    "    AdvectionRK4, runtime=delta(hours=9), dt=delta(minutes=5), output_file=output_file\n",
+    "    parcels.AdvectionRK4,\n",
+    "    runtime=timedelta(hours=9),\n",
+    "    dt=timedelta(minutes=5),\n",
+    "    output_file=output_file,\n",
     ")\n",
     "\n",
     "# now stop the repeated release\n",
@@ -21275,7 +21282,10 @@
     "\n",
     "# now continue running for the remaining 15 hours\n",
     "pset.execute(\n",
-    "    AdvectionRK4, runtime=delta(hours=15), dt=delta(minutes=5), output_file=output_file\n",
+    "    parcels.AdvectionRK4,\n",
+    "    runtime=timedelta(hours=15),\n",
+    "    dt=timedelta(minutes=5),\n",
+    "    output_file=output_file,\n",
     ")"
    ]
   },
@@ -32246,13 +32256,17 @@
    "source": [
     "outfilepath = \"DelayParticle_nonmatchingtime.zarr\"\n",
     "\n",
-    "pset = ParticleSet(\n",
-    "    fieldset=fieldset, pclass=JITParticle, lat=[3e3] * 3, lon=[3e3] * 3, time=[0, 1, 2]\n",
+    "pset = parcels.ParticleSet(\n",
+    "    fieldset=fieldset,\n",
+    "    pclass=parcels.JITParticle,\n",
+    "    lat=[3e3] * 3,\n",
+    "    lon=[3e3] * 3,\n",
+    "    time=[0, 1, 2],\n",
     ")\n",
     "\n",
     "output_file = pset.ParticleFile(name=outfilepath, outputdt=2)\n",
     "pset.execute(\n",
-    "    AdvectionRK4,\n",
+    "    parcels.AdvectionRK4,\n",
     "    endtime=4,\n",
     "    dt=1,\n",
     "    output_file=output_file,\n",
@@ -32324,16 +32338,16 @@
    ],
    "source": [
     "for times in [[0, 2], [1]]:\n",
-    "    pset = ParticleSet(\n",
+    "    pset = parcels.ParticleSet(\n",
     "        fieldset=fieldset,\n",
-    "        pclass=JITParticle,\n",
+    "        pclass=parcels.JITParticle,\n",
     "        lat=[3e3] * len(times),\n",
     "        lon=[3e3] * len(times),\n",
     "        time=times,\n",
     "    )\n",
     "    output_file = pset.ParticleFile(name=outfilepath, outputdt=2)\n",
     "    pset.execute(\n",
-    "        AdvectionRK4,\n",
+    "        parcels.AdvectionRK4,\n",
     "        endtime=4,\n",
     "        dt=1,\n",
     "        output_file=output_file,\n",
@@ -32416,11 +32430,11 @@
     }
    ],
    "source": [
-    "GrowingParticle = JITParticle.add_variables(\n",
+    "GrowingParticle = parcels.JITParticle.add_variables(\n",
     "    [\n",
-    "        Variable(\"mass\", initial=0),\n",
-    "        Variable(\"splittime\", initial=-1),\n",
-    "        Variable(\"splitmass\", initial=0),\n",
+    "        parcels.Variable(\"mass\", initial=0),\n",
+    "        parcels.Variable(\"splittime\", initial=-1),\n",
+    "        parcels.Variable(\"splitmass\", initial=0),\n",
     "    ]\n",
     ")\n",
     "\n",
@@ -32435,8 +32449,8 @@
     "        particle.mass = particle.mass / 2.0\n",
     "\n",
     "\n",
-    "pset = ParticleSet(fieldset=fieldset, pclass=GrowingParticle, lon=0, lat=0)\n",
-    "outfile = ParticleFile(\"growingparticles.zarr\", pset, outputdt=1)\n",
+    "pset = parcels.ParticleSet(fieldset=fieldset, pclass=GrowingParticle, lon=0, lat=0)\n",
+    "outfile = parcels.ParticleFile(\"growingparticles.zarr\", pset, outputdt=1)\n",
     "\n",
     "for t in range(40):\n",
     "    pset.execute(\n",
@@ -32445,7 +32459,7 @@
     "    for p in pset:\n",
     "        if p.splittime > 0:\n",
     "            pset.add(\n",
-    "                ParticleSet(\n",
+    "                parcels.ParticleSet(\n",
     "                    fieldset=fieldset,\n",
     "                    pclass=GrowingParticle,\n",
     "                    lon=0,\n",
diff --git a/docs/examples/tutorial_diffusion.ipynb b/docs/examples/tutorial_diffusion.ipynb
index 33f469f4e..a14dd466d 100644
--- a/docs/examples/tutorial_diffusion.ipynb
+++ b/docs/examples/tutorial_diffusion.ipynb
@@ -117,19 +117,7 @@
     "import trajan as ta\n",
     "import xarray as xr\n",
     "\n",
-    "from parcels import (\n",
-    "    AdvectionDiffusionEM,\n",
-    "    AdvectionDiffusionM1,\n",
-    "    AdvectionRK4,\n",
-    "    DiffusionUniformKh,\n",
-    "    Field,\n",
-    "    FieldSet,\n",
-    "    JITParticle,\n",
-    "    ParcelsRandom,\n",
-    "    ParticleSet,\n",
-    "    StatusCode,\n",
-    "    download_example_dataset,\n",
-    ")"
+    "import parcels"
    ]
   },
   {
@@ -219,7 +207,9 @@
     "    \"Kh_meridional\": Kh_meridional,\n",
     "}\n",
     "dims = {\"lon\": 1, \"lat\": np.linspace(-0.01, 1.01, ydim, dtype=np.float32)}\n",
-    "fieldset = FieldSet.from_data(data, dims, mesh=\"flat\", allow_time_extrapolation=True)\n",
+    "fieldset = parcels.FieldSet.from_data(\n",
+    "    data, dims, mesh=\"flat\", allow_time_extrapolation=True\n",
+    ")\n",
     "fieldset.add_constant(\"dres\", 0.00005)"
    ]
   },
@@ -238,9 +228,9 @@
    "outputs": [],
    "source": [
     "def get_test_particles():\n",
-    "    return ParticleSet.from_list(\n",
+    "    return parcels.ParticleSet.from_list(\n",
     "        fieldset,\n",
-    "        pclass=JITParticle,\n",
+    "        pclass=parcels.JITParticle,\n",
     "        lon=np.zeros(100),\n",
     "        lat=np.ones(100) * 0.75,\n",
     "        time=np.zeros(100),\n",
@@ -278,10 +268,10 @@
     "    name=\"M1_out.zarr\", chunks=(len(testParticles), 50), outputdt=timedelta(seconds=dt)\n",
     ")\n",
     "\n",
-    "ParcelsRandom.seed(1636)  # Random seed for reproducibility\n",
+    "parcels.ParcelsRandom.seed(1636)  # Random seed for reproducibility\n",
     "\n",
     "testParticles.execute(\n",
-    "    AdvectionDiffusionM1,\n",
+    "    parcels.AdvectionDiffusionM1,\n",
     "    runtime=timedelta(seconds=0.3),\n",
     "    dt=timedelta(seconds=dt),\n",
     "    output_file=output_file,\n",
@@ -373,9 +363,9 @@
     "output_file = testParticles.ParticleFile(\n",
     "    name=\"EM_out.zarr\", chunks=(len(testParticles), 50), outputdt=timedelta(seconds=dt)\n",
     ")\n",
-    "ParcelsRandom.seed(1636)  # Random seed for reproducibility\n",
+    "parcels.ParcelsRandom.seed(1636)  # Random seed for reproducibility\n",
     "testParticles.execute(\n",
-    "    AdvectionDiffusionEM,\n",
+    "    parcels.AdvectionDiffusionEM,\n",
     "    runtime=timedelta(seconds=0.3),\n",
     "    dt=timedelta(seconds=dt),\n",
     "    output_file=output_file,\n",
@@ -482,10 +472,10 @@
     "    A = A / sq_deg_to_sq_m\n",
     "    Kh = fieldset.Cs * A * math.sqrt(dudx**2 + 0.5 * (dudy + dvdx) ** 2 + dvdy**2)\n",
     "\n",
-    "    dlat = ParcelsRandom.normalvariate(0.0, 1.0) * math.sqrt(\n",
+    "    dlat = parcels.ParcelsRandom.normalvariate(0.0, 1.0) * math.sqrt(\n",
     "        2 * math.fabs(particle.dt) * Kh\n",
     "    )\n",
-    "    dlon = ParcelsRandom.normalvariate(0.0, 1.0) * math.sqrt(\n",
+    "    dlon = parcels.ParcelsRandom.normalvariate(0.0, 1.0) * math.sqrt(\n",
     "        2 * math.fabs(particle.dt) * Kh\n",
     "    )\n",
     "\n",
@@ -507,7 +497,7 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "example_dataset_folder = download_example_dataset(\"GlobCurrent_example_data\")\n",
+    "example_dataset_folder = parcels.download_example_dataset(\"GlobCurrent_example_data\")\n",
     "filenames = {\n",
     "    \"U\": f\"{example_dataset_folder}/20*.nc\",\n",
     "    \"V\": f\"{example_dataset_folder}/20*.nc\",\n",
@@ -518,7 +508,7 @@
     "}\n",
     "dimensions = {\"lat\": \"lat\", \"lon\": \"lon\", \"time\": \"time\"}\n",
     "\n",
-    "fieldset = FieldSet.from_netcdf(filenames, variables, dimensions)"
+    "fieldset = parcels.FieldSet.from_netcdf(filenames, variables, dimensions)"
    ]
   },
   {
@@ -538,7 +528,9 @@
     "x = fieldset.U.grid.lon\n",
     "y = fieldset.U.grid.lat\n",
     "\n",
-    "cell_areas = Field(name=\"cell_areas\", data=fieldset.U.cell_areas(), lon=x, lat=y)\n",
+    "cell_areas = parcels.Field(\n",
+    "    name=\"cell_areas\", data=fieldset.U.cell_areas(), lon=x, lat=y\n",
+    ")\n",
     "fieldset.add_field(cell_areas)\n",
     "\n",
     "fieldset.add_constant(\"Cs\", 0.1)"
@@ -561,7 +553,9 @@
     "time = np.arange(0, 43200, 3600)\n",
     "lon = [29] * len(time)\n",
     "lat = [-33] * len(time)\n",
-    "pset = ParticleSet(fieldset=fieldset, pclass=JITParticle, lon=lon, lat=lat, time=time)"
+    "pset = parcels.ParticleSet(\n",
+    "    fieldset=fieldset, pclass=parcels.JITParticle, lon=lon, lat=lat, time=time\n",
+    ")"
    ]
   },
   {
@@ -588,7 +582,7 @@
    ],
    "source": [
     "def DeleteParticle(particle, fieldset, time):\n",
-    "    if particle.state == StatusCode.ErrorOutOfBounds:\n",
+    "    if particle.state == parcels.StatusCode.ErrorOutOfBounds:\n",
     "        particle.delete()\n",
     "\n",
     "\n",
@@ -596,10 +590,10 @@
     "    name=\"Global_smagdiff.zarr\", outputdt=timedelta(hours=3), chunks=(1, 57)\n",
     ")\n",
     "\n",
-    "ParcelsRandom.seed(1636)  # Random seed for reproducibility\n",
+    "parcels.ParcelsRandom.seed(1636)  # Random seed for reproducibility\n",
     "\n",
     "pset.execute(\n",
-    "    [AdvectionRK4, smagdiff, DeleteParticle],\n",
+    "    [parcels.AdvectionRK4, smagdiff, DeleteParticle],\n",
     "    runtime=timedelta(days=7),\n",
     "    dt=timedelta(minutes=5),\n",
     "    output_file=output_file,\n",
diff --git a/docs/examples/tutorial_interaction.ipynb b/docs/examples/tutorial_interaction.ipynb
index 2d6d09f81..8ceee2d6a 100644
--- a/docs/examples/tutorial_interaction.ipynb
+++ b/docs/examples/tutorial_interaction.ipynb
@@ -61,16 +61,7 @@
     "from IPython.display import HTML\n",
     "from matplotlib.animation import FuncAnimation\n",
     "\n",
-    "from parcels import (\n",
-    "    DiffusionUniformKh,\n",
-    "    FieldSet,\n",
-    "    MergeWithNearestNeighbor,\n",
-    "    NearestNeighborWithinRange,\n",
-    "    ParticleSet,\n",
-    "    ScipyInteractionParticle,\n",
-    "    ScipyParticle,\n",
-    "    Variable,\n",
-    ")"
+    "import parcels"
    ]
   },
   {
@@ -145,14 +136,16 @@
     "X, Y = np.meshgrid(np.linspace(-1, 1, npart), np.linspace(-1, 1, npart))\n",
     "\n",
     "# Define a fieldset without flow\n",
-    "fieldset = FieldSet.from_data({\"U\": 0, \"V\": 0}, {\"lon\": 0, \"lat\": 0}, mesh=\"flat\")\n",
+    "fieldset = parcels.FieldSet.from_data(\n",
+    "    {\"U\": 0, \"V\": 0}, {\"lon\": 0, \"lat\": 0}, mesh=\"flat\"\n",
+    ")\n",
     "fieldset.add_constant_field(\"Kh_zonal\", 0.0005, mesh=\"flat\")\n",
     "fieldset.add_constant_field(\"Kh_meridional\", 0.0005, mesh=\"flat\")\n",
     "\n",
     "\n",
     "# Create custom particle class with extra variable that indicates\n",
     "# whether the interaction kernel should be executed on this particle.\n",
-    "InteractingParticle = ScipyParticle.add_variable(\n",
+    "InteractingParticle = parcels.ScipyParticle.add_variable(\n",
     "    \"attractor\", dtype=np.bool_, to_write=\"once\"\n",
     ")\n",
     "\n",
@@ -161,7 +154,7 @@
     "    True if i in [int(npart * npart / 2 - 3), int(npart * npart / 2 + 3)] else False\n",
     "    for i in range(npart * npart)\n",
     "]\n",
-    "pset = ParticleSet(\n",
+    "pset = parcels.ParticleSet(\n",
     "    fieldset=fieldset,\n",
     "    pclass=InteractingParticle,\n",
     "    lon=X,\n",
@@ -173,7 +166,7 @@
     "output_file = pset.ParticleFile(name=\"InteractingParticles.zarr\", outputdt=1)\n",
     "\n",
     "pset.execute(\n",
-    "    pyfunc=DiffusionUniformKh,\n",
+    "    pyfunc=parcels.DiffusionUniformKh,\n",
     "    pyfunc_inter=Pull,  # note the pyfunc_inter here\n",
     "    runtime=60,\n",
     "    dt=1,\n",
@@ -30832,21 +30825,23 @@
     "Y = np.random.uniform(-1, 1, size=npart)\n",
     "\n",
     "# Define a fieldset without flow\n",
-    "fieldset = FieldSet.from_data({\"U\": 0, \"V\": 0}, {\"lon\": 0, \"lat\": 0}, mesh=\"flat\")\n",
+    "fieldset = parcels.FieldSet.from_data(\n",
+    "    {\"U\": 0, \"V\": 0}, {\"lon\": 0, \"lat\": 0}, mesh=\"flat\"\n",
+    ")\n",
     "fieldset.add_constant_field(\"Kh_zonal\", 0.0005, mesh=\"flat\")\n",
     "fieldset.add_constant_field(\"Kh_meridional\", 0.0005, mesh=\"flat\")\n",
     "\n",
     "\n",
     "# Create custom InteractionParticle class\n",
     "# with extra variables nearest_neighbor and mass\n",
-    "MergeParticle = ScipyInteractionParticle.add_variables(\n",
+    "MergeParticle = parcels.ScipyInteractionParticle.add_variables(\n",
     "    [\n",
-    "        Variable(\"nearest_neighbor\", dtype=np.int64, to_write=False),\n",
-    "        Variable(\"mass\", initial=1, dtype=np.float32),\n",
+    "        parcels.Variable(\"nearest_neighbor\", dtype=np.int64, to_write=False),\n",
+    "        parcels.Variable(\"mass\", initial=1, dtype=np.float32),\n",
     "    ]\n",
     ")\n",
     "\n",
-    "pset = ParticleSet(\n",
+    "pset = parcels.ParticleSet(\n",
     "    fieldset=fieldset,\n",
     "    pclass=MergeParticle,\n",
     "    lon=X,\n",
@@ -30857,9 +30852,9 @@
     "output_file = pset.ParticleFile(name=\"MergingParticles.zarr\", outputdt=1)\n",
     "\n",
     "pset.execute(\n",
-    "    pyfunc=DiffusionUniformKh,\n",
-    "    pyfunc_inter=pset.InteractionKernel(NearestNeighborWithinRange)\n",
-    "    + MergeWithNearestNeighbor,  # note the pyfunc_inter here\n",
+    "    pyfunc=parcels.DiffusionUniformKh,\n",
+    "    pyfunc_inter=pset.InteractionKernel(parcels.NearestNeighborWithinRange)\n",
+    "    + parcels.MergeWithNearestNeighbor,  # note the pyfunc_inter here\n",
     "    runtime=60,\n",
     "    dt=1,\n",
     "    output_file=output_file,\n",
diff --git a/docs/examples/tutorial_interpolation.ipynb b/docs/examples/tutorial_interpolation.ipynb
index 421bfc830..e41e5b064 100644
--- a/docs/examples/tutorial_interpolation.ipynb
+++ b/docs/examples/tutorial_interpolation.ipynb
@@ -28,7 +28,7 @@
     "import numpy as np\n",
     "from matplotlib import cm\n",
     "\n",
-    "from parcels import FieldSet, JITParticle, ParticleSet"
+    "import parcels"
    ]
   },
   {
@@ -57,7 +57,7 @@
     "    \"P\": np.random.rand(dims[0], dims[1]) + 0.1,\n",
     "}\n",
     "data[\"P\"][1, 1] = 0.0\n",
-    "fieldset = FieldSet.from_data(data, dimensions, mesh=\"flat\")"
+    "fieldset = parcels.FieldSet.from_data(data, dimensions, mesh=\"flat\")"
    ]
   },
   {
@@ -74,7 +74,7 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "SampleParticle = JITParticle.add_variable(\"p\", dtype=np.float32)\n",
+    "SampleParticle = parcels.JITParticle.add_variable(\"p\", dtype=np.float32)\n",
     "\n",
     "\n",
     "def SampleP(particle, fieldset, time):\n",
@@ -114,7 +114,7 @@
     "    )\n",
     "\n",
     "    xv, yv = np.meshgrid(np.linspace(0, 1, 8), np.linspace(0, 1, 8))\n",
-    "    pset[p_interp] = ParticleSet(\n",
+    "    pset[p_interp] = parcels.ParticleSet(\n",
     "        fieldset, pclass=SampleParticle, lon=xv.flatten(), lat=yv.flatten()\n",
     "    )\n",
     "    pset[p_interp].execute(SampleP, endtime=1, dt=1)"
diff --git a/docs/examples/tutorial_jit_vs_scipy.ipynb b/docs/examples/tutorial_jit_vs_scipy.ipynb
index 9ed7774db..5db839c87 100644
--- a/docs/examples/tutorial_jit_vs_scipy.ipynb
+++ b/docs/examples/tutorial_jit_vs_scipy.ipynb
@@ -49,36 +49,30 @@
     }
    ],
    "source": [
-    "from datetime import timedelta as delta\n",
+    "from datetime import timedelta\n",
     "\n",
-    "from parcels import (\n",
-    "    AdvectionRK4,\n",
-    "    FieldSet,\n",
-    "    JITParticle,\n",
-    "    ParticleSet,\n",
-    "    ScipyParticle,\n",
-    "    download_example_dataset,\n",
-    "    timer,\n",
-    ")\n",
+    "import parcels\n",
     "\n",
-    "timer.root = timer.Timer(\"root\")\n",
+    "parcels.timer.root = parcels.timer.Timer(\"root\")\n",
     "\n",
-    "timer.fieldset = timer.Timer(\"fieldset creation\", parent=timer.root)\n",
+    "parcels.timer.fieldset = parcels.timer.Timer(\n",
+    "    \"fieldset creation\", parent=parcels.timer.root\n",
+    ")\n",
     "\n",
-    "example_dataset_folder = download_example_dataset(\"Peninsula_data\")\n",
-    "fieldset = FieldSet.from_parcels(\n",
+    "example_dataset_folder = parcels.download_example_dataset(\"Peninsula_data\")\n",
+    "fieldset = parcels.FieldSet.from_parcels(\n",
     "    f\"{example_dataset_folder}/peninsula\", allow_time_extrapolation=True\n",
     ")\n",
-    "timer.fieldset.stop()\n",
+    "parcels.timer.fieldset.stop()\n",
     "\n",
-    "ptype = {\"scipy\": ScipyParticle, \"jit\": JITParticle}\n",
+    "ptype = {\"scipy\": parcels.ScipyParticle, \"jit\": parcels.JITParticle}\n",
     "ptimer = {\n",
-    "    \"scipy\": timer.Timer(\"scipy\", parent=timer.root, start=False),\n",
-    "    \"jit\": timer.Timer(\"jit\", parent=timer.root, start=False),\n",
+    "    \"scipy\": parcels.timer.Timer(\"scipy\", parent=parcels.timer.root, start=False),\n",
+    "    \"jit\": parcels.timer.Timer(\"jit\", parent=parcels.timer.root, start=False),\n",
     "}\n",
     "\n",
     "for p in [\"scipy\", \"jit\"]:\n",
-    "    pset = ParticleSet.from_line(\n",
+    "    pset = parcels.ParticleSet.from_line(\n",
     "        fieldset=fieldset,\n",
     "        pclass=ptype[p],\n",
     "        size=100,\n",
@@ -87,11 +81,13 @@
     "    )\n",
     "\n",
     "    ptimer[p].start()\n",
-    "    pset.execute(AdvectionRK4, runtime=delta(hours=1), dt=delta(seconds=30))\n",
+    "    pset.execute(\n",
+    "        parcels.AdvectionRK4, runtime=timedelta(hours=1), dt=timedelta(seconds=30)\n",
+    "    )\n",
     "    ptimer[p].stop()\n",
     "\n",
-    "timer.root.stop()\n",
-    "timer.root.print_tree()"
+    "parcels.timer.root.stop()\n",
+    "parcels.timer.root.print_tree()"
    ]
   },
   {
@@ -183,27 +179,27 @@
     }
    ],
    "source": [
-    "timer.root = timer.Timer(\"root\")\n",
+    "parcels.timer.root = parcels.timer.Timer(\"root\")\n",
     "ptimer = {\n",
-    "    \"dllt\": timer.Timer(\"dllt\", parent=timer.root, start=False),\n",
-    "    \"dllt_p\": timer.Timer(\"dllt_p\", parent=timer.root, start=False),\n",
+    "    \"dllt\": parcels.timer.Timer(\"dllt\", parent=parcels.timer.root, start=False),\n",
+    "    \"dllt_p\": parcels.timer.Timer(\"dllt_p\", parent=parcels.timer.root, start=False),\n",
     "}\n",
     "\n",
     "for k in [\"dllt\", \"dllt_p\"]:\n",
-    "    pset = ParticleSet.from_line(\n",
+    "    pset = parcels.ParticleSet.from_line(\n",
     "        fieldset=fieldset,\n",
-    "        pclass=ScipyParticle,\n",
+    "        pclass=parcels.ScipyParticle,\n",
     "        size=100,\n",
     "        start=(3e3, 3e3),\n",
     "        finish=(3e3, 45e3),\n",
     "    )\n",
     "\n",
     "    ptimer[k].start()\n",
-    "    pset.execute(kernels[k], runtime=delta(hours=1), dt=delta(seconds=30))\n",
+    "    pset.execute(kernels[k], runtime=timedelta(hours=1), dt=timedelta(seconds=30))\n",
     "    ptimer[k].stop()\n",
     "\n",
-    "timer.root.stop()\n",
-    "timer.root.print_tree()"
+    "parcels.timer.root.stop()\n",
+    "parcels.timer.root.print_tree()"
    ]
   },
   {
@@ -222,7 +218,7 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "example_dataset_folder = download_example_dataset(\"NemoCurvilinear_data\")\n",
+    "example_dataset_folder = parcels.download_example_dataset(\"NemoCurvilinear_data\")\n",
     "filenames = {\n",
     "    \"U\": {\n",
     "        \"lon\": f\"{example_dataset_folder}/mesh_mask.nc4\",\n",
@@ -237,7 +233,7 @@
     "}\n",
     "variables = {\"U\": \"U\", \"V\": \"V\"}\n",
     "dimensions = {\"lon\": \"glamf\", \"lat\": \"gphif\", \"time\": \"time_counter\"}\n",
-    "fieldset = FieldSet.from_nemo(\n",
+    "fieldset = parcels.FieldSet.from_nemo(\n",
     "    filenames, variables, dimensions, allow_time_extrapolation=True\n",
     ")"
    ]
@@ -260,27 +256,27 @@
     }
    ],
    "source": [
-    "timer.root = timer.Timer(\"root\")\n",
+    "parcels.timer.root = parcels.timer.Timer(\"root\")\n",
     "ptimer = {\n",
-    "    \"dllt\": timer.Timer(\"dllt\", parent=timer.root, start=False),\n",
-    "    \"dllt_p\": timer.Timer(\"dllt_p\", parent=timer.root, start=False),\n",
+    "    \"dllt\": parcels.timer.Timer(\"dllt\", parent=parcels.timer.root, start=False),\n",
+    "    \"dllt_p\": parcels.timer.Timer(\"dllt_p\", parent=parcels.timer.root, start=False),\n",
     "}\n",
     "\n",
     "for k in [\"dllt\", \"dllt_p\"]:\n",
-    "    pset = ParticleSet.from_line(\n",
+    "    pset = parcels.ParticleSet.from_line(\n",
     "        fieldset=fieldset,\n",
-    "        pclass=ScipyParticle,\n",
+    "        pclass=parcels.ScipyParticle,\n",
     "        size=10,\n",
     "        start=(45, 40),\n",
     "        finish=(60, 40),\n",
     "    )\n",
     "\n",
     "    ptimer[k].start()\n",
-    "    pset.execute(kernels[k], runtime=delta(days=10), dt=delta(hours=6))\n",
+    "    pset.execute(kernels[k], runtime=timedelta(days=10), dt=timedelta(hours=6))\n",
     "    ptimer[k].stop()\n",
     "\n",
-    "timer.root.stop()\n",
-    "timer.root.print_tree()"
+    "parcels.timer.root.stop()\n",
+    "parcels.timer.root.print_tree()"
    ]
   },
   {
diff --git a/docs/examples/tutorial_kernelloop.ipynb b/docs/examples/tutorial_kernelloop.ipynb
index 0824d28dc..b2d3ea8fe 100644
--- a/docs/examples/tutorial_kernelloop.ipynb
+++ b/docs/examples/tutorial_kernelloop.ipynb
@@ -105,17 +105,10 @@
     "import numpy as np\n",
     "import xarray as xr\n",
     "\n",
-    "from parcels import (\n",
-    "    AdvectionRK4,\n",
-    "    Field,\n",
-    "    FieldSet,\n",
-    "    JITParticle,\n",
-    "    ParticleSet,\n",
-    "    download_example_dataset,\n",
-    ")\n",
+    "import parcels\n",
     "\n",
     "# Load the GlobCurrent data in the Agulhas region from the example_data\n",
-    "example_dataset_folder = download_example_dataset(\"GlobCurrent_example_data\")\n",
+    "example_dataset_folder = parcels.download_example_dataset(\"GlobCurrent_example_data\")\n",
     "filenames = {\n",
     "    \"U\": f\"{example_dataset_folder}/20*.nc\",\n",
     "    \"V\": f\"{example_dataset_folder}/20*.nc\",\n",
@@ -125,7 +118,7 @@
     "    \"V\": \"northward_eulerian_current_velocity\",\n",
     "}\n",
     "dimensions = {\"lat\": \"lat\", \"lon\": \"lon\", \"time\": \"time\"}\n",
-    "fieldset = FieldSet.from_netcdf(filenames, variables, dimensions)\n",
+    "fieldset = parcels.FieldSet.from_netcdf(filenames, variables, dimensions)\n",
     "# uppermost layer in the hydrodynamic data\n",
     "fieldset.mindepth = fieldset.U.depth[0]"
    ]
@@ -138,7 +131,7 @@
    "source": [
     "# Create an idealised wind field and add it to the fieldset\n",
     "xdim, ydim = (len(fieldset.U.lon), len(fieldset.U.lat))\n",
-    "UWind = Field(\n",
+    "UWind = parcels.Field(\n",
     "    \"UWind\",\n",
     "    np.ones((ydim, xdim), dtype=np.float32) * np.sin(fieldset.U.lat)[:, None],\n",
     "    lon=fieldset.U.lon,\n",
@@ -146,10 +139,10 @@
     "    mesh=\"spherical\",\n",
     "    fieldtype=\"U\",\n",
     ")\n",
-    "VWind = Field(\n",
+    "VWind = parcels.Field(\n",
     "    \"VWind\", np.zeros((ydim, xdim), dtype=np.float32), grid=UWind.grid, fieldtype=\"V\"\n",
     ")\n",
-    "fieldset_wind = FieldSet(UWind, VWind)\n",
+    "fieldset_wind = parcels.FieldSet(UWind, VWind)\n",
     "\n",
     "fieldset.add_field(fieldset_wind.U, name=\"UWind\")\n",
     "fieldset.add_field(fieldset_wind.V, name=\"VWind\")"
@@ -202,12 +195,12 @@
     "lons = 26.0 * np.ones(10)\n",
     "lats = np.linspace(-37.5, -34.5, 10)\n",
     "\n",
-    "pset = ParticleSet(fieldset, pclass=JITParticle, lon=lons, lat=lats)\n",
+    "pset = parcels.ParticleSet(fieldset, pclass=parcels.JITParticle, lon=lons, lat=lats)\n",
     "output_file = pset.ParticleFile(\n",
     "    name=\"advection_then_wind.zarr\", outputdt=timedelta(hours=6)\n",
     ")\n",
     "pset.execute(\n",
-    "    [AdvectionRK4, wind_kernel],\n",
+    "    [parcels.AdvectionRK4, wind_kernel],\n",
     "    runtime=timedelta(days=5),\n",
     "    dt=timedelta(hours=1),\n",
     "    output_file=output_file,\n",
@@ -236,12 +229,14 @@
     }
    ],
    "source": [
-    "pset_reverse = ParticleSet(fieldset, pclass=JITParticle, lon=lons, lat=lats)\n",
+    "pset_reverse = parcels.ParticleSet(\n",
+    "    fieldset, pclass=parcels.JITParticle, lon=lons, lat=lats\n",
+    ")\n",
     "output_file_reverse = pset_reverse.ParticleFile(\n",
     "    name=\"wind_then_advection.zarr\", outputdt=timedelta(hours=6)\n",
     ")\n",
     "pset_reverse.execute(\n",
-    "    [wind_kernel, AdvectionRK4],\n",
+    "    [wind_kernel, parcels.AdvectionRK4],\n",
     "    runtime=timedelta(days=5),\n",
     "    dt=timedelta(hours=1),\n",
     "    output_file=output_file_reverse,\n",
diff --git a/docs/examples/tutorial_nemo_3D.ipynb b/docs/examples/tutorial_nemo_3D.ipynb
index ac31b93f4..240435b6d 100644
--- a/docs/examples/tutorial_nemo_3D.ipynb
+++ b/docs/examples/tutorial_nemo_3D.ipynb
@@ -52,26 +52,21 @@
     }
    ],
    "source": [
-    "from datetime import timedelta as delta\n",
+    "from datetime import timedelta\n",
     "from glob import glob\n",
     "\n",
     "import matplotlib.pyplot as plt\n",
     "import xarray as xr\n",
     "\n",
-    "from parcels import (\n",
-    "    AdvectionRK4_3D,\n",
-    "    FieldSet,\n",
-    "    JITParticle,\n",
-    "    ParticleSet,\n",
-    "    XarrayDecodedFilter,\n",
-    "    download_example_dataset,\n",
-    "    logger,\n",
-    ")\n",
+    "import parcels\n",
+    "from parcels import logger\n",
     "\n",
     "# Add a filter for the xarray decoding warning\n",
-    "logger.addFilter(XarrayDecodedFilter())\n",
+    "logger.addFilter(parcels.XarrayDecodedFilter())\n",
     "\n",
-    "example_dataset_folder = download_example_dataset(\"NemoNorthSeaORCA025-N006_data\")\n",
+    "example_dataset_folder = parcels.download_example_dataset(\n",
+    "    \"NemoNorthSeaORCA025-N006_data\"\n",
+    ")\n",
     "ufiles = sorted(glob(f\"{example_dataset_folder}/ORCA*U.nc\"))\n",
     "vfiles = sorted(glob(f\"{example_dataset_folder}/ORCA*V.nc\"))\n",
     "wfiles = sorted(glob(f\"{example_dataset_folder}/ORCA*W.nc\"))\n",
@@ -98,19 +93,19 @@
     "    \"W\": c_grid_dimensions,\n",
     "}\n",
     "\n",
-    "fieldset = FieldSet.from_nemo(filenames, variables, dimensions)\n",
+    "fieldset = parcels.FieldSet.from_nemo(filenames, variables, dimensions)\n",
     "\n",
-    "pset = ParticleSet.from_line(\n",
+    "pset = parcels.ParticleSet.from_line(\n",
     "    fieldset=fieldset,\n",
-    "    pclass=JITParticle,\n",
+    "    pclass=parcels.JITParticle,\n",
     "    size=10,\n",
     "    start=(1.9, 52.5),\n",
     "    finish=(3.4, 51.6),\n",
     "    depth=1,\n",
     ")\n",
     "\n",
-    "kernels = pset.Kernel(AdvectionRK4_3D)\n",
-    "pset.execute(kernels, runtime=delta(days=4), dt=delta(hours=6))"
+    "kernels = pset.Kernel(parcels.AdvectionRK4_3D)\n",
+    "pset.execute(kernels, runtime=timedelta(days=4), dt=timedelta(hours=6))"
    ]
   },
   {
@@ -183,7 +178,7 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "fieldset = FieldSet.from_nemo(filenames, variables, dimensions)"
+    "fieldset = parcels.FieldSet.from_nemo(filenames, variables, dimensions)"
    ]
   },
   {
@@ -239,7 +234,7 @@
    "name": "python",
    "nbconvert_exporter": "python",
    "pygments_lexer": "ipython3",
-   "version": "3.11.6"
+   "version": "3.12.4"
   }
  },
  "nbformat": 4,
diff --git a/docs/examples/tutorial_nemo_curvilinear.ipynb b/docs/examples/tutorial_nemo_curvilinear.ipynb
index f509ef114..065c96dd4 100644
--- a/docs/examples/tutorial_nemo_curvilinear.ipynb
+++ b/docs/examples/tutorial_nemo_curvilinear.ipynb
@@ -24,20 +24,13 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "from datetime import timedelta as delta\n",
+    "from datetime import timedelta\n",
     "\n",
     "import matplotlib.pyplot as plt\n",
     "import numpy as np\n",
     "import xarray as xr\n",
     "\n",
-    "from parcels import (\n",
-    "    AdvectionRK4,\n",
-    "    FieldSet,\n",
-    "    JITParticle,\n",
-    "    ParticleFile,\n",
-    "    ParticleSet,\n",
-    "    download_example_dataset,\n",
-    ")"
+    "import parcels"
    ]
   },
   {
@@ -64,7 +57,7 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "example_dataset_folder = download_example_dataset(\"NemoCurvilinear_data\")\n",
+    "example_dataset_folder = parcels.download_example_dataset(\"NemoCurvilinear_data\")\n",
     "filenames = {\n",
     "    \"U\": {\n",
     "        \"lon\": f\"{example_dataset_folder}/mesh_mask.nc4\",\n",
@@ -81,7 +74,7 @@
     "\n",
     "dimensions = {\"lon\": \"glamf\", \"lat\": \"gphif\", \"time\": \"time_counter\"}\n",
     "\n",
-    "fieldset = FieldSet.from_nemo(\n",
+    "fieldset = parcels.FieldSet.from_nemo(\n",
     "    filenames, variables, dimensions, allow_time_extrapolation=True\n",
     ")"
    ]
@@ -184,10 +177,15 @@
     "lonp = -180 * np.ones(npart)\n",
     "latp = [i for i in np.linspace(-70, 85, npart)]\n",
     "\n",
-    "pset = ParticleSet.from_list(fieldset, JITParticle, lon=lonp, lat=latp)\n",
-    "pfile = ParticleFile(\"nemo_particles\", pset, outputdt=delta(days=1))\n",
+    "pset = parcels.ParticleSet.from_list(fieldset, parcels.JITParticle, lon=lonp, lat=latp)\n",
+    "pfile = parcels.ParticleFile(\"nemo_particles\", pset, outputdt=timedelta(days=1))\n",
     "\n",
-    "pset.execute(AdvectionRK4, runtime=delta(days=30), dt=delta(hours=6), output_file=pfile)"
+    "pset.execute(\n",
+    "    parcels.AdvectionRK4,\n",
+    "    runtime=timedelta(days=30),\n",
+    "    dt=timedelta(hours=6),\n",
+    "    output_file=pfile,\n",
+    ")"
    ]
   },
   {
@@ -237,7 +235,7 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "pset = ParticleSet.from_list(fieldset, JITParticle, lon=lonp, lat=latp)\n",
+    "pset = parcels.ParticleSet.from_list(fieldset, parcels.JITParticle, lon=lonp, lat=latp)\n",
     "pset.populate_indices()"
    ]
   }
@@ -258,7 +256,7 @@
    "name": "python",
    "nbconvert_exporter": "python",
    "pygments_lexer": "ipython3",
-   "version": "3.11.5"
+   "version": "3.12.4"
   }
  },
  "nbformat": 4,
diff --git a/docs/examples/tutorial_output.ipynb b/docs/examples/tutorial_output.ipynb
index 4f1642201..f98e6972c 100644
--- a/docs/examples/tutorial_output.ipynb
+++ b/docs/examples/tutorial_output.ipynb
@@ -30,17 +30,11 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "from datetime import timedelta as delta\n",
+    "from datetime import timedelta\n",
     "\n",
     "import numpy as np\n",
     "\n",
-    "from parcels import (\n",
-    "    AdvectionRK4,\n",
-    "    FieldSet,\n",
-    "    JITParticle,\n",
-    "    ParticleSet,\n",
-    "    download_example_dataset,\n",
-    ")"
+    "import parcels"
    ]
   },
   {
@@ -58,8 +52,8 @@
     }
    ],
    "source": [
-    "example_dataset_folder = download_example_dataset(\"Peninsula_data\")\n",
-    "fieldset = FieldSet.from_parcels(\n",
+    "example_dataset_folder = parcels.download_example_dataset(\"Peninsula_data\")\n",
+    "fieldset = parcels.FieldSet.from_parcels(\n",
     "    f\"{example_dataset_folder}/peninsula\", allow_time_extrapolation=True\n",
     ")\n",
     "\n",
@@ -68,14 +62,19 @@
     "lat = np.linspace(3e3, 45e3, npart, dtype=np.float32)\n",
     "\n",
     "# release every particle two hours later\n",
-    "time = np.arange(npart) * delta(hours=2).total_seconds()\n",
+    "time = np.arange(npart) * timedelta(hours=2).total_seconds()\n",
     "\n",
-    "pset = ParticleSet(fieldset=fieldset, pclass=JITParticle, lon=lon, lat=lat, time=time)\n",
+    "pset = parcels.ParticleSet(\n",
+    "    fieldset=fieldset, pclass=parcels.JITParticle, lon=lon, lat=lat, time=time\n",
+    ")\n",
     "\n",
-    "output_file = pset.ParticleFile(name=\"Output.zarr\", outputdt=delta(hours=2))\n",
+    "output_file = pset.ParticleFile(name=\"Output.zarr\", outputdt=timedelta(hours=2))\n",
     "\n",
     "pset.execute(\n",
-    "    AdvectionRK4, runtime=delta(hours=24), dt=delta(minutes=5), output_file=output_file\n",
+    "    parcels.AdvectionRK4,\n",
+    "    runtime=timedelta(hours=24),\n",
+    "    dt=timedelta(minutes=5),\n",
+    "    output_file=output_file,\n",
     ")"
    ]
   },
@@ -330,8 +329,8 @@
     "\n",
     "timerange = np.arange(\n",
     "    np.nanmin(data_xarray[\"time\"].values),\n",
-    "    np.nanmax(data_xarray[\"time\"].values) + np.timedelta64(delta(hours=2)),\n",
-    "    delta(hours=2),\n",
+    "    np.nanmax(data_xarray[\"time\"].values) + np.timedelta64(timedelta(hours=2)),\n",
+    "    timedelta(hours=2),\n",
     ")  # timerange in nanoseconds\n",
     "\n",
     "for time in timerange:\n",
@@ -460,7 +459,7 @@
     "from IPython.display import HTML\n",
     "from matplotlib.animation import FuncAnimation\n",
     "\n",
-    "outputdt = delta(hours=2)\n",
+    "outputdt = timedelta(hours=2)\n",
     "\n",
     "# timerange in nanoseconds\n",
     "timerange = np.arange(\n",
diff --git a/docs/examples/tutorial_parcels_structure.ipynb b/docs/examples/tutorial_parcels_structure.ipynb
index 898cdf85f..29d9f2c8e 100644
--- a/docs/examples/tutorial_parcels_structure.ipynb
+++ b/docs/examples/tutorial_parcels_structure.ipynb
@@ -72,9 +72,9 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "from parcels import download_example_dataset\n",
+    "import parcels\n",
     "\n",
-    "example_dataset_folder = download_example_dataset(\"GlobCurrent_example_data\")\n",
+    "example_dataset_folder = parcels.download_example_dataset(\"GlobCurrent_example_data\")\n",
     "fname = f\"{example_dataset_folder}/*.nc\"\n",
     "filenames = {\"U\": fname, \"V\": fname}"
    ]
@@ -134,9 +134,7 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "from parcels import FieldSet\n",
-    "\n",
-    "fieldset = FieldSet.from_netcdf(filenames, variables, dimensions)"
+    "fieldset = parcels.FieldSet.from_netcdf(filenames, variables, dimensions)"
    ]
   },
   {
@@ -200,12 +198,10 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "from parcels import JITParticle, ParticleSet, Variable\n",
-    "\n",
     "# Define a new particleclass with Variable 'age' with initial value 0.\n",
-    "AgeParticle = JITParticle.add_variable(Variable(\"age\", initial=0))\n",
+    "AgeParticle = parcels.JITParticle.add_variable(parcels.Variable(\"age\", initial=0))\n",
     "\n",
-    "pset = ParticleSet(\n",
+    "pset = parcels.ParticleSet(\n",
     "    fieldset=fieldset,  # the fields that the particleset uses\n",
     "    pclass=AgeParticle,  # define the type of particle\n",
     "    lon=29,  # release longitude\n",
@@ -251,9 +247,6 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "# load basic advection kernels\n",
-    "from parcels import AdvectionRK4\n",
-    "\n",
     "# Create a custom kernel which displaces each particle southward\n",
     "\n",
     "\n",
@@ -271,7 +264,7 @@
     "\n",
     "\n",
     "# define all kernels to be executed on particles using an (ordered) list\n",
-    "kernels = [Age, NorthVel, AdvectionRK4]"
+    "kernels = [Age, NorthVel, parcels.AdvectionRK4]"
    ]
   },
   {
diff --git a/docs/examples/tutorial_particle_field_interaction.ipynb b/docs/examples/tutorial_particle_field_interaction.ipynb
index 143837ba9..c8c2f7196 100644
--- a/docs/examples/tutorial_particle_field_interaction.ipynb
+++ b/docs/examples/tutorial_particle_field_interaction.ipynb
@@ -43,21 +43,14 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "from datetime import timedelta as delta\n",
+    "from datetime import timedelta\n",
     "\n",
     "import matplotlib.pyplot as plt\n",
     "import netCDF4\n",
     "import numpy as np\n",
     "import xarray as xr\n",
     "\n",
-    "from parcels import (\n",
-    "    AdvectionRK4,\n",
-    "    Field,\n",
-    "    FieldSet,\n",
-    "    ParticleSet,\n",
-    "    ScipyParticle,\n",
-    "    download_example_dataset,\n",
-    ")"
+    "import parcels"
    ]
   },
   {
@@ -79,7 +72,7 @@
    "outputs": [],
    "source": [
     "# Velocity fields\n",
-    "example_dataset_folder = download_example_dataset(\"GlobCurrent_example_data\")\n",
+    "example_dataset_folder = parcels.download_example_dataset(\"GlobCurrent_example_data\")\n",
     "fname = f\"{example_dataset_folder}/*.nc\"\n",
     "filenames = {\"U\": fname, \"V\": fname}\n",
     "variables = {\n",
@@ -90,7 +83,7 @@
     "    \"U\": {\"lat\": \"lat\", \"lon\": \"lon\", \"time\": \"time\"},\n",
     "    \"V\": {\"lat\": \"lat\", \"lon\": \"lon\", \"time\": \"time\"},\n",
     "}\n",
-    "fieldset = FieldSet.from_netcdf(filenames, variables, dimensions)\n",
+    "fieldset = parcels.FieldSet.from_netcdf(filenames, variables, dimensions)\n",
     "\n",
     "# In order to assign the same grid to the tracer field,\n",
     "# it is convenient to load a single velocity file\n",
@@ -99,7 +92,7 @@
     "\n",
     "# a field with the same variables and dimensions\n",
     "# as the other velocity fields\n",
-    "field_for_size = FieldSet.from_netcdf(filenames1, variables, dimensions)\n",
+    "field_for_size = parcels.FieldSet.from_netcdf(filenames1, variables, dimensions)\n",
     "\n",
     "# Adding the tracer field to the FieldSet\n",
     "# with same dimensions as the velocity fields\n",
@@ -108,7 +101,7 @@
     "\n",
     "# the new Field will be called C, for tracer Concentration.\n",
     "# For mass conservation, interp_method='nearest'\n",
-    "fieldC = Field(\"C\", dataC, grid=field_for_size.U.grid, interp_method=\"nearest\")\n",
+    "fieldC = parcels.Field(\"C\", dataC, grid=field_for_size.U.grid, interp_method=\"nearest\")\n",
     "\n",
     "# aad C field to the velocity FieldSet\n",
     "fieldset.add_field(fieldC)\n",
@@ -159,7 +152,9 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "VectorParticle = ScipyParticle.add_variable(\"c\", dtype=np.float32, initial=100.0)\n",
+    "VectorParticle = parcels.ScipyParticle.add_variable(\n",
+    "    \"c\", dtype=np.float32, initial=100.0\n",
+    ")\n",
     "\n",
     "\n",
     "def Interaction(particle, fieldset, time):\n",
@@ -196,7 +191,9 @@
     "\n",
     "\n",
     "# for simplicity, we'll track a single particle here\n",
-    "pset = ParticleSet(fieldset=fieldset, pclass=VectorParticle, lon=[24.5], lat=[-34.8])"
+    "pset = parcels.ParticleSet(\n",
+    "    fieldset=fieldset, pclass=VectorParticle, lon=[24.5], lat=[-34.8]\n",
+    ")"
    ]
   },
   {
@@ -247,16 +244,16 @@
     }
    ],
    "source": [
-    "output_file = pset.ParticleFile(name=r\"interaction.zarr\", outputdt=delta(days=1))\n",
+    "output_file = pset.ParticleFile(name=r\"interaction.zarr\", outputdt=timedelta(days=1))\n",
     "\n",
     "pset.execute(\n",
     "    # the particle will FIRST be transported by currents\n",
     "    # and THEN interact with the field\n",
-    "    AdvectionRK4 + pset.Kernel(Interaction),\n",
-    "    dt=delta(days=1),\n",
+    "    parcels.AdvectionRK4 + pset.Kernel(Interaction),\n",
+    "    dt=timedelta(days=1),\n",
     "    # we are going to track the particle and save\n",
     "    # its trajectory and tracer concentration for 24 days\n",
-    "    runtime=delta(days=25),\n",
+    "    runtime=timedelta(days=25),\n",
     "    output_file=output_file,\n",
     ")\n",
     "\n",
diff --git a/docs/examples/tutorial_periodic_boundaries.ipynb b/docs/examples/tutorial_periodic_boundaries.ipynb
index d8db300b0..8f25e27f4 100644
--- a/docs/examples/tutorial_periodic_boundaries.ipynb
+++ b/docs/examples/tutorial_periodic_boundaries.ipynb
@@ -63,18 +63,12 @@
    "outputs": [],
    "source": [
     "import math\n",
-    "from datetime import timedelta as delta\n",
+    "from datetime import timedelta\n",
     "\n",
     "import matplotlib.pyplot as plt\n",
     "import xarray as xr\n",
     "\n",
-    "from parcels import (\n",
-    "    AdvectionRK4,\n",
-    "    FieldSet,\n",
-    "    JITParticle,\n",
-    "    ParticleSet,\n",
-    "    download_example_dataset,\n",
-    ")"
+    "import parcels"
    ]
   },
   {
@@ -91,8 +85,8 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "example_dataset_folder = download_example_dataset(\"Peninsula_data\")\n",
-    "fieldset = FieldSet.from_parcels(\n",
+    "example_dataset_folder = parcels.download_example_dataset(\"Peninsula_data\")\n",
+    "fieldset = parcels.FieldSet.from_parcels(\n",
     "    f\"{example_dataset_folder}/peninsula\", allow_time_extrapolation=True\n",
     ")"
    ]
@@ -165,16 +159,20 @@
     }
    ],
    "source": [
-    "pset = ParticleSet.from_line(\n",
-    "    fieldset, pclass=JITParticle, size=10, start=(20e3, 3e3), finish=(20e3, 45e3)\n",
+    "pset = parcels.ParticleSet.from_line(\n",
+    "    fieldset,\n",
+    "    pclass=parcels.JITParticle,\n",
+    "    size=10,\n",
+    "    start=(20e3, 3e3),\n",
+    "    finish=(20e3, 45e3),\n",
     ")\n",
     "\n",
-    "output_file = pset.ParticleFile(name=\"PeriodicParticle\", outputdt=delta(hours=1))\n",
+    "output_file = pset.ParticleFile(name=\"PeriodicParticle\", outputdt=timedelta(hours=1))\n",
     "\n",
     "pset.execute(\n",
-    "    [AdvectionRK4, periodicBC],\n",
-    "    runtime=delta(hours=24),\n",
-    "    dt=delta(minutes=5),\n",
+    "    [parcels.AdvectionRK4, periodicBC],\n",
+    "    runtime=timedelta(hours=24),\n",
+    "    dt=timedelta(minutes=5),\n",
     "    output_file=output_file,\n",
     ")"
    ]
diff --git a/docs/examples/tutorial_sampling.ipynb b/docs/examples/tutorial_sampling.ipynb
index 7a4d88595..e568d969a 100644
--- a/docs/examples/tutorial_sampling.ipynb
+++ b/docs/examples/tutorial_sampling.ipynb
@@ -29,7 +29,7 @@
    "source": [
     "## Basic sampling\n",
     "\n",
-    "We import the `Variable` class as well as the standard modules needed to set up a simulation.\n"
+    "We import both the packages that we need to set up the simulation, as well as the parcels package.\n"
    ]
   },
   {
@@ -39,7 +39,7 @@
    "outputs": [],
    "source": [
     "# Modules needed for the Parcels simulation\n",
-    "from datetime import timedelta as delta\n",
+    "from datetime import timedelta\n",
     "\n",
     "import matplotlib as mpl\n",
     "import matplotlib.pyplot as plt\n",
@@ -48,14 +48,7 @@
     "# To open and look at the temperature data\n",
     "import xarray as xr\n",
     "\n",
-    "from parcels import (\n",
-    "    AdvectionRK4,\n",
-    "    FieldSet,\n",
-    "    JITParticle,\n",
-    "    ParticleSet,\n",
-    "    Variable,\n",
-    "    download_example_dataset,\n",
-    ")"
+    "import parcels"
    ]
   },
   {
@@ -84,8 +77,8 @@
    ],
    "source": [
     "# Velocity and temperature fields\n",
-    "example_dataset_folder = download_example_dataset(\"Peninsula_data\")\n",
-    "fieldset = FieldSet.from_parcels(\n",
+    "example_dataset_folder = parcels.download_example_dataset(\"Peninsula_data\")\n",
+    "fieldset = parcels.FieldSet.from_parcels(\n",
     "    f\"{example_dataset_folder}/peninsula\",\n",
     "    extra_fields={\"T\": \"T\"},\n",
     "    allow_time_extrapolation=True,\n",
@@ -96,7 +89,7 @@
     "lon = 3e3 * np.ones(npart)\n",
     "lat = np.linspace(3e3, 45e3, npart, dtype=np.float32)\n",
     "time = (\n",
-    "    np.arange(0, npart) * delta(hours=2).total_seconds()\n",
+    "    np.arange(0, npart) * timedelta(hours=2).total_seconds()\n",
     ")  # release each particle two hours later\n",
     "\n",
     "# Plot temperature field and initial particle locations\n",
@@ -107,7 +100,7 @@
     "    T_data.x.values, T_data.y.values, T_data.T.values[0, 0], cmap=plt.cm.inferno\n",
     ")\n",
     "ax.scatter(lon, lat, c=\"w\")\n",
-    "plt.colorbar(T_contour, label=\"T [$^{\\circ} C$]\")\n",
+    "plt.colorbar(T_contour, label=r\"T [$^{\\circ} C$]\")\n",
     "plt.show()"
    ]
   },
@@ -125,9 +118,9 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "SampleParticle = JITParticle.add_variable(\"temperature\")\n",
+    "SampleParticle = parcels.JITParticle.add_variable(\"temperature\")\n",
     "\n",
-    "pset = ParticleSet(\n",
+    "pset = parcels.ParticleSet(\n",
     "    fieldset=fieldset, pclass=SampleParticle, lon=lon, lat=lat, time=time\n",
     ")\n",
     "\n",
@@ -159,16 +152,16 @@
     }
    ],
    "source": [
-    "pset = ParticleSet(\n",
+    "pset = parcels.ParticleSet(\n",
     "    fieldset=fieldset, pclass=SampleParticle, lon=lon, lat=lat, time=time\n",
     ")\n",
     "\n",
-    "output_file = pset.ParticleFile(name=\"SampleTemp.zarr\", outputdt=delta(hours=1))\n",
+    "output_file = pset.ParticleFile(name=\"SampleTemp.zarr\", outputdt=timedelta(hours=1))\n",
     "\n",
     "pset.execute(\n",
-    "    [AdvectionRK4, SampleT],\n",
-    "    runtime=delta(hours=30),\n",
-    "    dt=delta(minutes=5),\n",
+    "    [parcels.AdvectionRK4, SampleT],\n",
+    "    runtime=timedelta(hours=30),\n",
+    "    dt=timedelta(minutes=5),\n",
     "    output_file=output_file,\n",
     ")"
    ]
@@ -216,7 +209,7 @@
     "    edgecolor=\"k\",\n",
     "    zorder=2,\n",
     ")\n",
-    "plt.colorbar(T_scatter, label=\"T [$^{\\circ} C$]\")\n",
+    "plt.colorbar(T_scatter, label=r\"T [$^{\\circ} C$]\")\n",
     "plt.show()"
    ]
   },
@@ -255,7 +248,9 @@
     "    u = fieldset.U[particle]\n",
     "\n",
     "\n",
-    "pset = ParticleSet(fieldset=fieldset, pclass=JITParticle, lon=lon, lat=lat, time=time)\n",
+    "pset = parcels.ParticleSet(\n",
+    "    fieldset=fieldset, pclass=parcels.JITParticle, lon=lon, lat=lat, time=time\n",
+    ")\n",
     "\n",
     "pset.execute(SampleVel_wrong)"
    ]
@@ -286,7 +281,9 @@
     "    u, v = fieldset.UV[particle]\n",
     "\n",
     "\n",
-    "pset = ParticleSet(fieldset=fieldset, pclass=JITParticle, lon=lon, lat=lat, time=time)\n",
+    "pset = parcels.ParticleSet(\n",
+    "    fieldset=fieldset, pclass=parcels.JITParticle, lon=lon, lat=lat, time=time\n",
+    ")\n",
     "\n",
     "pset.execute(SampleVel_correct)"
    ]
@@ -305,10 +302,10 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "SampleParticle = JITParticle.add_variables(\n",
+    "SampleParticle = parcels.JITParticle.add_variables(\n",
     "    [\n",
-    "        Variable(\"U\", dtype=np.float32, initial=np.nan),\n",
-    "        Variable(\"V\", dtype=np.float32, initial=np.nan),\n",
+    "        parcels.Variable(\"U\", dtype=np.float32, initial=np.nan),\n",
+    "        parcels.Variable(\"V\", dtype=np.float32, initial=np.nan),\n",
     "    ]\n",
     ")\n",
     "\n",
@@ -351,9 +348,11 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "SampleParticleOnce = JITParticle.add_variable(\"temperature\", initial=0, to_write=\"once\")\n",
+    "SampleParticleOnce = parcels.JITParticle.add_variable(\n",
+    "    \"temperature\", initial=0, to_write=\"once\"\n",
+    ")\n",
     "\n",
-    "pset = ParticleSet(\n",
+    "pset = parcels.ParticleSet(\n",
     "    fieldset=fieldset, pclass=SampleParticleOnce, lon=lon, lat=lat, time=time\n",
     ")"
    ]
@@ -373,12 +372,12 @@
     }
    ],
    "source": [
-    "output_file = pset.ParticleFile(name=\"WriteOnce.zarr\", outputdt=delta(hours=1))\n",
+    "output_file = pset.ParticleFile(name=\"WriteOnce.zarr\", outputdt=timedelta(hours=1))\n",
     "\n",
     "pset.execute(\n",
-    "    [AdvectionRK4, SampleT],\n",
-    "    runtime=delta(hours=24),\n",
-    "    dt=delta(minutes=5),\n",
+    "    [parcels.AdvectionRK4, SampleT],\n",
+    "    runtime=timedelta(hours=24),\n",
+    "    dt=timedelta(minutes=5),\n",
     "    output_file=output_file,\n",
     ")"
    ]
@@ -426,7 +425,7 @@
     "    edgecolor=\"k\",\n",
     "    zorder=2,\n",
     ")\n",
-    "plt.colorbar(T_scatter, label=\"Initial T [$^{\\circ} C$]\")\n",
+    "plt.colorbar(T_scatter, label=r\"Initial T [$^{\\circ} C$]\")\n",
     "plt.show()"
    ]
   }
diff --git a/docs/examples/tutorial_timestamps.ipynb b/docs/examples/tutorial_timestamps.ipynb
index 0375f30bc..3217d77e1 100644
--- a/docs/examples/tutorial_timestamps.ipynb
+++ b/docs/examples/tutorial_timestamps.ipynb
@@ -18,7 +18,7 @@
     "\n",
     "import numpy as np\n",
     "\n",
-    "from parcels import Field, download_example_dataset"
+    "import parcels"
    ]
   },
   {
@@ -100,8 +100,8 @@
     }
    ],
    "source": [
-    "example_dataset_folder = download_example_dataset(\"WOA_data\")\n",
-    "tempfield = Field.from_netcdf(\n",
+    "example_dataset_folder = parcels.download_example_dataset(\"WOA_data\")\n",
+    "tempfield = parcels.Field.from_netcdf(\n",
     "    glob(f\"{example_dataset_folder}/woa18_decav_*_04.nc\"),\n",
     "    \"t_an\",\n",
     "    {\"lon\": \"lon\", \"lat\": \"lat\", \"time\": \"time\"},\n",
@@ -141,7 +141,7 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "tempfield = Field.from_netcdf(\n",
+    "tempfield = parcels.Field.from_netcdf(\n",
     "    glob(f\"{example_dataset_folder}/woa18_decav_*_04.nc\"),\n",
     "    \"t_an\",\n",
     "    {\"lon\": \"lon\", \"lat\": \"lat\", \"time\": \"time\"},\n",
diff --git a/docs/examples/tutorial_timevaryingdepthdimensions.ipynb b/docs/examples/tutorial_timevaryingdepthdimensions.ipynb
index 1ef9a8b4a..8f89b89be 100644
--- a/docs/examples/tutorial_timevaryingdepthdimensions.ipynb
+++ b/docs/examples/tutorial_timevaryingdepthdimensions.ipynb
@@ -22,21 +22,12 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "from datetime import timedelta as delta\n",
-    "from os import path\n",
+    "from datetime import timedelta\n",
     "\n",
     "import matplotlib.pyplot as plt\n",
-    "import numpy as np\n",
     "import xarray as xr\n",
     "\n",
-    "from parcels import (\n",
-    "    AdvectionRK4,\n",
-    "    FieldSet,\n",
-    "    JITParticle,\n",
-    "    ParticleFile,\n",
-    "    ParticleSet,\n",
-    "    download_example_dataset,\n",
-    ")"
+    "import parcels"
    ]
   },
   {
@@ -53,7 +44,7 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "example_dataset_folder = download_example_dataset(\"SWASH_data\")\n",
+    "example_dataset_folder = parcels.download_example_dataset(\"SWASH_data\")\n",
     "filenames = f\"{example_dataset_folder}/field_*.nc\"\n",
     "variables = {\n",
     "    \"U\": \"cross-shore velocity\",\n",
@@ -105,7 +96,7 @@
     }
    ],
    "source": [
-    "fieldset = FieldSet.from_netcdf(\n",
+    "fieldset = parcels.FieldSet.from_netcdf(\n",
     "    filenames, variables, dimensions, mesh=\"flat\", allow_time_extrapolation=True\n",
     ")\n",
     "fieldset.U.set_depth_from_field(fieldset.depth_u)\n",
@@ -135,11 +126,11 @@
     }
    ],
    "source": [
-    "pset = ParticleSet(fieldset, JITParticle, lon=9.5, lat=12.5, depth=-0.1)\n",
+    "pset = parcels.ParticleSet(fieldset, parcels.JITParticle, lon=9.5, lat=12.5, depth=-0.1)\n",
     "\n",
-    "pfile = pset.ParticleFile(\"SwashParticles\", outputdt=delta(seconds=0.05))\n",
+    "pfile = pset.ParticleFile(\"SwashParticles\", outputdt=timedelta(seconds=0.05))\n",
     "\n",
-    "pset.execute(AdvectionRK4, dt=delta(seconds=0.005), output_file=pfile)"
+    "pset.execute(parcels.AdvectionRK4, dt=timedelta(seconds=0.005), output_file=pfile)"
    ]
   },
   {
diff --git a/docs/examples/tutorial_unitconverters.ipynb b/docs/examples/tutorial_unitconverters.ipynb
index d6ed3b253..d39586067 100644
--- a/docs/examples/tutorial_unitconverters.ipynb
+++ b/docs/examples/tutorial_unitconverters.ipynb
@@ -35,7 +35,7 @@
     "import matplotlib.pyplot as plt\n",
     "import numpy as np\n",
     "\n",
-    "from parcels import Field, FieldSet"
+    "import parcels"
    ]
   },
   {
@@ -83,7 +83,7 @@
     }
    ],
    "source": [
-    "fieldset = FieldSet.from_data(data, dims, mesh=\"spherical\")\n",
+    "fieldset = parcels.FieldSet.from_data(data, dims, mesh=\"spherical\")\n",
     "plt.pcolormesh(fieldset.U.lon, fieldset.U.lat, fieldset.U.data[0, :, :], vmin=0, vmax=1)\n",
     "plt.colorbar()\n",
     "plt.show()"
@@ -242,7 +242,7 @@
     }
    ],
    "source": [
-    "fieldset_flat = FieldSet.from_data(data, dims, mesh=\"flat\")\n",
+    "fieldset_flat = parcels.FieldSet.from_data(data, dims, mesh=\"flat\")\n",
     "\n",
     "plt.pcolormesh(\n",
     "    fieldset_flat.U.lon,\n",
@@ -302,14 +302,14 @@
     "kh_meridional = 100  # in m^2/s\n",
     "\n",
     "fieldset.add_field(\n",
-    "    Field(\n",
+    "    parcels.Field(\n",
     "        \"Kh_zonal\",\n",
     "        kh_zonal * np.ones((ydim, xdim), dtype=np.float32),\n",
     "        grid=fieldset.U.grid,\n",
     "    )\n",
     ")\n",
     "fieldset.add_field(\n",
-    "    Field(\n",
+    "    parcels.Field(\n",
     "        \"Kh_meridional\",\n",
     "        kh_meridional * np.ones((ydim, xdim), dtype=np.float32),\n",
     "        grid=fieldset.U.grid,\n",
@@ -391,7 +391,9 @@
    ],
    "source": [
     "fieldset.add_field(\n",
-    "    Field(\"Ustokes\", np.ones((ydim, xdim), dtype=np.float32), grid=fieldset.U.grid)\n",
+    "    parcels.Field(\n",
+    "        \"Ustokes\", np.ones((ydim, xdim), dtype=np.float32), grid=fieldset.U.grid\n",
+    "    )\n",
     ")\n",
     "print(fieldset.Ustokes[0, 0, 40, -5])"
    ]
@@ -449,7 +451,7 @@
    ],
    "source": [
     "fieldset.add_field(\n",
-    "    Field(\n",
+    "    parcels.Field(\n",
     "        \"Ustokes2\",\n",
     "        np.ones((ydim, xdim), dtype=np.float32),\n",
     "        grid=fieldset.U.grid,\n",
@@ -492,7 +494,7 @@
    ],
    "source": [
     "fieldset.add_field(\n",
-    "    Field(\n",
+    "    parcels.Field(\n",
     "        name=\"Ucm\",\n",
     "        data=0.01 * np.ones((ydim, xdim), dtype=np.float32),\n",
     "        grid=fieldset.U.grid,\n",
diff --git a/docs/index.rst b/docs/index.rst
index 730917df5..2e0fcc50a 100755
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -7,7 +7,7 @@ Welcome to the documentation of Parcels. **Parcels** (Probably A Really Computat
 
 *Animation of virtual particles carried by ocean surface flow in the global oceans. The particles are advected with Parcels in data from the* `NEMO Ocean Model <https://www.nemo-ocean.eu/>`_.
 
-Here you'll find `installation instructions <installation.rst>`_, `tutorials and documentation <documentation.rst>`_, and the `API reference <reference.rst>`_ for Parcels. You can browse the documentation for older versions by using the version switcher in the left sidebar.
+Here you'll find `installation instructions <installation.rst>`_, `tutorials and documentation <documentation/index.rst>`_, and the `API reference <reference.rst>`_ for Parcels. You can browse the documentation for older versions by using the version switcher in the left sidebar.
 
 If you need more help with Parcels, try the `Discussions page on GitHub <https://github.com/OceanParcels/parcels/discussions>`_. If you think you found a bug, file an `Issue on GitHub <https://github.com/OceanParcels/parcels/issues>`_. If you want to help improve Parcels, see the `Contributing <contributing.rst>`_ page.
 
@@ -17,7 +17,7 @@ If you need more help with Parcels, try the `Discussions page on GitHub <https:/
 
    Home <self>
    Installation <installation>
-   Tutorials & Documentation <documentation>
+   Tutorials & Documentation <documentation/index>
    API reference <reference>
    Contributing <contributing>
    OceanParcels website <https://oceanparcels.org/>
diff --git a/parcels/application_kernels/advectiondiffusion.py b/parcels/application_kernels/advectiondiffusion.py
index 1cab7436b..259ae3059 100644
--- a/parcels/application_kernels/advectiondiffusion.py
+++ b/parcels/application_kernels/advectiondiffusion.py
@@ -4,7 +4,7 @@
 """
 import math
 
-import parcels.rng as ParcelsRandom
+import parcels
 
 __all__ = ['DiffusionUniformKh', 'AdvectionDiffusionM1', 'AdvectionDiffusionEM', ]
 
@@ -25,8 +25,8 @@ def AdvectionDiffusionM1(particle, fieldset, time):
     mean and a standard deviation of sqrt(dt).
     """
     # Wiener increment with zero mean and std of sqrt(dt)
-    dWx = ParcelsRandom.normalvariate(0, math.sqrt(math.fabs(particle.dt)))
-    dWy = ParcelsRandom.normalvariate(0, math.sqrt(math.fabs(particle.dt)))
+    dWx = parcels.rng.normalvariate(0, math.sqrt(math.fabs(particle.dt)))
+    dWy = parcels.rng.normalvariate(0, math.sqrt(math.fabs(particle.dt)))
 
     Kxp1 = fieldset.Kh_zonal[time, particle.depth, particle.lat, particle.lon + fieldset.dres]
     Kxm1 = fieldset.Kh_zonal[time, particle.depth, particle.lat, particle.lon - fieldset.dres]
@@ -60,8 +60,8 @@ def AdvectionDiffusionEM(particle, fieldset, time):
     mean and a standard deviation of sqrt(dt).
     """
     # Wiener increment with zero mean and std of sqrt(dt)
-    dWx = ParcelsRandom.normalvariate(0, math.sqrt(math.fabs(particle.dt)))
-    dWy = ParcelsRandom.normalvariate(0, math.sqrt(math.fabs(particle.dt)))
+    dWx = parcels.rng.normalvariate(0, math.sqrt(math.fabs(particle.dt)))
+    dWy = parcels.rng.normalvariate(0, math.sqrt(math.fabs(particle.dt)))
 
     u, v = fieldset.UV[time, particle.depth, particle.lat, particle.lon]
 
@@ -101,8 +101,8 @@ def DiffusionUniformKh(particle, fieldset, time):
     mean and a standard deviation of sqrt(dt).
     """
     # Wiener increment with zero mean and std of sqrt(dt)
-    dWx = ParcelsRandom.normalvariate(0, math.sqrt(math.fabs(particle.dt)))
-    dWy = ParcelsRandom.normalvariate(0, math.sqrt(math.fabs(particle.dt)))
+    dWx = parcels.rng.normalvariate(0, math.sqrt(math.fabs(particle.dt)))
+    dWy = parcels.rng.normalvariate(0, math.sqrt(math.fabs(particle.dt)))
 
     bx = math.sqrt(2 * fieldset.Kh_zonal[particle])
     by = math.sqrt(2 * fieldset.Kh_meridional[particle])
diff --git a/parcels/compilation/codegenerator.py b/parcels/compilation/codegenerator.py
index 197ec1279..effa9ed6a 100644
--- a/parcels/compilation/codegenerator.py
+++ b/parcels/compilation/codegenerator.py
@@ -238,7 +238,7 @@ def visit_Name(self, node):
             node = StatusCodeNode(math, ccode='')
         elif node.id == 'math':
             node = MathNode(math, ccode='')
-        elif node.id == 'ParcelsRandom':
+        elif node.id in ['ParcelsRandom', 'rng']:
             node = RandomNode(math, ccode='')
         elif node.id == 'print':
             node = PrintNode()
diff --git a/parcels/kernel.py b/parcels/kernel.py
index 1825b0efe..0e297eceb 100644
--- a/parcels/kernel.py
+++ b/parcels/kernel.py
@@ -5,8 +5,8 @@
 import math  # noqa
 import os
 import random  # noqa
-import re
 import sys
+import textwrap
 import types
 from copy import deepcopy
 from ctypes import byref, c_double, c_int
@@ -23,6 +23,7 @@
     MPI = None
 
 import parcels.rng as ParcelsRandom  # noqa
+from parcels import rng  # noqa
 from parcels.application_kernels.advection import (
     AdvectionAnalytical,
     AdvectionRK4_3D,
@@ -119,15 +120,6 @@ def _cache_key(self):
         key = self.name + self.ptype._cache_key + field_keys + ('TIME:%f' % ostime())
         return hashlib.md5(key.encode('utf-8')).hexdigest()
 
-    @staticmethod
-    def fix_indentation(string):
-        """Fix indentation to allow in-lined kernel definitions."""
-        lines = string.split('\n')
-        indent = re.compile(r"^(\s+)").match(lines[0])
-        if indent:
-            lines = [line.replace(indent.groups()[0], '', 1) for line in lines]
-        return "\n".join(lines)
-
     def remove_deleted(self, pset):
         """Utility to remove all particles that signalled deletion."""
         bool_indices = pset.particledata.state == StatusCode.Delete
@@ -176,8 +168,15 @@ def __init__(self, fieldset, ptype, pyfunc=None, funcname=None, funccode=None, p
         else:
             self.funcvars = None
         self.funccode = funccode or inspect.getsource(pyfunc.__code__)
+        self.funccode = (  # Remove parcels. prefix (see #1608)
+            self.funccode
+            .replace('parcels.rng', 'rng')
+            .replace('parcels.ParcelsRandom', 'ParcelsRandom')
+            .replace('parcels.StatusCode', 'StatusCode')
+        )
+
         # Parse AST if it is not provided explicitly
-        self.py_ast = py_ast or ast.parse(BaseKernel.fix_indentation(self.funccode)).body[0]
+        self.py_ast = py_ast or ast.parse(textwrap.dedent(self.funccode)).body[0]  # Dedent allows for in-lined kernel definitions
         if pyfunc is None:
             # Extract user context by inspecting the call stack
             stack = inspect.stack()
@@ -185,6 +184,7 @@ def __init__(self, fieldset, ptype, pyfunc=None, funcname=None, funccode=None, p
                 user_ctx = stack[-1][0].f_globals
                 user_ctx['math'] = globals()['math']
                 user_ctx['ParcelsRandom'] = globals()['ParcelsRandom']
+                user_ctx['rng'] = globals()['rng']
                 user_ctx['random'] = globals()['random']
                 user_ctx['StatusCode'] = globals()['StatusCode']
             except:
diff --git a/parcels/particlefile.py b/parcels/particlefile.py
index e301f137b..3044b8142 100644
--- a/parcels/particlefile.py
+++ b/parcels/particlefile.py
@@ -1,7 +1,7 @@
 """Module controlling the writing of ParticleSets to Zarr file."""
 import os
 from abc import ABC
-from datetime import timedelta as delta
+from datetime import timedelta
 
 import numpy as np
 import xarray as xr
@@ -61,7 +61,7 @@ class ParticleFile(ABC):
 
     def __init__(self, name, particleset, outputdt=np.inf, chunks=None, create_new_zarrfile=True):
 
-        self.outputdt = outputdt.total_seconds() if isinstance(outputdt, delta) else outputdt
+        self.outputdt = outputdt.total_seconds() if isinstance(outputdt, timedelta) else outputdt
         self.chunks = chunks
         self.particleset = particleset
         self.parcels_mesh = 'spherical'
@@ -202,7 +202,7 @@ def write(self, pset, time, indices=None):
         time :
             Time at which to write ParticleSet
         """
-        time = time.total_seconds() if isinstance(time, delta) else time
+        time = time.total_seconds() if isinstance(time, timedelta) else time
 
         if pset.particledata._ncount == 0:
             logger.warning("ParticleSet is empty on writing as array at time %g" % time)
diff --git a/parcels/particleset.py b/parcels/particleset.py
index a62004b6f..35c0d7bb2 100644
--- a/parcels/particleset.py
+++ b/parcels/particleset.py
@@ -2,8 +2,7 @@
 import sys
 from abc import ABC
 from copy import copy
-from datetime import date, datetime
-from datetime import timedelta as delta
+from datetime import date, datetime, timedelta
 
 import cftime
 import numpy as np
@@ -187,7 +186,7 @@ def ArrayClass_init(self, *args, **kwargs):
                 assert lon.size == kwargs[kwvar].size, (
                     f"{kwvar} and positions (lon, lat, depth) don't have the same lengths.")
 
-        self.repeatdt = repeatdt.total_seconds() if isinstance(repeatdt, delta) else repeatdt
+        self.repeatdt = repeatdt.total_seconds() if isinstance(repeatdt, timedelta) else repeatdt
         if self.repeatdt:
             if self.repeatdt <= 0:
                 raise 'Repeatdt should be > 0'
@@ -868,7 +867,7 @@ def execute(self, pyfunc=AdvectionRK4, pyfunc_inter=None, endtime=None, runtime=
                 self.interaction_kernel = self.InteractionKernel(pyfunc_inter, delete_cfiles=delete_cfiles)
 
         # Convert all time variables to seconds
-        if isinstance(endtime, delta):
+        if isinstance(endtime, timedelta):
             raise RuntimeError('endtime must be either a datetime or a double')
         if isinstance(endtime, datetime):
             endtime = np.datetime64(endtime)
@@ -878,18 +877,18 @@ def execute(self, pyfunc=AdvectionRK4, pyfunc_inter=None, endtime=None, runtime=
             if self.time_origin.calendar is None:
                 raise NotImplementedError('If fieldset.time_origin is not a date, execution endtime must be a double')
             endtime = self.time_origin.reltime(endtime)
-        if isinstance(runtime, delta):
+        if isinstance(runtime, timedelta):
             runtime = runtime.total_seconds()
-        if isinstance(dt, delta):
+        if isinstance(dt, timedelta):
             dt = dt.total_seconds()
         if abs(dt) <= 1e-6:
             raise ValueError('Time step dt is too small')
         if (dt * 1e6) % 1 != 0:
             raise ValueError('Output interval should not have finer precision than 1e-6 s')
         outputdt = output_file.outputdt if output_file else np.inf
-        if isinstance(outputdt, delta):
+        if isinstance(outputdt, timedelta):
             outputdt = outputdt.total_seconds()
-        if isinstance(callbackdt, delta):
+        if isinstance(callbackdt, timedelta):
             callbackdt = callbackdt.total_seconds()
 
         assert runtime is None or runtime >= 0, 'runtime must be positive'
diff --git a/parcels/tools/converters.py b/parcels/tools/converters.py
index 71ffdf9b5..5f9e8205e 100644
--- a/parcels/tools/converters.py
+++ b/parcels/tools/converters.py
@@ -1,6 +1,6 @@
 # flake8: noqa: E999
 import inspect
-from datetime import timedelta as delta
+from datetime import timedelta
 from math import cos, pi
 
 import cftime
@@ -116,7 +116,7 @@ def fulltime(self, time):
             else:
                 return self.time_origin + np.timedelta64(int(time), 's')
         elif self.calendar in _get_cftime_calendars():
-            return self.time_origin + delta(seconds=time)
+            return self.time_origin + timedelta(seconds=time)
         elif self.calendar is None:
             return self.time_origin + time
         else:


Test patch:
diff --git a/tests/test_advection.py b/tests/test_advection.py
index 50b9cd332..be5099911 100644
--- a/tests/test_advection.py
+++ b/tests/test_advection.py
@@ -1,5 +1,5 @@
 import math
-from datetime import timedelta as delta
+from datetime import timedelta
 
 import numpy as np
 import pytest
@@ -74,7 +74,7 @@ def test_advection_zonal(lon, lat, depth, mode, npart=10):
     pset2D = ParticleSet(fieldset2D, pclass=ptype[mode],
                          lon=np.zeros(npart) + 20.,
                          lat=np.linspace(0, 80, npart))
-    pset2D.execute(AdvectionRK4, runtime=delta(hours=2), dt=delta(seconds=30))
+    pset2D.execute(AdvectionRK4, runtime=timedelta(hours=2), dt=timedelta(seconds=30))
     assert (np.diff(pset2D.lon) > 1.e-4).all()
 
     dimensions['depth'] = depth
@@ -83,7 +83,7 @@ def test_advection_zonal(lon, lat, depth, mode, npart=10):
                          lon=np.zeros(npart) + 20.,
                          lat=np.linspace(0, 80, npart),
                          depth=np.zeros(npart) + 10.)
-    pset3D.execute(AdvectionRK4, runtime=delta(hours=2), dt=delta(seconds=30))
+    pset3D.execute(AdvectionRK4, runtime=timedelta(hours=2), dt=timedelta(seconds=30))
     assert (np.diff(pset3D.lon) > 1.e-4).all()
 
 
@@ -99,7 +99,7 @@ def test_advection_meridional(lon, lat, mode, npart=10):
                        lon=np.linspace(-60, 60, npart),
                        lat=np.linspace(0, 30, npart))
     delta_lat = np.diff(pset.lat)
-    pset.execute(AdvectionRK4, runtime=delta(hours=2), dt=delta(seconds=30))
+    pset.execute(AdvectionRK4, runtime=timedelta(hours=2), dt=timedelta(seconds=30))
     assert np.allclose(np.diff(pset.lat), delta_lat, rtol=1.e-4)
 
 
@@ -119,8 +119,8 @@ def test_advection_3D(mode, npart=11):
                        lon=np.zeros(npart),
                        lat=np.zeros(npart) + 1e2,
                        depth=np.linspace(0, 1, npart))
-    time = delta(hours=2).total_seconds()
-    pset.execute(AdvectionRK4, runtime=time, dt=delta(seconds=30))
+    time = timedelta(hours=2).total_seconds()
+    pset.execute(AdvectionRK4, runtime=time, dt=timedelta(seconds=30))
     assert np.allclose(pset.depth*pset.time, pset.lon, atol=1.e-1)
 
 
@@ -175,12 +175,12 @@ def test_advection_RK45(lon, lat, mode, rk45_tol, npart=10):
     fieldset = FieldSet.from_data(data2D, dimensions, mesh='spherical', transpose=True)
     fieldset.add_constant('RK45_tol', rk45_tol)
 
-    dt = delta(seconds=30).total_seconds()
+    dt = timedelta(seconds=30).total_seconds()
     RK45Particles = ptype[mode].add_variable('next_dt', dtype=np.float32, initial=dt)
     pset = ParticleSet(fieldset, pclass=RK45Particles,
                        lon=np.zeros(npart) + 20.,
                        lat=np.linspace(0, 80, npart))
-    pset.execute(AdvectionRK45, runtime=delta(hours=2), dt=dt)
+    pset.execute(AdvectionRK45, runtime=timedelta(hours=2), dt=dt)
     assert (np.diff(pset.lon) > 1.e-4).all()
     assert np.isclose(fieldset.RK45_tol, rk45_tol/(1852*60))
     print(fieldset.RK45_tol)
@@ -207,7 +207,7 @@ def test_advection_periodic_zonal(mode, xdim=100, ydim=100, halosize=3):
     assert len(fieldset.U.lon) == xdim + 2 * halosize
 
     pset = ParticleSet(fieldset, pclass=ptype[mode], lon=[0.5], lat=[0.5])
-    pset.execute(AdvectionRK4 + pset.Kernel(periodicBC), runtime=delta(hours=20), dt=delta(seconds=30))
+    pset.execute(AdvectionRK4 + pset.Kernel(periodicBC), runtime=timedelta(hours=20), dt=timedelta(seconds=30))
     assert abs(pset.lon[0] - 0.15) < 0.1
 
 
@@ -218,7 +218,7 @@ def test_advection_periodic_meridional(mode, xdim=100, ydim=100):
     assert len(fieldset.U.lat) == ydim + 10  # default halo size is 5 grid points
 
     pset = ParticleSet(fieldset, pclass=ptype[mode], lon=[0.5], lat=[0.5])
-    pset.execute(AdvectionRK4 + pset.Kernel(periodicBC), runtime=delta(hours=20), dt=delta(seconds=30))
+    pset.execute(AdvectionRK4 + pset.Kernel(periodicBC), runtime=timedelta(hours=20), dt=timedelta(seconds=30))
     assert abs(pset.lat[0] - 0.15) < 0.1
 
 
@@ -232,7 +232,7 @@ def test_advection_periodic_zonal_meridional(mode, xdim=100, ydim=100):
     assert np.allclose(np.diff(fieldset.U.lon), fieldset.U.lon[1]-fieldset.U.lon[0], rtol=0.001)
 
     pset = ParticleSet(fieldset, pclass=ptype[mode], lon=[0.4], lat=[0.5])
-    pset.execute(AdvectionRK4 + pset.Kernel(periodicBC), runtime=delta(hours=20), dt=delta(seconds=30))
+    pset.execute(AdvectionRK4 + pset.Kernel(periodicBC), runtime=timedelta(hours=20), dt=timedelta(seconds=30))
     assert abs(pset.lon[0] - 0.05) < 0.1
     assert abs(pset.lat[0] - 0.15) < 0.1
 
@@ -287,7 +287,7 @@ def truth_stationary(x_0, y_0, t):
 
 
 @pytest.fixture
-def fieldset_stationary(xdim=100, ydim=100, maxtime=delta(hours=6)):
+def fieldset_stationary(xdim=100, ydim=100, maxtime=timedelta(hours=6)):
     """Generate a FieldSet encapsulating the flow field of a stationary eddy.
 
     Reference: N. Fabbroni, 2009, "Numerical simulations of passive
@@ -322,8 +322,8 @@ def test_stationary_eddy(fieldset_stationary, mode, method, rtol, diffField, npa
         fieldset.add_constant('dres', 0.1)
     lon = np.linspace(12000, 21000, npart)
     lat = np.linspace(12500, 12500, npart)
-    dt = delta(minutes=3).total_seconds()
-    endtime = delta(hours=6).total_seconds()
+    dt = timedelta(minutes=3).total_seconds()
+    endtime = timedelta(hours=6).total_seconds()
 
     RK45Particles = ptype[mode].add_variable('next_dt', dtype=np.float32, initial=dt)
 
@@ -342,8 +342,8 @@ def test_stationary_eddy_vertical(mode, npart=1):
     lon = np.linspace(12000, 21000, npart)
     lat = np.linspace(10000, 20000, npart)
     depth = np.linspace(12500, 12500, npart)
-    endtime = delta(hours=6).total_seconds()
-    dt = delta(minutes=3).total_seconds()
+    endtime = timedelta(hours=6).total_seconds()
+    dt = timedelta(minutes=3).total_seconds()
 
     xdim = ydim = 100
     lon_data = np.linspace(0, 25000, xdim, dtype=np.float32)
@@ -385,7 +385,7 @@ def truth_moving(x_0, y_0, t):
 
 
 @pytest.fixture
-def fieldset_moving(xdim=100, ydim=100, maxtime=delta(hours=6)):
+def fieldset_moving(xdim=100, ydim=100, maxtime=timedelta(hours=6)):
     """Generate a FieldSet encapsulating the flow field of a moving eddy.
 
     Reference: N. Fabbroni, 2009, "Numerical simulations of passive
@@ -415,8 +415,8 @@ def test_moving_eddy(fieldset_moving, mode, method, rtol, diffField, npart=1):
         fieldset.add_constant('dres', 0.1)
     lon = np.linspace(12000, 21000, npart)
     lat = np.linspace(12500, 12500, npart)
-    dt = delta(minutes=3).total_seconds()
-    endtime = delta(hours=6).total_seconds()
+    dt = timedelta(minutes=3).total_seconds()
+    endtime = timedelta(hours=6).total_seconds()
 
     RK45Particles = ptype[mode].add_variable('next_dt', dtype=np.float32, initial=dt)
 
@@ -441,7 +441,7 @@ def truth_decaying(x_0, y_0, t):
 
 
 @pytest.fixture
-def fieldset_decaying(xdim=100, ydim=100, maxtime=delta(hours=6)):
+def fieldset_decaying(xdim=100, ydim=100, maxtime=timedelta(hours=6)):
     """Generate a FieldSet encapsulating the flow field of a decaying eddy.
 
     Reference: N. Fabbroni, 2009, "Numerical simulations of passive
@@ -480,8 +480,8 @@ def test_decaying_eddy(fieldset_decaying, mode, method, rtol, diffField, npart=1
         fieldset.add_constant('dres', 0.1)
     lon = np.linspace(12000, 21000, npart)
     lat = np.linspace(12500, 12500, npart)
-    dt = delta(minutes=3).total_seconds()
-    endtime = delta(hours=6).total_seconds()
+    dt = timedelta(minutes=3).total_seconds()
+    endtime = timedelta(hours=6).total_seconds()
 
     RK45Particles = ptype[mode].add_variable('next_dt', dtype=np.float32, initial=dt)
 
diff --git a/tests/test_diffusion.py b/tests/test_diffusion.py
index 02af18253..132df3c09 100644
--- a/tests/test_diffusion.py
+++ b/tests/test_diffusion.py
@@ -1,4 +1,4 @@
-from datetime import timedelta as delta
+from datetime import timedelta
 
 import numpy as np
 import pytest
@@ -41,11 +41,11 @@ def test_fieldKh_Brownian(mesh, mode, xdim=200, ydim=100, kh_zonal=100, kh_merid
     fieldset.add_constant_field("Kh_meridional", kh_meridional, mesh=mesh)
 
     npart = 1000
-    runtime = delta(days=1)
+    runtime = timedelta(days=1)
 
     ParcelsRandom.seed(1234)
     pset = ParticleSet(fieldset=fieldset, pclass=ptype[mode], lon=np.zeros(npart), lat=np.zeros(npart))
-    pset.execute(pset.Kernel(DiffusionUniformKh), runtime=runtime, dt=delta(hours=1))
+    pset.execute(pset.Kernel(DiffusionUniformKh), runtime=runtime, dt=timedelta(hours=1))
 
     expected_std_lon = np.sqrt(2*kh_zonal*mesh_conversion**2*runtime.total_seconds())
     expected_std_lat = np.sqrt(2*kh_meridional*mesh_conversion**2*runtime.total_seconds())
@@ -79,11 +79,11 @@ def test_fieldKh_SpatiallyVaryingDiffusion(mesh, mode, kernel, xdim=200, ydim=10
     fieldset.add_constant('dres', fieldset.U.lon[1]-fieldset.U.lon[0])
 
     npart = 100
-    runtime = delta(days=1)
+    runtime = timedelta(days=1)
 
     ParcelsRandom.seed(1636)
     pset = ParticleSet(fieldset=fieldset, pclass=ptype[mode], lon=np.zeros(npart), lat=np.zeros(npart))
-    pset.execute(pset.Kernel(kernel), runtime=runtime, dt=delta(hours=1))
+    pset.execute(pset.Kernel(kernel), runtime=runtime, dt=timedelta(hours=1))
 
     lats = pset.lat
     lons = pset.lon
diff --git a/tests/test_fieldset.py b/tests/test_fieldset.py
index 4b8b383e7..23dc7944c 100644
--- a/tests/test_fieldset.py
+++ b/tests/test_fieldset.py
@@ -2,7 +2,7 @@
 import gc
 import os
 import sys
-from datetime import timedelta as delta
+from datetime import timedelta
 
 import cftime
 import dask
@@ -720,7 +720,7 @@ def periodicBoundaryConditions(particle, fieldset, time):
     mem_0 = process.memory_info().rss
     mem_exhausted = False
     try:
-        pset.execute(pset.Kernel(AdvectionRK4)+periodicBoundaryConditions, dt=dt, runtime=delta(days=7), postIterationCallbacks=postProcessFuncs, callbackdt=delta(hours=12))
+        pset.execute(pset.Kernel(AdvectionRK4)+periodicBoundaryConditions, dt=dt, runtime=timedelta(days=7), postIterationCallbacks=postProcessFuncs, callbackdt=timedelta(hours=12))
     except MemoryError:
         mem_exhausted = True
     mem_steps_np = np.array(perflog.memory_steps)
@@ -770,9 +770,9 @@ def test_timestamps(datetype, tmpdir):
     fieldset2.U.data[0, :, :] = 0.
     fieldset2.write(tmpdir.join('file2'))
 
-    fieldset3 = FieldSet.from_parcels(tmpdir.join('file*'), time_periodic=delta(days=14))
+    fieldset3 = FieldSet.from_parcels(tmpdir.join('file*'), time_periodic=timedelta(days=14))
     timestamps = [dims1['time'], dims2['time']]
-    fieldset4 = FieldSet.from_parcels(tmpdir.join('file*'), timestamps=timestamps, time_periodic=delta(days=14))
+    fieldset4 = FieldSet.from_parcels(tmpdir.join('file*'), timestamps=timestamps, time_periodic=timedelta(days=14))
     assert np.allclose(fieldset3.U.grid.time_full, fieldset4.U.grid.time_full)
 
     for d in [0, 8, 10, 13]:
@@ -842,7 +842,7 @@ def sampleTemp(particle, fieldset, time):
     ])
 
     pset = ParticleSet.from_list(fieldset, pclass=MyParticle, lon=[0.5], lat=[0.5], depth=[0.5])
-    pset.execute(AdvectionRK4_3D + pset.Kernel(sampleTemp), runtime=delta(hours=51), dt=delta(hours=dt_sign*1))
+    pset.execute(AdvectionRK4_3D + pset.Kernel(sampleTemp), runtime=timedelta(hours=51), dt=timedelta(hours=dt_sign*1))
 
     if time_periodic is not False:
         t = pset.time[0]
@@ -882,7 +882,7 @@ def test_fieldset_defer_loading_with_diff_time_origin(tmpdir, fail, filename='te
     assert fieldset.U.creation_log == 'from_parcels'
     pset = ParticleSet.from_list(fieldset, pclass=JITParticle, lon=[0.5], lat=[0.5], depth=[0.5],
                                  time=[datetime.datetime(2018, 4, 20, 1)])
-    pset.execute(AdvectionRK4_3D, runtime=delta(hours=4), dt=delta(hours=1))
+    pset.execute(AdvectionRK4_3D, runtime=timedelta(hours=4), dt=timedelta(hours=1))
 
 
 @pytest.mark.parametrize('zdim', [2, 8])
diff --git a/tests/test_fieldset_sampling.py b/tests/test_fieldset_sampling.py
index 2bed43725..f232f9612 100644
--- a/tests/test_fieldset_sampling.py
+++ b/tests/test_fieldset_sampling.py
@@ -1,4 +1,4 @@
-from datetime import timedelta as delta
+from datetime import timedelta
 from math import cos, pi
 
 import numpy as np
@@ -484,9 +484,9 @@ def test_meridionalflow_spherical(mode, xdim=100, ydim=200):
 
     lonstart = [0, 45]
     latstart = [0, 45]
-    runtime = delta(hours=24)
+    runtime = timedelta(hours=24)
     pset = ParticleSet(fieldset, pclass=pclass(mode), lon=lonstart, lat=latstart)
-    pset.execute(pset.Kernel(AdvectionRK4), runtime=runtime, dt=delta(hours=1))
+    pset.execute(pset.Kernel(AdvectionRK4), runtime=runtime, dt=timedelta(hours=1))
 
     assert pset.lat[0] - (latstart[0] + runtime.total_seconds() * maxvel / 1852 / 60) < 1e-4
     assert pset.lon[0] - lonstart[0] < 1e-4
@@ -513,10 +513,10 @@ def test_zonalflow_spherical(mode, k_sample_p, xdim=100, ydim=200):
 
     lonstart = [0, 45]
     latstart = [0, 45]
-    runtime = delta(hours=24)
+    runtime = timedelta(hours=24)
     pset = ParticleSet(fieldset, pclass=pclass(mode), lon=lonstart, lat=latstart)
     pset.execute(pset.Kernel(AdvectionRK4) + k_sample_p,
-                 runtime=runtime, dt=delta(hours=1))
+                 runtime=runtime, dt=timedelta(hours=1))
 
     assert pset.lat[0] - latstart[0] < 1e-4
     assert pset.lon[0] - (lonstart[0] + runtime.total_seconds() * maxvel / 1852 / 60
diff --git a/tests/test_grids.py b/tests/test_grids.py
index 9553386a3..f01237e2e 100644
--- a/tests/test_grids.py
+++ b/tests/test_grids.py
@@ -1,6 +1,6 @@
 import math
 import os
-from datetime import timedelta as delta
+from datetime import timedelta
 
 import numpy as np
 import pytest
@@ -408,7 +408,7 @@ def test_advect_nemo(mode):
     lonp = 175.5
     latp = 81.5
     pset = ParticleSet.from_list(fieldset, ptype[mode], lon=[lonp], lat=[latp])
-    pset.execute(AdvectionRK4, runtime=delta(days=2), dt=delta(hours=6))
+    pset.execute(AdvectionRK4, runtime=timedelta(days=2), dt=timedelta(hours=6))
     assert abs(pset.lat[0] - latp) < 1e-3
 
 
@@ -633,7 +633,7 @@ def test_cgrid_indexing(mode, gridindexingtype, coordtype):
     lon = np.linspace(-a / 2, a / 2, xdim, dtype=np.float32)
     lat = np.linspace(-b / 2, b / 2, ydim, dtype=np.float32)
     dx, dy = lon[2] - lon[1], lat[2] - lat[1]
-    omega = 2 * np.pi / delta(days=1).total_seconds()
+    omega = 2 * np.pi / timedelta(days=1).total_seconds()
 
     index_signs = {'nemo': -1, 'mitgcm': 1}
     isign = index_signs[gridindexingtype]
@@ -703,7 +703,7 @@ def UpdateR(particle, fieldset, time):
     pset = ParticleSet(fieldset, pclass=MyParticle, lon=0, lat=4e3, time=0)
 
     pset.execute(pset.Kernel(UpdateR) + AdvectionRK4,
-                 runtime=delta(hours=14), dt=delta(minutes=5))
+                 runtime=timedelta(hours=14), dt=timedelta(minutes=5))
     assert np.allclose(pset.radius, pset.radius_start, atol=10)
 
 
@@ -719,7 +719,7 @@ def test_cgrid_indexing_3D(mode, gridindexingtype, withtime):
     lat = np.linspace(-b / 2, b / 2, ydim, dtype=np.float32)
     depth = np.linspace(-c / 2, c / 2, zdim, dtype=np.float32)
     dx, dz = lon[1] - lon[0], depth[1] - depth[0]
-    omega = 2 * np.pi / delta(days=1).total_seconds()
+    omega = 2 * np.pi / timedelta(days=1).total_seconds()
     if withtime:
         time = np.linspace(0, 24*60*60, 10)
         dimensions = {"lon": lon, "lat": lat, "depth": depth, "time": time}
@@ -781,7 +781,7 @@ def UpdateR(particle, fieldset, time):
     pset = ParticleSet(fieldset, pclass=MyParticle, depth=4e3, lon=0, lat=0, time=0)
 
     pset.execute(pset.Kernel(UpdateR) + AdvectionRK4_3D,
-                 runtime=delta(hours=14), dt=delta(minutes=5))
+                 runtime=timedelta(hours=14), dt=timedelta(minutes=5))
     assert np.allclose(pset.radius, pset.radius_start, atol=10)
 
 
@@ -797,7 +797,7 @@ def test_bgrid_indexing_3D(mode, gridindexingtype, withtime):
     lat = np.linspace(-b / 2, b / 2, ydim, dtype=np.float32)
     depth = np.linspace(-c / 2, c / 2, zdim, dtype=np.float32)
     dx, dz = lon[1] - lon[0], depth[1] - depth[0]
-    omega = 2 * np.pi / delta(days=1).total_seconds()
+    omega = 2 * np.pi / timedelta(days=1).total_seconds()
     if withtime:
         time = np.linspace(0, 24*60*60, 10)
         dimensions = {"lon": lon, "lat": lat, "depth": depth, "time": time}
@@ -860,7 +860,7 @@ def UpdateR(particle, fieldset, time):
     pset = ParticleSet(fieldset, pclass=MyParticle, depth=-9.995e3, lon=0, lat=0, time=0)
 
     pset.execute(pset.Kernel(UpdateR) + AdvectionRK4_3D,
-                 runtime=delta(hours=14), dt=delta(minutes=5))
+                 runtime=timedelta(hours=14), dt=timedelta(minutes=5))
     assert np.allclose(pset.radius, pset.radius_start, atol=10)
 
 
diff --git a/tests/test_kernel_execution.py b/tests/test_kernel_execution.py
index b51c3263b..5598d9e5a 100644
--- a/tests/test_kernel_execution.py
+++ b/tests/test_kernel_execution.py
@@ -4,6 +4,7 @@
 import numpy as np
 import pytest
 
+import parcels
 from parcels import (
     AdvectionRK4,
     FieldOutOfBoundError,
@@ -354,3 +355,71 @@ def test_compilers():
         params = param_class()  # noqa
 
     print(CCompiler_SS())
+
+
+@pytest.mark.parametrize('mode', ['scipy', 'jit'])
+def test_explicit_ParcelsRandom(fieldset, mode):
+    """
+    Testing `from parcels import ParcelsRandom` in kernel code
+    """
+    from parcels import ParcelsRandom
+
+    def nudge_kernel(particle, fieldset, time):
+        dlat = ParcelsRandom.uniform(2, 3)
+        particle_dlat += dlat  # noqa
+
+    pset = ParticleSet(fieldset, pclass=ptype[mode], lon=[0.5], lat=[0.5])
+    pset.execute(nudge_kernel, runtime=2, dt=1)
+    assert 2.5 <= pset[0].lat <= 3.5
+
+
+@pytest.mark.parametrize('mode', ['scipy', 'jit'])
+def test_parcels_dot_ParcelsRandom(fieldset, mode):
+    """
+    Testing `parcels.ParcelsRandom` in kernel code
+    """
+
+    def nudge_kernel(particle, fieldset, time):
+        particle_dlat += parcels.ParcelsRandom.uniform(2, 3) # noqa
+
+    pset = ParticleSet(fieldset, pclass=ptype[mode], lon=[0.5], lat=[0.5])
+    pset.execute(nudge_kernel, runtime=2, dt=1)
+    assert 2.5 <= pset[0].lat <= 3.5
+
+
+@pytest.mark.parametrize('mode', ['scipy', 'jit'])
+def test_parcels_dot_rng(fieldset, mode):
+    """
+    Testing `parcels.rng` in kernel code.
+    """
+
+    def nudge_kernel(particle, fieldset, time):
+        dlat = parcels.rng.uniform(2, 3)
+        particle_dlat += dlat  # noqa
+
+    pset = ParticleSet(fieldset, pclass=ptype[mode], lon=[0.5], lat=[0.5])
+    pset.execute(nudge_kernel, runtime=2, dt=1)
+    assert 2.5 <= pset[0].lat <= 3.5
+
+
+@pytest.mark.parametrize('mode', ['scipy', 'jit'])
+def test_custom_ParcelsRandom_alias(fieldset, mode):
+    """
+    Testing aliasing ParcelsRandom to another name.
+    """
+    from parcels import ParcelsRandom as my_custom_name
+
+    def nudge_kernel(particle, fieldset, time):
+        particle_dlat += my_custom_name.uniform(2, 3)  # noqa
+
+    pset = ParticleSet(fieldset, pclass=ptype[mode], lon=[0.5], lat=[0.5])
+
+    try:
+        pset.execute(nudge_kernel, runtime=2, dt=1)
+    except Exception:
+        pass  # This test is expected to fail
+    else:
+        pytest.fail(
+            "Parcels uses function name to determine kernel support. "
+            "Aliasing ParcelsRandom to another name is not supported."
+        )