Skip to content

Commit

Permalink
containerfix
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfiex committed Nov 17, 2024
1 parent 8af9542 commit 572f389
Show file tree
Hide file tree
Showing 71 changed files with 1,303 additions and 1,903 deletions.
9 changes: 9 additions & 0 deletions container2list.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,21 @@
rewrite = False
nd = {}
for k,v in data.items():

if isinstance(v,list) and len(v) == 1 and isinstance(v[0],dict):
v = v[0]
nd[k] = v

rewrite = True

if isinstance(v,dict):
try:
# if v.values are all empty dicts
if all([i == {} for i in v.values()]):
nd[k] = list(v.keys())
rewrite = True
else:
nd[k] = v

except:
pass
Expand Down
8 changes: 0 additions & 8 deletions data_descriptors/activity/cmip.json
Original file line number Diff line number Diff line change
@@ -1,8 +0,0 @@
{
"@context": "https://WCRP-CMIP.github.io/CMIP6Plus_CVs/activity/_context",
"id": "cmip",
"type": "activity",
"description": "CMIP DECK: 1pctCO2, abrupt4xCO2, amip, esm-piControl, esm-historical, historical, and piControl experiments",
"name": "CMIP",
"url": "https://gmd.copernicus.org/articles/9/1937/2016/gmd-9-1937-2016.pdf"
}
8 changes: 0 additions & 8 deletions data_descriptors/activity/lesfmip.json
Original file line number Diff line number Diff line change
@@ -1,8 +0,0 @@
{
"@context": "https://WCRP-CMIP.github.io/CMIP6Plus_CVs/activity/_context",
"id": "lesfmip",
"type": "activity",
"description": "The Large Ensemble Single Forcing Model Intercomparison Project",
"name": "LESFMIP",
"url": "https://www.frontiersin.org/articles/10.3389/fclim.2022.955414/full"
}
260 changes: 130 additions & 130 deletions data_descriptors/core/descriptors.json
Original file line number Diff line number Diff line change
@@ -1,132 +1,132 @@
{
"@context": "https://WCRP-CMIP.github.io/CMIP6Plus_CVs/core/_context",
"id": "descriptors",
"type": "core",
"drs": {
"drs": {}
},
"index": {
"index": {}
},
"license": [
"^CMIP6Plus model data produced by .* is licensed under a Creative Commons .* License (https://creativecommons\\.org/.*)\\. *Consult https://pcmdi\\.llnl\\.gov/CMIP6Plus/TermsOfUse for terms of use governing CMIP6Plus output, including citation requirements and proper acknowledgment\\. *The data producers and data providers make no warranty, either express or implied, including, but not limited to, warranties of merchantability and fitness for a particular purpose\\. *All liabilities arising from the supply of the information (including any liability arising in negligence) are excluded to the fullest extent permitted by law\\.$"
],
"mip-era": {
"cmip6plus": {}
},
"product": {
"model-output": {}
},
"required-global-attributes": [
"Conventions",
"activity_id",
"creation_date",
"data_specs_version",
"experiment",
"experiment_id",
"forcing_index",
"frequency",
"grid",
"grid_label",
"initialization_index",
"institution",
"institution_id",
"license",
"mip_era",
"nominal_resolution",
"physics_index",
"realization_index",
"realm",
"source",
"source_id",
"source_type",
"sub_experiment",
"sub_experiment_id",
"table_id",
"tracking_id",
"variable_id",
"variant_label"
],
"table_id": [
"ACmon",
"ACmonZ",
"AE1hr",
"AE3hrPt",
"AE3hrPtLev",
"AE6hr",
"AE6hrPt",
"AE6hrPtLev",
"AEday",
"AEmon",
"AEmonLev",
"AEmonZ",
"AEsubhrPt",
"AEsubhrPtSite",
"AP1hr",
"AP1hrPt",
"AP3hr",
"AP3hrPt",
"AP3hrPtLev",
"AP6hr",
"AP6hrPt",
"AP6hrPtLev",
"AP6hrPtZ",
"APday",
"APdayLev",
"APdayZ",
"APfx",
"APmon",
"APmonClim",
"APmonClimLev",
"APmonDiurnal",
"APmonLev",
"APmonZ",
"APsubhrPt",
"APsubhrPtLev",
"APsubhrPtSite",
"GIAfx",
"GIAmon",
"GIAyr",
"GIGfx",
"GIGmon",
"GIGyr",
"LI3hrPt",
"LI6hrPt",
"LIday",
"LIfx",
"LImon",
"LIsubhrPtSite",
"LP3hr",
"LP3hrPt",
"LP6hrPt",
"LPday",
"LPfx",
"LPmon",
"LPyr",
"LPyrPt",
"OBday",
"OBmon",
"OBmonLev",
"OByr",
"OByrLev",
"OP3hrPt",
"OPday",
"OPdec",
"OPdecLev",
"OPdecZ",
"OPfx",
"OPmon",
"OPmonClim",
"OPmonClimLev",
"OPmonLev",
"OPmonZ",
"OPyr",
"OPyrLev",
"SIday",
"SImon",
"SImonPt"
],
"tracking-id": [
"hdl:21.14100/.*"
]
"@context": "https://WCRP-CMIP.github.io/CMIP6Plus_CVs/core/_context",
"id": "descriptors",
"type": "core",
"drs": [
"drs"
],
"index": [
"index"
],
"license": [
"^CMIP6Plus model data produced by .* is licensed under a Creative Commons .* License (https://creativecommons\\.org/.*)\\. *Consult https://pcmdi\\.llnl\\.gov/CMIP6Plus/TermsOfUse for terms of use governing CMIP6Plus output, including citation requirements and proper acknowledgment\\. *The data producers and data providers make no warranty, either express or implied, including, but not limited to, warranties of merchantability and fitness for a particular purpose\\. *All liabilities arising from the supply of the information (including any liability arising in negligence) are excluded to the fullest extent permitted by law\\.$"
],
"mip-era": [
"cmip6plus"
],
"product": [
"model-output"
],
"required-global-attributes": [
"Conventions",
"activity_id",
"creation_date",
"data_specs_version",
"experiment",
"experiment_id",
"forcing_index",
"frequency",
"grid",
"grid_label",
"initialization_index",
"institution",
"institution_id",
"license",
"mip_era",
"nominal_resolution",
"physics_index",
"realization_index",
"realm",
"source",
"source_id",
"source_type",
"sub_experiment",
"sub_experiment_id",
"table_id",
"tracking_id",
"variable_id",
"variant_label"
],
"table_id": [
"ACmon",
"ACmonZ",
"AE1hr",
"AE3hrPt",
"AE3hrPtLev",
"AE6hr",
"AE6hrPt",
"AE6hrPtLev",
"AEday",
"AEmon",
"AEmonLev",
"AEmonZ",
"AEsubhrPt",
"AEsubhrPtSite",
"AP1hr",
"AP1hrPt",
"AP3hr",
"AP3hrPt",
"AP3hrPtLev",
"AP6hr",
"AP6hrPt",
"AP6hrPtLev",
"AP6hrPtZ",
"APday",
"APdayLev",
"APdayZ",
"APfx",
"APmon",
"APmonClim",
"APmonClimLev",
"APmonDiurnal",
"APmonLev",
"APmonZ",
"APsubhrPt",
"APsubhrPtLev",
"APsubhrPtSite",
"GIAfx",
"GIAmon",
"GIAyr",
"GIGfx",
"GIGmon",
"GIGyr",
"LI3hrPt",
"LI6hrPt",
"LIday",
"LIfx",
"LImon",
"LIsubhrPtSite",
"LP3hr",
"LP3hrPt",
"LP6hrPt",
"LPday",
"LPfx",
"LPmon",
"LPyr",
"LPyrPt",
"OBday",
"OBmon",
"OBmonLev",
"OByr",
"OByrLev",
"OP3hrPt",
"OPday",
"OPdec",
"OPdecLev",
"OPdecZ",
"OPfx",
"OPmon",
"OPmonClim",
"OPmonClimLev",
"OPmonLev",
"OPmonZ",
"OPyr",
"OPyrLev",
"SIday",
"SImon",
"SImonPt"
],
"tracking-id": [
"hdl:21.14100/.*"
]
}
11 changes: 0 additions & 11 deletions data_descriptors/core/drs.json
Original file line number Diff line number Diff line change
@@ -1,11 +0,0 @@
{
"@context": "https://WCRP-CMIP.github.io/CMIP6Plus_CVs/core/_context",
"id": "drs",
"type": "core",
"directory-path-example": "CMIP6Plus/CMIP/MOHC/HadGEM3-GC31-MM/historical/r1i1p1f3/Amon/tas/gn/v20191207/",
"directory-path-sub-experiment-example": "CMIP6Plus/DCPP/MOHC/HadGEM3-GC31-MM/dcppA-hindcast/s1960-r1i1p1f2/Amon/tas/gn/v20200417/",
"directory-path-template": "<mip_era>/<activity_id>/<institution_id>/<source_id>/<experiment_id>/<member_id>/<table_id>/<variable_id>/<grid_label>/<version>",
"filename-example": "tas_Amon_HadGEM3-GC31-MM_historical_r1i1p1f3_gn_185001-186912.nc",
"filename-sub-experiment-example": "tas_Amon_HadGEM3-GC31-MM_dcppA-hindcast_s1960-r1i1p1f2_gn_196011-196012.nc",
"filename-template": "<variable_id>_<table_id>_<source_id>_<experiment_id >_<member_id>_<grid_label>[_<time_range>].nc"
}
23 changes: 0 additions & 23 deletions data_descriptors/core/index.json
Original file line number Diff line number Diff line change
@@ -1,23 +0,0 @@
{
"@context": "https://WCRP-CMIP.github.io/CMIP6Plus_CVs/core/_context",
"id": "index",
"type": "core",
"conventions": [
"^CF-1.7 CMIP-6.[0-2,5]\\( UGRID-1.0\\)\\{0,\\}$"
],
"forcing-index": [
"^\\[\\{0,\\}[[:digit:]]\\{1,\\}\\]\\{0,\\}$"
],
"initialization-index": [
"^\\[\\{0,\\}[[:digit:]]\\{1,\\}\\]\\{0,\\}$"
],
"physics-index": [
"^\\[\\{0,\\}[[:digit:]]\\{1,\\}\\]\\{0,\\}$"
],
"realization-index": [
"^\\[\\{0,\\}[[:digit:]]\\{1,\\}\\]\\{0,\\}$"
],
"variant-label": [
"r[[:digit:]]\\{1,\\}i[[:digit:]]\\{1,\\}p[[:digit:]]\\{1,\\}f[[:digit:]]\\{1,\\}$"
]
}
Loading

0 comments on commit 572f389

Please sign in to comment.