Skip to content

Commit f1ce1e8

Browse files
Merge branch 'v4-dev' into add_XLinearVelocity
2 parents 4248b3f + afc820a commit f1ce1e8

File tree

12 files changed

+111
-328
lines changed

12 files changed

+111
-328
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ docs/_build/*
33
docs/_downloads
44
docs/jupyter_execute/*
55
docs/.jupyter_cache/*
6+
docs/reference
67
output
78

89
*.log

docs/_autoapi_templates/python/class.rst

Lines changed: 0 additions & 96 deletions
This file was deleted.

docs/_autoapi_templates/python/module.rst

Lines changed: 0 additions & 152 deletions
This file was deleted.

docs/conf.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@
116116
# directories to ignore when looking for source files.
117117
exclude_patterns = [
118118
"_build",
119-
"_autoapi_templates",
120119
"jupyter_execute",
121120
"**.ipynb_checkpoints",
122121
"user_guide/examples_v3",
@@ -544,5 +543,4 @@ def linkcode_resolve(domain, info):
544543
]
545544
autoapi_member_order = "bysource"
546545
autodoc_typehints = "none"
547-
autoapi_template_dir = "_autoapi_templates"
548546
autoapi_own_page_level = "class"

docs/getting_started/index.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,3 @@ Getting started with parcels is easy; here you will find:
99
🎓 Output tutorial <tutorial_output.ipynb>
1010
📖 Conceptual workflow <explanation_concepts.md>
1111
```
12-
13-
```{note}
14-
TODO: Add links to Reference API in quickstart tutorial and concepts explanation
15-
```

docs/getting_started/tutorial_quickstart.md

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ ds_fields
4141
As we can see, the reanalysis dataset contains eastward velocity `uo`, northward velocity `vo`, potential temperature
4242
(`thetao`) and salinity (`so`) fields.
4343

44-
These hydrodynamic fields need to be stored in a `parcels.FieldSet` object. Parcels provides tooling to parse many types
45-
of models or observations into such a `parcels.FieldSet` object. Here, we use `FieldSet.from_copernicusmarine()`, which
44+
These hydrodynamic fields need to be stored in a {py:obj}`parcels.FieldSet` object. Parcels provides tooling to parse many types
45+
of models or observations into such a `parcels.FieldSet` object. Here, we use {py:func}`parcels.FieldSet.from_copernicusmarine()`, which
4646
recognizes the standard names of a velocity field:
4747

4848
```{code-cell}
@@ -61,10 +61,10 @@ velocity = ds_fields.isel(time=0, depth=0).plot.quiver(x="longitude", y="latitud
6161
Now that we have created a `parcels.FieldSet` object from the hydrodynamic data, we need to provide our second input:
6262
the virtual particles for which we will calculate the trajectories.
6363

64-
We need to create a `parcels.ParticleSet` object with the particles' initial time and position. The `parcels.ParticleSet`
64+
We need to create a {py:obj}`parcels.ParticleSet` object with the particles' initial time and position. The `parcels.ParticleSet`
6565
object also needs to know about the `FieldSet` in which the particles "live". Finally, we need to specify the type of
66-
`parcels.Particle` we want to use. The default particles have `time`, `z`, `lat`, and `lon`, but you can easily add
67-
other `Variables` such as size, temperature, or age to create your own particles to mimic plastic or an [ARGO float](../user_guide/examples/tutorial_Argofloats.ipynb).
66+
{py:obj}`parcels.ParticleClass` we want to use. The default particles have `time`, `z`, `lat`, and `lon`, but you can easily add
67+
other {py:obj}`parcels.Variable`s such as size, temperature, or age to create your own particles to mimic plastic or an [ARGO float](../user_guide/examples/tutorial_Argofloats.ipynb).
6868

6969
```{code-cell}
7070
# Particle locations and initial time
@@ -90,13 +90,9 @@ ax.scatter(lon,lat,s=40,c='w',edgecolors='r');
9090
## Compute: `Kernel`
9191

9292
After setting up the input data and particle start locations and times, we need to specify what calculations to do with
93-
the particles. These calculations, or numerical integrations, will be performed by what we call a `Kernel`, operating on
93+
the particles. These calculations, or numerical integrations, will be performed by what we call a {py:obj}`parcels.Kernel`, operating on
9494
all particles in the `ParticleSet`. The most common calculation is the advection of particles through the velocity field.
95-
Parcels comes with a number of standard kernels, from which we will use the Runge-Kutta advection kernel `AdvectionRK2`:
96-
97-
```{note}
98-
TODO: link to a list of included kernels
99-
```
95+
Parcels comes with a number of common {py:obj}`parcels.kernels`, from which we will use the Runge-Kutta advection kernel {py:obj}`parcels.kernels.AdvectionRK2`:
10096

10197
```{code-cell}
10298
kernels = [parcels.kernels.AdvectionRK2]
@@ -105,7 +101,7 @@ kernels = [parcels.kernels.AdvectionRK2]
105101
## Prepare output: `ParticleFile`
106102

107103
Before starting the simulation, we must define where and how frequent we want to write the output of our simulation.
108-
We can define this in a `ParticleFile` object:
104+
We can define this in a {py:obj}`parcels.ParticleFile` object:
109105

110106
```{code-cell}
111107
output_file = parcels.ParticleFile("output-quickstart.zarr", outputdt=np.timedelta64(1, "h"))
@@ -117,18 +113,14 @@ the `outputdt` argument so that it captures the smallest timescales of our inter
117113

118114
## Run Simulation: `ParticleSet.execute()`
119115

120-
Finally, we can run the simulation by _executing_ the `ParticleSet` using the specified list of `kernels`.
116+
Finally, we can run the simulation by _executing_ the `ParticleSet` using the specified list of `kernels`. This is done using the {py:meth}`parcels.ParticleSet.execute()` method.
121117
Additionally, we need to specify:
122118

123119
- the `runtime`: for how long we want to simulate particles.
124120
- the `dt`: the timestep with which to perform the numerical integration in the `kernels`. Depending on the numerical
125121
integration scheme, the accuracy of our simulation will depend on `dt`. Read [this notebook](https://github.com/Parcels-code/10year-anniversary-session2/blob/8931ef69577dbf00273a5ab4b7cf522667e146c5/advection_and_windage.ipynb)
126122
to learn more about numerical accuracy.
127123

128-
```{note}
129-
TODO: add Michaels 10-years Parcels notebook to the user guide
130-
```
131-
132124
```{code-cell}
133125
:tags: [hide-output]
134126
pset.execute(

docs/user_guide/index.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@ The tutorials written for Parcels v3 are currently being updated for Parcels v4.
1717

1818
## How to
1919

20-
```{note}
21-
TODO: Add links to Reference API throughout
22-
```
23-
2420
```{note}
2521
**Migrate from v3 to v4** using [this migration guide](v4-migration.md)
2622
```

src/parcels/_core/basegrid.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ def search(self, z: float, y: float, x: float, ei=None) -> dict[str, tuple[int,
6060
- Unstructured grid: {"Z": (zi, zeta), "FACE": (fi, bcoords)}
6161
6262
Where:
63+
6364
- index (int): The cell position of the particles along the given axis
6465
- barycentric_coordinates (float or np.ndarray): The coordinates defining
6566
the particles positions within the grid cell. For structured grids, this

0 commit comments

Comments
 (0)