From 0d732877275b7aa11f1a4738f774e8358310bd55 Mon Sep 17 00:00:00 2001 From: Pascal Bourgault Date: Thu, 25 Jan 2024 14:37:51 -0500 Subject: [PATCH] update usage notebook --- docs/notebooks/usage.ipynb | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/docs/notebooks/usage.ipynb b/docs/notebooks/usage.ipynb index 36e278b9d..90aad6b6b 100644 --- a/docs/notebooks/usage.ipynb +++ b/docs/notebooks/usage.ipynb @@ -233,7 +233,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "Finally, `xclim` also allows us to call indicators using datasets and variable names." + "`xclim` also allows us to call indicators using datasets and variable names." ] }, { @@ -255,6 +255,26 @@ "gdd" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Finally, we can also get datasets as an output with the `as_dataset` option." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "with xclim.set_options(as_dataset=True, cf_compliance=\"log\"):\n", + " gdd_ds = xclim.atmos.growing_degree_days(\n", + " tas=daily_ds.air, thresh=\"10 degC\", freq=\"YS\", date_bounds=(\"04-01\", \"09-30\")\n", + " )\n", + "gdd_ds" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -367,9 +387,9 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.10" + "version": "3.11.7" } }, "nbformat": 4, - "nbformat_minor": 2 + "nbformat_minor": 4 }