10000 deploy: 9f99c2d0ebf36161ceb5be15927a809b02daed39 · xarray-contrib/xarray-tutorial@97ad034 · GitHub
[go: up one dir, main page]

Skip to content

Commit 97ad034

Browse files
committed
deploy: 9f99c2d
1 parent 8595d80 commit 97ad034

File tree

121 files changed

+5745
-6031
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

121 files changed

+5745
-6031
lines changed
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

_sources/advanced/apply_ufunc/core-dimensions.ipynb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -336,19 +336,19 @@
336336
},
337337
"source": [
338338
"```{exercise}\n",
339-
":label: trapz\n",
339+
":label: trapezoid\n",
340340
"\n",
341-
"Use `apply_ufunc` to apply `scipy.integrate.trapz` along the `time` axis.\n",
341+
"Use `apply_ufunc` to apply `scipy.integrate.trapezoid` along the `time` axis.\n",
342342
"```\n",
343343
"\n",
344-
"````{solution} trapz\n",
344+
"````{solution} trapezoid\n",
345345
":class: dropdown\n",
346346
"\n",
347347
"```python\n",
348348
"import scipy as sp\n",
349349
"import scipy.integrate\n",
350350
"\n",
351-
"xr.apply_ufunc(scipy.integrate.trapz, ds, input_core_dims=[[\"time\"]], kwargs={\"axis\": -1})\n",
351+
"xr.apply_ufunc(scipy.integrate.trapezoid, ds, input_core_dims=[[\"time\"]], kwargs={\"axis\": -1})\n",
352352
"```\n",
353353
"````"
354354
]

_sources/advanced/apply_ufunc/dask_apply_ufunc.ipynb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -338,8 +338,8 @@
338338
"in parallel to each block. This ability can be activated using\n",
339339
"`dask=\"parallelized\"`. \n",
340340
"\n",
341-
"We will use `scipy.integrate.trapz` as an example of a function that cannot\n",
342-
"handle dask arrays and requires a core dimension. If we call `trapz` with a dask\n",
341+
"We will use `scipy.integrate.trapezoid` as an example of a function that cannot\n",
342+
"handle dask arrays and requires a core dimension. If we call `trapezoid` with a dask\n",
343343
"array, we get a numpy array back that is, the values have been eagerly computed.\n",
344344
"This is undesirable behaviour\n"
345345
]
@@ -354,7 +354,7 @@
354354
"import scipy as sp\n",
355355
"import scipy.integrate\n",
356356
"\n",
357-
"sp.integrate.trapz(\n",
357+
"sp.integrate.trapezoid(\n",
358358
" ds.air.data, axis=ds.air.get_axis_num(\"lon\")\n",
359359
") # does NOT return a dask array, you should see activity on the dashboard"
360360
]
@@ -377,7 +377,7 @@
377377
"outputs": [],
378378
"source": [
379379
"integrated = xr.apply_ufunc(\n",
380-
" sp.integrate.trapz,\n",
380+
" sp.integrate.trapezoid,\n",
381381
" ds,\n",
382382
" input_core_dims=[[\"lon\"]],\n",
383383
" kwargs={\"axis\": -1},\n",
@@ -479,7 +479,7 @@
479479
"tags": []
480480
},
481481
"source": [
482-
"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",
482+
"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",
483483
"\n",
484484
"```{caution} Question\n",
485485
"Do you understand why `integrate(ds)` when `ds` has a single chunk along `lon` is a \"embarrassingly parallel\" operation?\n",
@@ -535,7 +535,7 @@
535535
"source": [
536536
"def integrate_wrapper(array, **kwargs):\n",
537537
" print(f\"received array of type {type(array)}, shape {array.shape}\")\n",
538-
" result = sp.integrate.trapz(array, **kwargs)\n",
538+
" result = sp.integrate.trapezoid(array, **kwargs)\n",
539539
" print(f\"received array of type {type(result)}, shape {result.shape}\")\n",
540540
" return result\n",
541541
"\n",
@@ -611,15 +611,15 @@
611611
"\n",
612612
"Conceptually, there is a two-way flow of information between various packages when executing `integrated.compute()`:\n",
613613
"\n",
614-
"`xarray.apply_ufunc` ↔ `dask.array.apply_gufunc` ↔ `integrate_wrapper` ↔ `scipy.integrate.trapz` ↔ `ds.air.data`\n",
614+
"`xarray.apply_ufunc` ↔ `dask.array.apply_gufunc` ↔ `integrate_wrapper` ↔ `scipy.integrate.trapezoid` ↔ `ds.air.data`\n",
615615
"\n",
616616
"\n",
617617
"When executed\n",
618618
"\n",
619619
"1. Xarray loops over all data variables.\n",
620620
"1. Xarray unwraps the underlying dask array (e.g. `ds.air`) and passes that to dask's `apply_gufunc`.\n",
621621
"1. `apply_gufunc` calls `integrate_wrapper` on each block of the array.\n",
622-
"1. For each block, `integrate_wrapper` calls `scipy.integrate.trapz` and returns one block of the output array.\n",
622+
"1. For each block, `integrate_wrapper` calls `scipy.integrate.trapezoid` and returns one block of the output array.\n",
623623
"1. dask stitches all the output blocks to form the output array.\n",
624624
"1. `xarray.apply_ufunc` wraps the output array with Xarray metadata to give the final result.\n",
625625
"\n",

advanced/accessors/01_accessor_examples.html

Lines changed: 104 additions & 104 deletions
Large diffs are not rendered by default.

advanced/apply_ufunc/automatic-vectorizing-numpy.html

Lines changed: 106 additions & 106 deletions
Large diffs are not rendered by default.

advanced/apply_ufunc/complex-output-numpy.html

Lines changed: 49 additions & 49 deletions
Large diffs are not rendered by default.

advanced/apply_ufunc/core-dimensions.html

Lines changed: 80 additions & 77 deletions
Large diffs are not rendered by default.

advanced/apply_ufunc/dask_apply_ufunc.html

Lines changed: 170 additions & 213 deletions
Large diffs are not rendered by default.

advanced/apply_ufunc/example-interp.html

Lines changed: 106 additions & 106 deletions
Large diffs are not rendered by default.

advanced/apply_ufunc/numba-vectorization.html

Lines changed: 16 additions & 16 deletions
Large diffs are not rendered by default.

advanced/apply_ufunc/simple_numpy_apply_ufunc.html

Lines changed: 238 additions & 232 deletions
Large diffs are not rendered by default.

advanced/backends/1.Backend_without_Lazy_Loading.html

Lines changed: 8 additions & 8 deletions
Large diffs are not rendered by default.

advanced/backends/2.Backend_with_Lazy_Loading.html

Lines changed: 13 additions & 13 deletions
Large diffs are not rendered by default.

advanced/map_blocks/simple_map_blocks.html

Lines changed: 56 additions & 56 deletions
Large diffs are not rendered by default.

fundamentals/01.1_creating_data_structures.html

Lines changed: 1163 additions & 1163 deletions
Large diffs are not rendered by default.

fundamentals/01.1_io.html

Lines changed: 22 additions & 22 deletions
Large diffs are not rendered by default.

fundamentals/01_datastructures.html

Lines changed: 566 additions & 602 deletions
Large diffs are not rendered by default.

fundamentals/02.1_indexing_Basic.html

Lines changed: 537 additions & 574 deletions
Large diffs are not rendered by default.

fundamentals/02.2_manipulating_dimensions.html

Lines changed: 23 additions & 23 deletions
Large diffs are not rendered by default.

fundamentals/02.3_aligning_data_objects.html

Lines changed: 62 additions & 62 deletions
Large diffs are not rendered by default.

fundamentals/03.1_computation_with_xarray.html

Lines changed: 72 additions & 72 deletions
Large diffs are not rendered by default.

fundamentals/03.2_groupby_with_xarray.html

Lines changed: 158 additions & 158 deletions
Large diffs are not rendered by default.

fundamentals/03.3_windowed.html

Lines changed: 96 additions & 96 deletions
Large diffs are not rendered by default.

fundamentals/03.4_weighted.html

Lines changed: 19 additions & 19 deletions
Large diffs are not rendered by default.

fundamentals/04.1_basic_plotting.html

Lines changed: 35 additions & 36 deletions
Large diffs are not rendered by default.

fundamentals/04.2_faceting.html

Lines changed: 17 additions & 17 deletions
Large diffs are not rendered by default.

fundamentals/04.3_geographic_plotting.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -583,14 +583,14 @@ <h2>Basic plot<a class="headerlink" href="#basic-plot" title="Permalink to this
583583
</div>
584584
</div>
585585
<div class="cell_output docutils container">
586-
<div class="output text_plain highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>&lt;cartopy.mpl.feature_artist.FeatureArtist at 0x7f32a3bf4d90&gt;
586+
<div class="output text_plain highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>&lt;cartopy.mpl.feature_artist.FeatureArtist at 0x7f8a47a4cb10&gt;
587587
</pre></div>
588588
</div>
589589
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/home/runner/micromamba/envs/xarray-tutorial/lib/python3.11/site-packages/cartopy/io/__init__.py:241: DownloadWarning: Downloading: https://naturalearth.s3.amazonaws.com/110m_physical/ne_110m_coastline.zip
590590
warnings.warn(f&#39;Downloading: {url}&#39;, DownloadWarning)
591591
</pre></div>
592592
</div>
593-
<img alt="../_images/6aa88550f7b7fe93a508059baee9ec32731ef8de2cd6fd18483ebae74f21b543.png" src="../_images/6aa88550f7b7fe93a508059baee9ec32731ef8de2cd6fd18483ebae74f21b543.png" />
593+
<img alt="../_images/1e4bdea05bd82cd6698b29a3a4698e583cb0f2e1b96a43545d0cfe6e353a1875.png" src="../_images/1e4bdea05bd82cd6698b29a3a4698e583cb0f2e1b96a43545d0cfe6e353a1875.png" />
594594
</div>
595595
</div>
596596
</section>
@@ -616,10 +616,10 @@ <h2>Faceting maps<a class="headerlink" href="#faceting-maps" title="Permalink to
616616
</div>
617617
</div>
618618
<div class="cell_output docutils container">
619-
<div class="output text_plain highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>&lt;xarray.plot.facetgrid.FacetGrid at 0x7f32f8f91150&gt;
619+
<div class="output text_plain highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>&lt;xarray.plot.facetgrid.FacetGrid at 0x7f8a3e2bfa90&gt;
620620
</pre></div>
621621
</div>
622-
<img alt="../_images/d42ea224879b0993d6348e40f1a973f9138cbe5f2aeef7f1f5983857069ef1e5.png" src="../_images/d42ea224879b0993d6348e40f1a973f9138cbe5f2aeef7f1f5983857069ef1e5.png" />
622+
<img alt="../_images/1155c1e9767635ce60fe0992e36c182868f5a1ca3ba95fdc5d69a4431ebe6c64.png" src="../_images/1155c1e9767635ce60fe0992e36c182868f5a1ca3ba95fdc5d69a4431ebe6c64.png" />
623623
</div>
624624
</div>
625625
</section>

0 commit comments

Comments
 (0)
0