Skip to content

Commit a19e8c8

Browse files
reint-fischerreint-fischer
authored andcommitted
fix formatting in dt guide and interpolators guide
1 parent d4bbfc2 commit a19e8c8

File tree

2 files changed

+21
-19
lines changed

2 files changed

+21
-19
lines changed

docs/user_guide/examples/tutorial_dt_integrators.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@
154154
"\n",
155155
"$$\n",
156156
"\\begin{aligned}\n",
157-
"\\text{d}t < \\frac{1}{12 * 1.71e-5} = 4.9e3 \\text{ seconds}\n",
157+
"\\text{d}t < \\frac{1}{12 * 1.71 * 10^{-5}} = 4.9* 10^{3} \\text{ seconds}\n",
158158
"\\end{aligned}\n",
159159
"$$\n",
160160
"\n",

docs/user_guide/examples/tutorial_interpolation.ipynb

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
"metadata": {},
77
"source": [
88
"# 🖥️ Using `parcels.interpolators`\n",
9-
"Parcels comes with a number of different interpolation methods for tracer fields, such as temperature. Here, we will look at a few common `parcels.interpolators` for structured (`X`) grids, and how to configure them in an idealised example. For more guidance on the sampling of such fields, check out the [sampling tutorial](./tutorial_sampling).\n",
10-
"\n",
11-
"We first import the relevant modules"
9+
"Parcels comes with a number of different interpolation methods for fields on structured (`X`) and unstructured (`Ux`) grids. Here, we will look at a few common {py:obj}`parcels.interpolators` for tracer fiedls, and how to configure them in an idealised example. For more guidance on the sampling of such fields, check out the [sampling tutorial](./tutorial_sampling)."
1210
]
1311
},
1412
{
@@ -24,6 +22,14 @@
2422
"import parcels"
2523
]
2624
},
25+
{
26+
"cell_type": "markdown",
27+
"metadata": {},
28+
"source": [
29+
"## On structured grids\n",
30+
"We will first look at interpolation schemes which work on tracer fields defined on {py:obj}`parcels.XGrid` objects."
31+
]
32+
},
2733
{
2834
"attachments": {},
2935
"cell_type": "markdown",
@@ -53,7 +59,7 @@
5359
"cell_type": "markdown",
5460
"metadata": {},
5561
"source": [
56-
"From this dataset we create a `parcels.FieldSet`. Parcels requires an interpolation method to be set for each `parcels.Field`, which we will later adapt to see the effects of the different interpolators. A common interpolator for fields on structured grids is (tri)linear, implemented in `parcels.interpolators.XLinear`."
62+
"From this dataset we create a {py:obj}`parcels.FieldSet`. Parcels requires an interpolation method to be set for each {py:obj}`parcels.Field`, which we will later adapt to see the effects of the different interpolators. A common interpolator for fields on structured grids is (tri)linear, implemented in {py:obj}`parcels.interpolators.XLinear`."
5763
]
5864
},
5965
{
@@ -230,15 +236,11 @@
230236
"\n",
231237
"In the special case where a `parcels.Field` is constant in time and space, such as implementing constant diffusion on a spherical mesh, we can use:\n",
232238
"\n",
233-
"5. `interp_method=parcels.interpolators.XConstantField`: return single value of a Constant Field"
234-
]
235-
},
236-
{
237-
"cell_type": "markdown",
238-
"metadata": {},
239-
"source": [
240-
"```{note}\n",
241-
"TODO: link to reference API with all `parcels.interpolators`\n",
239+
"5. `interp_method=parcels.interpolators.XConstantField`: return single value of a Constant Field\n",
240+
"\n",
241+
"```{admonition} [..] API reference\n",
242+
":class: seealso\n",
243+
"All available interpolation methods are listed here: {py:obj}`parcels.interpolators`\n",
242244
"```"
243245
]
244246
},
@@ -249,14 +251,14 @@
249251
"### Interpolation at boundaries\n",
250252
"In some cases, we need to implement specific boundary conditions, for example to prevent particles from \n",
251253
"getting \"stuck\" near land. [This guide](../examples_v3/documentation_unstuck_Agrid.ipynb) describes \n",
252-
"how to implement this in parcels using `parcels.interpolators.XFreeslip` and `parcels.interpolators.XPartialslip`."
254+
"how to implement this in parcels using {py:obj}`parcels.interpolators.XFreeslip` and {py:obj}`parcels.interpolators.XPartialslip`."
253255
]
254256
},
255257
{
256258
"cell_type": "markdown",
257259
"metadata": {},
258260
"source": [
259-
"## Interpolation on unstructured grids\n",
261+
"## On unstructured grids\n",
260262
"Parcels v4 supports the use of general circulation model output that is defined on unstructured grids. We include basic interpolators to help you get started, including\n",
261263
"- `UxPiecewiseConstantFace` - this interpolator implements piecewise constant interpolation and is appropriate for data that is registered to the face centers of the unstructured grid\n",
262264
"- `UxPiecewiseLinearNode` - this interpolator implements barycentric interpolation and is appropriate for data that is registered to the corner vertices of the unstructured grid faces\n",
@@ -280,7 +282,7 @@
280282
"cell_type": "markdown",
281283
"metadata": {},
282284
"source": [
283-
"Next, we create the `Field` and `Fieldset` objects that will be used later in advancing particles. When creating a `Field` or `VectorField` object for unstructured grid data, we attach a `parcels.UxGrid` object and attach an `interp_method` to each object. For data that is defined on face centers, we use the `UxPiecewiseConstantFace` interpolator and for data that is defined on the face vertices, we use the `UxPiecewiseLinearNode` interpolator. In this example, we will look specifically at interpolating a tracer field that is defined by the same underlying analytical function, but is defined on both faces and vertices as separate fields."
285+
"Next, we create the `Field` and `Fieldset` objects that will be used later in advancing particles. When creating a `Field` or `VectorField` object for unstructured grid data, we attach a {py:obj}`parcels.UxGrid` object and attach an `interp_method` to each object. For data that is defined on face centers, we use the `UxPiecewiseConstantFace` interpolator and for data that is defined on the face vertices, we use the `UxPiecewiseLinearNode` interpolator. In this example, we will look specifically at interpolating a tracer field that is defined by the same underlying analytical function, but is defined on both faces and vertices as separate fields."
284286
]
285287
},
286288
{
@@ -494,7 +496,7 @@
494496
],
495497
"metadata": {
496498
"kernelspec": {
497-
"display_name": "Python 3 (ipykernel)",
499+
"display_name": "test-notebooks",
498500
"language": "python",
499501
"name": "python3"
500502
},
@@ -508,7 +510,7 @@
508510
"name": "python",
509511
"nbconvert_exporter": "python",
510512
"pygments_lexer": "ipython3",
511-
"version": "3.12.11"
513+
"version": "3.13.9"
512514
}
513515
},
514516
"nbformat": 4,

0 commit comments

Comments
 (0)