From 8dc4f4e6939df8a6edfb3e0719b62c0144836aea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89tienne=20Pl=C3=A9siat?= Date: Tue, 23 Jan 2024 16:46:48 +0100 Subject: [PATCH] Retrieve model info with metadata structure from craimodels --- duck/processes/wps_clintai.py | 46 ++--------------------------------- 1 file changed, 2 insertions(+), 44 deletions(-) diff --git a/duck/processes/wps_clintai.py b/duck/processes/wps_clintai.py index 92856a2..98e775b 100644 --- a/duck/processes/wps_clintai.py +++ b/duck/processes/wps_clintai.py @@ -31,50 +31,8 @@ INFO_ROLE = "https://clint.dkrz.de/spec/crai/info" models_list = list(craimodels.info_models().keys()) -info_models = yaml.safe_load(craimodels.raw_text()) - -dummy_models = { - "HadCRUT4": [ - { - "name": "dataset_name", - "value": "HadCRUT4", - "title": "HadCRUT4 Training dataset: 82133 samples of near surface temperature anomalies from the 20th century reanalysis dataset (https://psl.noaa.gov/data/20thC_Rean/) spanning the period 1870-2009. \nMask dataset: masks of missing values extracted from the HadCRUT4 dataset for the period 1850-2014." - - }, - { - "name": "file", - "value": "https://www.metoffice.gov.uk/hadobs/hadcrut4/data/current/gridded_fields/HadCRUT.4.6.0.0.median_netcdf.zip", - "title": "Enter a URL to your HadCRUT4 netcdf file." - }, - { - "name": "variable_name", - "value": "temperature_anomaly", - "title": "temperature_anomaly" - } - ], - "HadCRUT5": [ - { - "name": "dataset_name", - "value": "HadCRUT5", - "title": "HadCRUT5 Training dataset: 82133 samples of near surface temperature anomalies from the 20th century reanalysis dataset (https://psl.noaa.gov/data/20thC_Rean/) spanning the period 1870-2009. \nMask dataset: masks of missing values extracted from the HadCRUT4 dataset for the period 1850-2014." - - }, - { - "name": "file", - "value": "https://www.metoffice.gov.uk/hadobs/hadcrut5/data/current/non-infilled/HadCRUT.5.0.1.0.anomalies.ensemble_mean.nc", - "title": "Enter a URL to your HadCRUT5 netcdf file." - }, - { - "name": "variable_name", - "value": "tas_mean", - "title": "tas_mean" - } - ] -} - -# info_models_string = json.dumps(info_models, separators=(',', ':')) -info_models_string = json.dumps(dummy_models, separators=(',', ':')) - +info_models = yaml.safe_load(craimodels.metadata()) +info_models_string = json.dumps(info_models, separators=(',', ':')) class ClintAI(Process): def __init__(self):