Skip to content
Merged
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
9 changes: 9 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,12 @@ repos:
- --no-hashes
- --no-emit-project
- --output-file=.binder/requirements.txt
- repo: https://github.com/kynan/nbstripout
rev: 0.9.1
hooks:
# Outputs are committed so notebooks render on GitHub, so only strip execution metadata.
- id: nbstripout
args:
- --keep-output
- --keep-count
- --keep-id
69 changes: 42 additions & 27 deletions notebooks/01-ref-concepts.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 1,
"id": "05ac27ad",
"metadata": {},
"outputs": [
Expand All @@ -60,7 +60,7 @@
"Client(raise_on_unexpected_status=False, _base_url='https://api.climate-ref.org', _cookies={}, _headers={}, _timeout=None, _verify_ssl=True, _follow_redirects=False, _httpx_args={}, _client=None, _async_client=None)"
]
},
"execution_count": 7,
"execution_count": 1,
"metadata": {},
"output_type": "execute_result"
}
Expand Down Expand Up @@ -98,7 +98,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 2,
"id": "8196f36e",
"metadata": {},
"outputs": [
Expand Down Expand Up @@ -141,7 +141,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 3,
"id": "3389ca04",
"metadata": {},
"outputs": [
Expand Down Expand Up @@ -185,7 +185,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 4,
"id": "45bfc188",
"metadata": {},
"outputs": [
Expand Down Expand Up @@ -228,7 +228,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 5,
"id": "fda2000d",
"metadata": {},
"outputs": [
Expand Down Expand Up @@ -262,43 +262,58 @@
"metadata": {},
"source": [
"Within each execution group, there may be multiple executions.\n",
"We pick the most recent successful one.\n",
"For this execution we can access the outputs that were generated as well as a URL for downloading them."
]
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 6,
"id": "c0e32afa",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
" executions/recipe_20260305_234552/plots/gwl_mean_plots_pr/plot_gwl_stats/CMIP6_mm_mean_1.5.png https://api.climate-ref.org/api/v1/results/267670\n",
" executions/recipe_20260305_234552/plots/gwl_mean_plots_pr/plot_gwl_stats/CMIP6_mm_mean_2.0.png https://api.climate-ref.org/api/v1/results/267671\n",
" executions/recipe_20260305_234552/plots/gwl_mean_plots_pr/plot_gwl_stats/CMIP6_mm_stdev_1.5.png https://api.climate-ref.org/api/v1/results/267672\n",
" executions/recipe_20260305_234552/plots/gwl_mean_plots_pr/plot_gwl_stats/CMIP6_mm_stdev_2.0.png https://api.climate-ref.org/api/v1/results/267673\n",
" executions/recipe_20260305_234552/plots/gwl_mean_plots_tas/plot_gwl_stats/CMIP6_mm_mean_1.5.png https://api.climate-ref.org/api/v1/results/267674\n",
" executions/recipe_20260305_234552/plots/gwl_mean_plots_tas/plot_gwl_stats/CMIP6_mm_mean_2.0.png https://api.climate-ref.org/api/v1/results/267675\n",
" executions/recipe_20260305_234552/plots/gwl_mean_plots_tas/plot_gwl_stats/CMIP6_mm_stdev_1.5.png https://api.climate-ref.org/api/v1/results/267676\n",
" executions/recipe_20260305_234552/plots/gwl_mean_plots_tas/plot_gwl_stats/CMIP6_mm_stdev_2.0.png https://api.climate-ref.org/api/v1/results/267677\n",
" executions/recipe_20260305_234552/work/calculate_gwl_exceedance_years/gwl_exceedance_calculation/GWL_exceedance_years.csv https://api.climate-ref.org/api/v1/results/267678\n",
" executions/recipe_20260305_234552/work/gwl_mean_plots_pr/plot_gwl_stats/CMIP6_mm_mean_1.5.nc https://api.climate-ref.org/api/v1/results/267679\n",
" executions/recipe_20260305_234552/work/gwl_mean_plots_pr/plot_gwl_stats/CMIP6_mm_mean_2.0.nc https://api.climate-ref.org/api/v1/results/267680\n",
" executions/recipe_20260305_234552/work/gwl_mean_plots_pr/plot_gwl_stats/CMIP6_mm_stdev_1.5.nc https://api.climate-ref.org/api/v1/results/267681\n",
" executions/recipe_20260305_234552/work/gwl_mean_plots_pr/plot_gwl_stats/CMIP6_mm_stdev_2.0.nc https://api.climate-ref.org/api/v1/results/267682\n",
" executions/recipe_20260305_234552/work/gwl_mean_plots_tas/plot_gwl_stats/CMIP6_mm_mean_1.5.nc https://api.climate-ref.org/api/v1/results/267683\n",
" executions/recipe_20260305_234552/work/gwl_mean_plots_tas/plot_gwl_stats/CMIP6_mm_mean_2.0.nc https://api.climate-ref.org/api/v1/results/267684\n",
" executions/recipe_20260305_234552/work/gwl_mean_plots_tas/plot_gwl_stats/CMIP6_mm_stdev_1.5.nc https://api.climate-ref.org/api/v1/results/267685\n",
" executions/recipe_20260305_234552/work/gwl_mean_plots_tas/plot_gwl_stats/CMIP6_mm_stdev_2.0.nc https://api.climate-ref.org/api/v1/results/267686\n",
" executions/recipe_20260305_234552/index.html https://api.climate-ref.org/api/v1/results/267687\n"
" executions/recipe_20261026_015959/plots/gwl_mean_plots_pr/plot_gwl_stats/CMIP6_mm_mean_1.5.png https://api.climate-ref.org/api/v1/results/2284307\n",
" executions/recipe_20261026_015959/plots/gwl_mean_plots_pr/plot_gwl_stats/CMIP6_mm_mean_2.0.png https://api.climate-ref.org/api/v1/results/2284308\n",
" executions/recipe_20261026_015959/plots/gwl_mean_plots_pr/plot_gwl_stats/CMIP6_mm_mean_3.0.png https://api.climate-ref.org/api/v1/results/2284309\n",
" executions/recipe_20261026_015959/plots/gwl_mean_plots_pr/plot_gwl_stats/CMIP6_mm_stdev_1.5.png https://api.climate-ref.org/api/v1/results/2284310\n",
" executions/recipe_20261026_015959/plots/gwl_mean_plots_pr/plot_gwl_stats/CMIP6_mm_stdev_2.0.png https://api.climate-ref.org/api/v1/results/2284311\n",
" executions/recipe_20261026_015959/plots/gwl_mean_plots_pr/plot_gwl_stats/CMIP6_mm_stdev_3.0.png https://api.climate-ref.org/api/v1/results/2284312\n",
" executions/recipe_20261026_015959/plots/gwl_mean_plots_tas/plot_gwl_stats/CMIP6_mm_mean_1.5.png https://api.climate-ref.org/api/v1/results/2284313\n",
" executions/recipe_20261026_015959/plots/gwl_mean_plots_tas/plot_gwl_stats/CMIP6_mm_mean_2.0.png https://api.climate-ref.org/api/v1/results/2284314\n",
" executions/recipe_20261026_015959/plots/gwl_mean_plots_tas/plot_gwl_stats/CMIP6_mm_mean_3.0.png https://api.climate-ref.org/api/v1/results/2284315\n",
" executions/recipe_20261026_015959/plots/gwl_mean_plots_tas/plot_gwl_stats/CMIP6_mm_stdev_1.5.png https://api.climate-ref.org/api/v1/results/2284316\n",
" executions/recipe_20261026_015959/plots/gwl_mean_plots_tas/plot_gwl_stats/CMIP6_mm_stdev_2.0.png https://api.climate-ref.org/api/v1/results/2284317\n",
" executions/recipe_20261026_015959/plots/gwl_mean_plots_tas/plot_gwl_stats/CMIP6_mm_stdev_3.0.png https://api.climate-ref.org/api/v1/results/2284318\n",
" executions/recipe_20261026_015959/work/calculate_gwl_exceedance_years/gwl_exceedance_calculation/GWL_exceedance_years.csv https://api.climate-ref.org/api/v1/results/2284319\n",
" executions/recipe_20261026_015959/work/gwl_mean_plots_pr/plot_gwl_stats/CMIP6_mm_mean_1.5.nc https://api.climate-ref.org/api/v1/results/2284320\n",
" executions/recipe_20261026_015959/work/gwl_mean_plots_pr/plot_gwl_stats/CMIP6_mm_mean_2.0.nc https://api.climate-ref.org/api/v1/results/2284321\n",
" executions/recipe_20261026_015959/work/gwl_mean_plots_pr/plot_gwl_stats/CMIP6_mm_mean_3.0.nc https://api.climate-ref.org/api/v1/results/2284322\n",
" executions/recipe_20261026_015959/work/gwl_mean_plots_pr/plot_gwl_stats/CMIP6_mm_stdev_1.5.nc https://api.climate-ref.org/api/v1/results/2284323\n",
" executions/recipe_20261026_015959/work/gwl_mean_plots_pr/plot_gwl_stats/CMIP6_mm_stdev_2.0.nc https://api.climate-ref.org/api/v1/results/2284324\n",
" executions/recipe_20261026_015959/work/gwl_mean_plots_pr/plot_gwl_stats/CMIP6_mm_stdev_3.0.nc https://api.climate-ref.org/api/v1/results/2284325\n",
" executions/recipe_20261026_015959/work/gwl_mean_plots_tas/plot_gwl_stats/CMIP6_mm_mean_1.5.nc https://api.climate-ref.org/api/v1/results/2284326\n",
" executions/recipe_20261026_015959/work/gwl_mean_plots_tas/plot_gwl_stats/CMIP6_mm_mean_2.0.nc https://api.climate-ref.org/api/v1/results/2284327\n",
" executions/recipe_20261026_015959/work/gwl_mean_plots_tas/plot_gwl_stats/CMIP6_mm_mean_3.0.nc https://api.climate-ref.org/api/v1/results/2284328\n",
" executions/recipe_20261026_015959/work/gwl_mean_plots_tas/plot_gwl_stats/CMIP6_mm_stdev_1.5.nc https://api.climate-ref.org/api/v1/results/2284329\n",
" executions/recipe_20261026_015959/work/gwl_mean_plots_tas/plot_gwl_stats/CMIP6_mm_stdev_2.0.nc https://api.climate-ref.org/api/v1/results/2284330\n",
" executions/recipe_20261026_015959/work/gwl_mean_plots_tas/plot_gwl_stats/CMIP6_mm_stdev_3.0.nc https://api.climate-ref.org/api/v1/results/2284331\n",
" executions/recipe_20261026_015959/index.html https://api.climate-ref.org/api/v1/results/2284332\n"
]
}
],
"source": [
"for o in first_execution_group.latest_execution.outputs:\n",
" print(f\" {o.filename:20s} {o.url}\")"
"from ref_tutorials import latest_successful_execution\n",
"\n",
"execution = latest_successful_execution(first_execution_group)\n",
"if execution is None:\n",
" print(\"This execution group has no successful execution yet, so there are no outputs to show.\")\n",
"else:\n",
" for o in execution.outputs:\n",
" print(f\" {o.filename:20s} {o.url}\")"
]
},
{
Expand Down
Loading
Loading