diff --git a/talks/Dkrz_User_Workshop/Figure_01.jpg b/talks/Dkrz_User_Workshop/Figure_01.jpg new file mode 100644 index 0000000..5731adc Binary files /dev/null and b/talks/Dkrz_User_Workshop/Figure_01.jpg differ diff --git a/talks/Dkrz_User_Workshop/Figure_02-a.jpg b/talks/Dkrz_User_Workshop/Figure_02-a.jpg new file mode 100644 index 0000000..3d542a7 Binary files /dev/null and b/talks/Dkrz_User_Workshop/Figure_02-a.jpg differ diff --git a/talks/Dkrz_User_Workshop/Figure_02.jpg b/talks/Dkrz_User_Workshop/Figure_02.jpg new file mode 100644 index 0000000..0b5199f Binary files /dev/null and b/talks/Dkrz_User_Workshop/Figure_02.jpg differ diff --git a/talks/Dkrz_User_Workshop/.ipynb_checkpoints/Freva-checkpoint.ipynb b/talks/Dkrz_User_Workshop/Freva.ipynb similarity index 82% rename from talks/Dkrz_User_Workshop/.ipynb_checkpoints/Freva-checkpoint.ipynb rename to talks/Dkrz_User_Workshop/Freva.ipynb index 5f4da3f..6397595 100644 --- a/talks/Dkrz_User_Workshop/.ipynb_checkpoints/Freva-checkpoint.ipynb +++ b/talks/Dkrz_User_Workshop/Freva.ipynb @@ -33,7 +33,7 @@ } }, "source": [ - "

by: Brian Lewis, Christopher Kadow, Etor Lucio Eceiza, Mahesh Ramadoss, Martin Bergemann and many others

" + "

by: Brian Lewis, Christopher Kadow, Etor Lucio Eceiza, Andrej Fast, Martin Bergemann and many others

" ] }, { @@ -45,8 +45,8 @@ } }, "source": [ - "

I. Finding Data

\n", - "" + "

Common Problem I: Finding Data

\n", + "" ] }, { @@ -58,8 +58,21 @@ } }, "source": [ - "

II. Make use of others code

\n", - "" + "

Common Problem II: Use code of others

\n", + "" + ] + }, + { + "cell_type": "markdown", + "id": "1149b078", + "metadata": { + "slideshow": { + "slide_type": "subslide" + } + }, + "source": [ + "

Common Problem III. Remember your own code

\n", + "" ] }, { @@ -137,7 +150,7 @@ } }, "source": [ - "## Example: Searching and reading CMIP6 data" + "## Example I: Searching and reading CMIP6 data" ] }, { @@ -192,7 +205,7 @@ "source": [ "

Web UI

\n", "" ] @@ -219,7 +232,7 @@ } }, "source": [ - "## Example Data analysis tool / plugins" + "## Example II: Data analysis tool / plugins" ] }, { @@ -303,7 +316,7 @@ "```python\n", "from evaluation_system.api import plugin\n", "from evaluation_system.api.parameters import File, ParameterDictionary, SolrField\n", - "class PlottingTool(plugin.PluginAbstr|act):\n", + "class PlottingTool(plugin.PluginAbstract):\n", "\"\"\"Plugin that plots content of selected data.\"\"\"\n", "```" ] @@ -317,7 +330,7 @@ } }, "source": [ - "

\n", + "

\n", "```python\n", "# Plugin setup\n", " tool_developer = {\"name\": \"Jane Doe\", \"email\": \"Jane.Doe@example.com\"}\n", @@ -351,7 +364,7 @@ } }, "source": [ - "

\n", + "

\n", "```python\n", "# Workflow definition of the actual tool\n", " def runTool(self, setup: dict[str, str] = {}) -> None:\n", @@ -411,82 +424,90 @@ }, { "cell_type": "markdown", - "id": "8e02b904", + "id": "d2bfbc6d", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ - "## A couple of additional features:\n", - "- Users can search their own plugin history and other users results\n", - "- Web UI suggests similar results on plugin config\n", - "- Full integration of workload managers" + "## Example III: Users adding their own data" ] }, { "cell_type": "markdown", - "id": "3ca11b56", - "metadata": { - "slideshow": { - "slide_type": "slide" - } - }, + "id": "3f2e06b5", + "metadata": {}, "source": [ - "## What's next?" + "```python\n", + "import freva\n", + "import xarray as xr\n", + "\n", + "user_data = freva.UserData()\n", + "user_data.add(\"eur-11b\", \"/tmp/my_awesome_data/outfile_?.nc\",\n", + " institute=\"clex\", model=\"UM-RA2T\",\n", + " experiment=\"Bias-correct\")\n", + "dset = xr.open_mfdataset(freva.databrowser(experiment=\"bias*\", experiment=\"clex\"))\n", + "```" ] }, { "cell_type": "markdown", - "id": "f589a7c8", + "id": "8e02b904", "metadata": { "slideshow": { - "slide_type": "subslide" + "slide_type": "slide" } }, "source": [ - "## Moving into the cloud\n", - "\n", - "* Different Data Sources:\n", - " * Cloud storage formats (S3/Swift)\n", - " * ECMWF/ESGF data storage\n", - " * Tape archives" + "## A couple of additional features:\n", + "- Users can search their own plugin history and other users results\n", + "- Web UI suggests similar results on plugin config\n", + "- Full integration of workload managers" ] }, { "cell_type": "markdown", - "id": "39148a8e", + "id": "3ca11b56", "metadata": { "slideshow": { - "slide_type": "subslide" + "slide_type": "slide" } }, "source": [ - "## Containerising the User Plugins\n", - "\n", - "* Advantages:\n", - " * Host architecture independent (sort of)\n", - " * Better reproducibility than anaconda\n", - " * Scalable solutions (kubernetes)" + "## What's next?" ] }, { "cell_type": "markdown", - "id": "e10e36fb", + "id": "f589a7c8", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ - "# More features coming up in Warm Wold" + "* Freva *has* to be come a RestAPI\n", + " * Clients are easy to implement since we only need a couple of REST calls\n", + "* We teach freva the Common Workflow Language (cwl) via toil:\n", + "```yaml\n", + "cwlVersion: v1.0\n", + "class: CommandLineTool\n", + "hints:\n", + " SoftwareRequirement:\n", + " packages:\n", + " - package: cdo\n", + "baseCommand: cdo\n", + "```\n", + "* We add a system for [ordering/pre-processing data](https://www-regiklim.dkrz.de/plugins/climpact/setup/)\n", + "* We add a simple interface for intake\n" ] } ], "metadata": { "celltoolbar": "Slideshow", "kernelspec": { - "display_name": "Plotting for (plotting)", + "display_name": "plotting", "language": "python", "name": "plotting" }, @@ -500,7 +521,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.2" + "version": "3.10.4" } }, "nbformat": 4, diff --git a/talks/Dkrz_User_Workshop/include.html b/talks/Dkrz_User_Workshop/include.html index 60928a7..4938461 100644 --- a/talks/Dkrz_User_Workshop/include.html +++ b/talks/Dkrz_User_Workshop/include.html @@ -1,102 +1,165 @@ document.write(` -
-
-
-
-
-
-

Freva - Data search and analysis framework for the Community

+
+ -
-
-
-

+
-
-
-
+
-
-
-
+
-
-
-
-
-

Common Problem III: Reproducibility

-
- -
-

-
-
-
+
+
+
-
-
-
-

Yet another solution:

+
-
-
-
-

Freva: The free evaluation system framework

-
+
+
+ + + + `); diff --git a/talks/Dkrz_User_Workshop/screencast_2.webm b/talks/Dkrz_User_Workshop/screencast_2.webm index ed88a55..1a6a8a5 100644 Binary files a/talks/Dkrz_User_Workshop/screencast_2.webm and b/talks/Dkrz_User_Workshop/screencast_2.webm differ diff --git a/talks/GeoJson_Viewer/.ipynb_checkpoints/GeoJsonViewer-checkpoint.ipynb b/talks/GeoJson_Viewer/.ipynb_checkpoints/GeoJsonViewer-checkpoint.ipynb new file mode 100644 index 0000000..c5527fd --- /dev/null +++ b/talks/GeoJson_Viewer/.ipynb_checkpoints/GeoJsonViewer-checkpoint.ipynb @@ -0,0 +1,165 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "f066d572", + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "# Geojson Viewer\n", + "A simple web based application that lets you *load* / *display* and *edit* geo reference data. " + ] + }, + { + "cell_type": "markdown", + "id": "07911151", + "metadata": { + "slideshow": { + "slide_type": "fragment" + } + }, + "source": [ + "Requirements:\n", + "\n", + "- Upload GeoJSON files, containing geo-referenced features and their properties.\n", + "- Show uploaded features and their properties on a dynamic web map.\n", + "- Modify/*Add* existing properties for features shown on the map.\n", + "- Save updated features with their properties to GeoJson file." + ] + }, + { + "cell_type": "markdown", + "id": "f3014d1f", + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "## Tech Stack\n", + "\n", + "Ploty Dash as framework. Why?\n", + "\n", + "- build upon `Plotly.js` 🡲 easy and fast react UI development\n", + " - easy to set up via `conda`\n", + " - front end included\n", + "- easy backend development using `@decorators`\n", + " - set up an working web application within couple of hours\n", + "- easy to extent via data driven tech stack \n", + " - pandas, plotly, etc" + ] + }, + { + "cell_type": "markdown", + "id": "635cd948", + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "### Example: Simple backend development\n", + "```python\n", + "\n", + "@app.callback(\n", + " Output(\"graph\", \"figure\"),\n", + " Input(\"column1\", \"value\"),\n", + " Input(\"table\", \"data\"),\n", + ")\n", + "def display_choropleth(\n", + " columns: list[str | None] | None,\n", + " table_data: list[dict[str, Any]],\n", + ") -> plotly.graph_objects.Figure:\n", + "\n", + " location, color = cast(list[str], columns)\n", + " data_frame = pandas.DataFrame(table_data).astype(geo_json_obj.dtypes)\n", + " fig = plotly.express.choropleth(\n", + " data_frame,\n", + " geojson=geojson[[color, location, \"geometry\"]].to_json(),\n", + " color=color,\n", + " locations=location,\n", + " color_continuous_scale=\"Viridis\",\n", + " featureidkey=f\"properties.{location}\",\n", + " )\n", + " fig.update_geos(projection_type=\"orthographic\", fitbounds=\"locations\")\n", + " return fig\n", + "\n", + "```" + ] + }, + { + "cell_type": "markdown", + "id": "ae834b6a", + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "## Features:\n", + "\n", + "- Easy to use tabbing layout\n", + "- Upload or use online geo reference data sources (geojson, shape, ...)\n", + "- Interactively display geo data on a map.\n", + "- Adjust/Reset data sources\n", + "- Download and save modified data to disk.\n", + "\n", + "## Droped Features\n", + "- Add existing columns\n", + " - tedious to add data by hand for many rows" + ] + }, + { + "cell_type": "markdown", + "id": "1e97fa54", + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "

Application at work

\n", + "
\n", + " \n", + "
" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "a59b4f1a", + "metadata": { + "slideshow": { + "slide_type": "skip" + } + }, + "outputs": [], + "source": [] + } + ], + "metadata": { + "celltoolbar": "Slideshow", + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.10.4" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/talks/GeoJson_Viewer/GeoJsonViewer.ipynb b/talks/GeoJson_Viewer/GeoJsonViewer.ipynb new file mode 100644 index 0000000..c5527fd --- /dev/null +++ b/talks/GeoJson_Viewer/GeoJsonViewer.ipynb @@ -0,0 +1,165 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "f066d572", + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "# Geojson Viewer\n", + "A simple web based application that lets you *load* / *display* and *edit* geo reference data. " + ] + }, + { + "cell_type": "markdown", + "id": "07911151", + "metadata": { + "slideshow": { + "slide_type": "fragment" + } + }, + "source": [ + "Requirements:\n", + "\n", + "- Upload GeoJSON files, containing geo-referenced features and their properties.\n", + "- Show uploaded features and their properties on a dynamic web map.\n", + "- Modify/*Add* existing properties for features shown on the map.\n", + "- Save updated features with their properties to GeoJson file." + ] + }, + { + "cell_type": "markdown", + "id": "f3014d1f", + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "## Tech Stack\n", + "\n", + "Ploty Dash as framework. Why?\n", + "\n", + "- build upon `Plotly.js` 🡲 easy and fast react UI development\n", + " - easy to set up via `conda`\n", + " - front end included\n", + "- easy backend development using `@decorators`\n", + " - set up an working web application within couple of hours\n", + "- easy to extent via data driven tech stack \n", + " - pandas, plotly, etc" + ] + }, + { + "cell_type": "markdown", + "id": "635cd948", + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "### Example: Simple backend development\n", + "```python\n", + "\n", + "@app.callback(\n", + " Output(\"graph\", \"figure\"),\n", + " Input(\"column1\", \"value\"),\n", + " Input(\"table\", \"data\"),\n", + ")\n", + "def display_choropleth(\n", + " columns: list[str | None] | None,\n", + " table_data: list[dict[str, Any]],\n", + ") -> plotly.graph_objects.Figure:\n", + "\n", + " location, color = cast(list[str], columns)\n", + " data_frame = pandas.DataFrame(table_data).astype(geo_json_obj.dtypes)\n", + " fig = plotly.express.choropleth(\n", + " data_frame,\n", + " geojson=geojson[[color, location, \"geometry\"]].to_json(),\n", + " color=color,\n", + " locations=location,\n", + " color_continuous_scale=\"Viridis\",\n", + " featureidkey=f\"properties.{location}\",\n", + " )\n", + " fig.update_geos(projection_type=\"orthographic\", fitbounds=\"locations\")\n", + " return fig\n", + "\n", + "```" + ] + }, + { + "cell_type": "markdown", + "id": "ae834b6a", + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "## Features:\n", + "\n", + "- Easy to use tabbing layout\n", + "- Upload or use online geo reference data sources (geojson, shape, ...)\n", + "- Interactively display geo data on a map.\n", + "- Adjust/Reset data sources\n", + "- Download and save modified data to disk.\n", + "\n", + "## Droped Features\n", + "- Add existing columns\n", + " - tedious to add data by hand for many rows" + ] + }, + { + "cell_type": "markdown", + "id": "1e97fa54", + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "

Application at work

\n", + "
\n", + " \n", + "
" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "a59b4f1a", + "metadata": { + "slideshow": { + "slide_type": "skip" + } + }, + "outputs": [], + "source": [] + } + ], + "metadata": { + "celltoolbar": "Slideshow", + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.10.4" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/talks/GeoJson_Viewer/GeoJsonViewer.slides.html b/talks/GeoJson_Viewer/GeoJsonViewer.slides.html new file mode 100644 index 0000000..eb211e8 --- /dev/null +++ b/talks/GeoJson_Viewer/GeoJsonViewer.slides.html @@ -0,0 +1,14847 @@ + + + + + + + + + +GeoJsonViewer slides + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+
+
+
+
+
+
+ + + + + + + + + + + diff --git a/talks/GeoJson_Viewer/include.html b/talks/GeoJson_Viewer/include.html new file mode 100644 index 0000000..60928a7 --- /dev/null +++ b/talks/GeoJson_Viewer/include.html @@ -0,0 +1,202 @@ +document.write(` + +
+
+
+
+
+
+

Freva - Data search and analysis framework for the Community

+
+
+
+
+
+
+

+ +
+
+
+
+
+
+

by: Andrej Fast, Brian Lewis, Christopher Kadow, Etor Lucio Eceiza, Martin Bergemann and many others

+
+
+
+
+
+
+

Common Problem I: Finding Data

+

+ +
+
+
+
+
+
+

Common Problem II: Use code of others

+

+ +
+
+
+
+
+
+
+

Common Problem III: Reproducibility

+
+ +
+

+
+
+
+
+ +
+
+
+
    +
  • How can we search and access various datasets efficiently?
  • +
  • How can we streamline user data analysis tools (reusable and reproducible)?
  • +
+ +
+
+
+
+
+
+

Yet another solution:

+
+
+
+
+
+
+

Freva: The free evaluation system framework

+
+
+
+
+
+ +
+
+
+
+

Example I: Searching and reading CMIP6 data

+
+
+
+
+
+
+

I. Python call:

import freva
+import xarray as xr
+files = freva.databrowser(
+    project="cmip6",
+    experiment="historical",
+    model="mpi*",
+    ensemble="r1i1*",
+    variable="tas",
+    time_frequency="mon"
+)
+dset = xr.open_mfdataset(files, combine="by_coords", parallel=True)
+
+ +
+
+
+
+
+
+

II. Command line call:

⋊  freva databrowser project=cmip6 experiment=historical model='mip*' ensemble='r1i1*' time_frequency=mon variable=tas
+
+ +
+
+
+
+
+
+

III. Web user interface:

+ +
+
+
+
+
+
+
+

Example II: Data analysis tool / plugins

+
+
+
+
+
+
+

Create animation of high resolution data

    +
  • Where is the data?
  • +
  • Where are the tools/libraries? Like video codecs etc
  • +
  • ...
  • +
+

Solution: Use an existing freva plugin.

+
+
+
+
+
+
+

The animator plugin:

+ +
+
+
+
+
+

Plugin command line interface:

+
+
⋊  freva plugin -l
+Animator: Animate data on lon/lat grids
+ClimateChangeProfile: Create climate change signals.
+ClimDexCalc: Calculate the ETCCDI climate extreme indices on the
+             basis of daily temperature and precipitation data using
+             the ClimDex software provided by PCIC.
+Climpact: Process climate model data for input of impact model
+CWT: Calculate Circulation Weather Type by mean sea level pressure.
+EnsemblePlotter: Create and Plot maps of multi-model ensemble means and
+                 standard deviations
+MoviePlotter: Plots 2D lon/lat movies in GIF format
+Papermill: Parametrize a given notebook
+
+ +
+
+
+
+
+
+
freva-plugin animator variable=pr project=reanalysis experiment=era5 cmap=Blues
+
+
+
+
+ + +`); diff --git a/talks/GeoJson_Viewer/index.slides.html b/talks/GeoJson_Viewer/index.slides.html new file mode 100644 index 0000000..943d961 --- /dev/null +++ b/talks/GeoJson_Viewer/index.slides.html @@ -0,0 +1,13263 @@ + + + + + + + + + + + +Freva overview + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Press: n or <space>Next slide ♦ +pPrevious Slide?Help Menu

+ + + + + +