diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 3f9192ec..d3f21f7a 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -4,7 +4,7 @@ updates: directory: "/.devcontainer" schedule: interval: "daily" - - package-ecosystem: "github-actions" - directory: "/.github" + - package-ecosystem: "github-actions" + directory: "/.github" schedule: interval: "monthly" diff --git a/advanced/apply_ufunc/core-dimensions.ipynb b/advanced/apply_ufunc/core-dimensions.ipynb index c453494c..82cb11ed 100644 --- a/advanced/apply_ufunc/core-dimensions.ipynb +++ b/advanced/apply_ufunc/core-dimensions.ipynb @@ -336,19 +336,19 @@ }, "source": [ "```{exercise}\n", - ":label: trapz\n", + ":label: trapezoid\n", "\n", - "Use `apply_ufunc` to apply `scipy.integrate.trapz` along the `time` axis.\n", + "Use `apply_ufunc` to apply `scipy.integrate.trapezoid` along the `time` axis.\n", "```\n", "\n", - "````{solution} trapz\n", + "````{solution} trapezoid\n", ":class: dropdown\n", "\n", "```python\n", "import scipy as sp\n", "import scipy.integrate\n", "\n", - "xr.apply_ufunc(scipy.integrate.trapz, ds, input_core_dims=[[\"time\"]], kwargs={\"axis\": -1})\n", + "xr.apply_ufunc(scipy.integrate.trapezoid, ds, input_core_dims=[[\"time\"]], kwargs={\"axis\": -1})\n", "```\n", "````" ] diff --git a/advanced/apply_ufunc/dask_apply_ufunc.ipynb b/advanced/apply_ufunc/dask_apply_ufunc.ipynb index 216fe92f..c38f614e 100644 --- a/advanced/apply_ufunc/dask_apply_ufunc.ipynb +++ b/advanced/apply_ufunc/dask_apply_ufunc.ipynb @@ -338,8 +338,8 @@ "in parallel to each block. This ability can be activated using\n", "`dask=\"parallelized\"`. \n", "\n", - "We will use `scipy.integrate.trapz` as an example of a function that cannot\n", - "handle dask arrays and requires a core dimension. If we call `trapz` with a dask\n", + "We will use `scipy.integrate.trapezoid` as an example of a function that cannot\n", + "handle dask arrays and requires a core dimension. If we call `trapezoid` with a dask\n", "array, we get a numpy array back that is, the values have been eagerly computed.\n", "This is undesirable behaviour\n" ] @@ -354,7 +354,7 @@ "import scipy as sp\n", "import scipy.integrate\n", "\n", - "sp.integrate.trapz(\n", + "sp.integrate.trapezoid(\n", " ds.air.data, axis=ds.air.get_axis_num(\"lon\")\n", ") # does NOT return a dask array, you should see activity on the dashboard" ] @@ -377,7 +377,7 @@ "outputs": [], "source": [ "integrated = xr.apply_ufunc(\n", - " sp.integrate.trapz,\n", + " sp.integrate.trapezoid,\n", " ds,\n", " input_core_dims=[[\"lon\"]],\n", " kwargs={\"axis\": -1},\n", @@ -479,7 +479,7 @@ "tags": [] }, "source": [ - "The core dimension for `trapz` is `lon`, and there is only one chunk along `lon`. This means that integrating along `lon` is a \"blockwise\" or \"embarrassingly parallel\" operation and `dask=\"parallelized\"` works quite well. \n", + "The core dimension for `trapezoid` is `lon`, and there is only one chunk along `lon`. This means that integrating along `lon` is a \"blockwise\" or \"embarrassingly parallel\" operation and `dask=\"parallelized\"` works quite well. \n", "\n", "```{caution} Question\n", "Do you understand why `integrate(ds)` when `ds` has a single chunk along `lon` is a \"embarrassingly parallel\" operation?\n", @@ -535,7 +535,7 @@ "source": [ "def integrate_wrapper(array, **kwargs):\n", " print(f\"received array of type {type(array)}, shape {array.shape}\")\n", - " result = sp.integrate.trapz(array, **kwargs)\n", + " result = sp.integrate.trapezoid(array, **kwargs)\n", " print(f\"received array of type {type(result)}, shape {result.shape}\")\n", " return result\n", "\n", @@ -611,7 +611,7 @@ "\n", "Conceptually, there is a two-way flow of information between various packages when executing `integrated.compute()`:\n", "\n", - "`xarray.apply_ufunc` ↔ `dask.array.apply_gufunc` ↔ `integrate_wrapper` ↔ `scipy.integrate.trapz` ↔ `ds.air.data`\n", + "`xarray.apply_ufunc` ↔ `dask.array.apply_gufunc` ↔ `integrate_wrapper` ↔ `scipy.integrate.trapezoid` ↔ `ds.air.data`\n", "\n", "\n", "When executed\n", @@ -619,7 +619,7 @@ "1. Xarray loops over all data variables.\n", "1. Xarray unwraps the underlying dask array (e.g. `ds.air`) and passes that to dask's `apply_gufunc`.\n", "1. `apply_gufunc` calls `integrate_wrapper` on each block of the array.\n", - "1. For each block, `integrate_wrapper` calls `scipy.integrate.trapz` and returns one block of the output array.\n", + "1. For each block, `integrate_wrapper` calls `scipy.integrate.trapezoid` and returns one block of the output array.\n", "1. dask stitches all the output blocks to form the output array.\n", "1. `xarray.apply_ufunc` wraps the output array with Xarray metadata to give the final result.\n", "\n",