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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
19 changes: 17 additions & 2 deletions backend/src/ref_backend/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,13 @@ class Facet(BaseModel):
values: list[str]


# ``kind`` is a CV dimension but is surfaced as a dedicated ``kind`` field on each value and
# excluded from the per-item ``dimensions`` mapping (see climate_ref ScalarValue.dimensions).
# Offering it as a facet would let callers filter on a key that never appears in item dimensions,
# so it is excluded to keep facets a subset of the item dimensions.
NON_FACET_DIMENSIONS = frozenset({"kind"})


@define
class AnnotatedScalarValue:
value: models.ScalarMetricValue
Expand Down Expand Up @@ -623,7 +630,11 @@ def build_scalar_from_reader(
for item in collection.items
]

facets = [Facet(key=f.key, values=list(f.values)) for f in collection.facets]
facets = [
Facet(key=f.key, values=list(f.values))
for f in collection.facets
if f.key not in NON_FACET_DIMENSIONS
]

return MetricValueCollection(
data=all_data,
Expand Down Expand Up @@ -659,7 +670,11 @@ def build_series_from_reader(
)
)

facets = [Facet(key=f.key, values=list(f.values)) for f in collection.facets]
facets = [
Facet(key=f.key, values=list(f.values))
for f in collection.facets
if f.key not in NON_FACET_DIMENSIONS
]

return MetricValueCollection(
data=all_data,
Expand Down
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.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"DIMENSIONS": {
"experiment_id": {
"ssp126": {}
},
"global_warming_level": {
"1.5": {},
"2.0": {}
},
"json_structure": [
"experiment_id",
"global_warming_level",
"metric"
],
"metric": {
"exceedance_year": {}
}
},
"DISCLAIMER": null,
"NOTES": null,
"PROVENANCE": null,
"RESULTS": {
"ssp126": {
"1.5": {
"exceedance_year": 2031
},
"2.0": {
"exceedance_year": 2074
}
}
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
{
"index": "/data/projects/climate-ref/refapp-fixture/tests.integration.test_cmip7_aft/test_solve_cmip7_aft/scratch/esmvaltool/climate-at-global-warming-levels/ssp126_g1_v1_063f4879/1/executions/recipe_20260716_140604/index.html",
"provenance": {
"environment": {},
"modeldata": [],
"obsdata": {},
"log": "/data/projects/climate-ref/refapp-fixture/tests.integration.test_cmip7_aft/test_solve_cmip7_aft/scratch/esmvaltool/climate-at-global-warming-levels/ssp126_g1_v1_063f4879/1/executions/recipe_20260716_140604/run/main_log_debug.txt"
},
"data": {
"executions/recipe_20260716_140604/work/calculate_gwl_exceedance_years/gwl_exceedance_calculation/GWL_exceedance_years.csv": {
"filename": "executions/recipe_20260716_140604/work/calculate_gwl_exceedance_years/gwl_exceedance_calculation/GWL_exceedance_years.csv",
"long_name": "CSV file of Global Warming level Exceedances",
"description": "",
"dimensions": {}
},
"executions/recipe_20260716_140604/work/gwl_mean_plots_pr/plot_gwl_stats/CMIP6_mm_mean_1.5.nc": {
"filename": "executions/recipe_20260716_140604/work/gwl_mean_plots_pr/plot_gwl_stats/CMIP6_mm_mean_1.5.nc",
"long_name": "Multimodel mean of Precipitation at 1.5 $^\\circ$ C",
"description": "",
"dimensions": {
"statistic": "mean",
"variable_id": "pr"
}
},
"executions/recipe_20260716_140604/work/gwl_mean_plots_pr/plot_gwl_stats/CMIP6_mm_mean_2.0.nc": {
"filename": "executions/recipe_20260716_140604/work/gwl_mean_plots_pr/plot_gwl_stats/CMIP6_mm_mean_2.0.nc",
"long_name": "Multimodel mean of Precipitation at 2.0 $^\\circ$ C",
"description": "",
"dimensions": {
"statistic": "mean",
"variable_id": "pr"
}
},
"executions/recipe_20260716_140604/work/gwl_mean_plots_tas/plot_gwl_stats/CMIP6_mm_mean_1.5.nc": {
"filename": "executions/recipe_20260716_140604/work/gwl_mean_plots_tas/plot_gwl_stats/CMIP6_mm_mean_1.5.nc",
"long_name": "Multimodel mean of Temperature at 1.5 $^\\circ$ C",
"description": "",
"dimensions": {
"statistic": "mean",
"variable_id": "tas"
}
},
"executions/recipe_20260716_140604/work/gwl_mean_plots_tas/plot_gwl_stats/CMIP6_mm_mean_2.0.nc": {
"filename": "executions/recipe_20260716_140604/work/gwl_mean_plots_tas/plot_gwl_stats/CMIP6_mm_mean_2.0.nc",
"long_name": "Multimodel mean of Temperature at 2.0 $^\\circ$ C",
"description": "",
"dimensions": {
"statistic": "mean",
"variable_id": "tas"
}
}
},
"plots": {
"executions/recipe_20260716_140604/plots/gwl_mean_plots_pr/plot_gwl_stats/CMIP6_mm_mean_1.5.png": {
"filename": "executions/recipe_20260716_140604/plots/gwl_mean_plots_pr/plot_gwl_stats/CMIP6_mm_mean_1.5.png",
"long_name": "Multimodel mean of Precipitation at 1.5 $^\\circ$ C",
"description": "",
"dimensions": {
"statistic": "mean",
"variable_id": "pr"
}
},
"executions/recipe_20260716_140604/plots/gwl_mean_plots_pr/plot_gwl_stats/CMIP6_mm_mean_2.0.png": {
"filename": "executions/recipe_20260716_140604/plots/gwl_mean_plots_pr/plot_gwl_stats/CMIP6_mm_mean_2.0.png",
"long_name": "Multimodel mean of Precipitation at 2.0 $^\\circ$ C",
"description": "",
"dimensions": {
"statistic": "mean",
"variable_id": "pr"
}
},
"executions/recipe_20260716_140604/plots/gwl_mean_plots_tas/plot_gwl_stats/CMIP6_mm_mean_1.5.png": {
"filename": "executions/recipe_20260716_140604/plots/gwl_mean_plots_tas/plot_gwl_stats/CMIP6_mm_mean_1.5.png",
"long_name": "Multimodel mean of Temperature at 1.5 $^\\circ$ C",
"description": "",
"dimensions": {
"statistic": "mean",
"variable_id": "tas"
}
},
"executions/recipe_20260716_140604/plots/gwl_mean_plots_tas/plot_gwl_stats/CMIP6_mm_mean_2.0.png": {
"filename": "executions/recipe_20260716_140604/plots/gwl_mean_plots_tas/plot_gwl_stats/CMIP6_mm_mean_2.0.png",
"long_name": "Multimodel mean of Temperature at 2.0 $^\\circ$ C",
"description": "",
"dimensions": {
"statistic": "mean",
"variable_id": "tas"
}
}
},
"html": {
"/data/projects/climate-ref/refapp-fixture/tests.integration.test_cmip7_aft/test_solve_cmip7_aft/scratch/esmvaltool/climate-at-global-warming-levels/ssp126_g1_v1_063f4879/1/executions/recipe_20260716_140604/index.html": {
"filename": "/data/projects/climate-ref/refapp-fixture/tests.integration.test_cmip7_aft/test_solve_cmip7_aft/scratch/esmvaltool/climate-at-global-warming-levels/ssp126_g1_v1_063f4879/1/executions/recipe_20260716_140604/index.html",
"long_name": "Results page",
"description": "Page showing the executions of the ESMValTool run.",
"dimensions": null
}
},
"metrics": null,
"diagnostics": {}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

This file was deleted.

Loading
Loading