Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion notebooks/01-ref-concepts.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@
"The REF tracks which datasets are available and which diagnostics have already been run.\n",
"\n",
"For the public API we do not handle raw CMIP6 datasets directly the evaluations have already\n",
"been run. We will see locally fetched datasets in notebook 04."
"been run. We will see locally fetched datasets in notebook 04. ~mikapfl: I don't undestand what this means"
]
},
{
Expand Down
19 changes: 9 additions & 10 deletions notebooks/02-querying-the-api.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
"The REF API is documented with an [OpenAPI](https://www.openapis.org) schema.\n",
"You can browse the interactive docs at <https://api.climate-ref.org/docs>.\n",
"\n",
"The `climate_ref_client` package is *generated* from that schema (see `scripts/generate_client.sh`). \n",
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is not the right place to document the technical details of how the client package is built.

"The `ref_tutorials` helper builds a client for us:"
"The `ref_tutorials` helper from `climate_ref_client` package builds a client for us:"
]
},
{
Expand Down Expand Up @@ -871,15 +870,14 @@
"from climate_ref_client.api.diagnostics import diagnostics_list_metric_values\n",
"from climate_ref_client.models.metric_value_type import MetricValueType\n",
"\n",
"diagnostic = next(d for d in diagnostics if d.execution_groups)\n",
"\n",
"values = diagnostics_list_metric_values.sync(\n",
" diagnostic.provider.slug,\n",
" diagnostic.slug,\n",
"result = diagnostics_list_metric_values.sync(\n",
" provider_slug=\"esmvaltool\",\n",
" diagnostic_slug=\"climate-at-global-warming-levels\",\n",
" value_type=MetricValueType.SCALAR,\n",
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is nicer to show a concrete example, a scientist is likely interested in a specific metric, not in the first metric which has results

" client=client,\n",
").data\n",
"print(f\"{diagnostic.name}: {len(values)} scalar metric values\")\n",
")\n",
"values = result.data\n",
"print(f\"Climate at Global Warming Levels: {len(values)} scalar metric values\")\n",
"values[0]"
]
},
Expand All @@ -889,7 +887,8 @@
"metadata": {},
"source": [
"Raw metric values are awkward to work with. The `ref_tutorials` helper flattens them\n",
"into a tidy `pandas.DataFrame` — one column per dimension, plus a `value` column:"
"into a tidy `pandas.DataFrame` — one column per dimension, plus a `value` column:",
"# ~mikapfl: I don't understand *what* is exceeded in the exceedance year - how would I find out?"
]
},
{
Expand Down
6 changes: 4 additions & 2 deletions notebooks/04-local-diagnostic-run.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,8 @@
"from ref_tutorials import fetch_sample_data\n",
"\n",
"sample_data_dir = fetch_sample_data()\n",
"sample_data_dir"
"sample_data_dir\n",
"# ~mikapfl: the logging from fetching the data absolutely kills firefox, Not reasonable, but that's what happens. Can we suppress the logging or so?"
]
},
{
Expand Down Expand Up @@ -1112,7 +1113,8 @@
"import json\n",
"\n",
"output_file = definition.to_output_path(\"output.json\")\n",
"print(json.dumps(json.loads(output_file.read_text()), indent=2)[:2000])"
"print(json.dumps(json.loads(output_file.read_text()), indent=2)[:2000])\n",
"# ~mikapfl: would be nice to show one of the plots."
]
},
{
Expand Down
Loading