Commit fbab4179 authored by TROUSSELLIER Laurent's avatar TROUSSELLIER Laurent
Browse files

Debut gestion erreur

parent 7ed010a8
......@@ -58,22 +58,28 @@ class DRSParser(object):
"""
# Check vocabulary.
facets= None
try:
self.dir_parser.parse(path.parent.as_posix())
# Deserialize p.parent in dict excluding project.
facets = dict(zip(self.dir_keys, path.parent.parts[1:]))
return facets
#return facets
# Vocabulary error handling.
except TemplateParsingError as e:
print(e)
# Key error handling. Due to wrong number of facets in comparison with the path parts.
except KeyError as e:
print(e)
finally:
#print("PB sur :",path)
return facets
def get_facets_from_filename(self, basename):
"""
Deserialize a filename string against a DRS.
......
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Jan 27 15:03:29 2022
@author: ltroussellier
"""
from esm_cat_generator1 import Context,Process
from DRSParser import DRSParser
from pathlib import Path
class ARG(): # pour simuler les arguments
def __init__(self,p,o,t):
self.project =p
self.outcat = o
self.threads =t
#info pour reproduire l'error
project = "CMIP6"
outcat = "OutputCatalog"
threads = 1
#entryBug = "/bdd/CMIP6/PAMIP/CNRM-CERFACS/CNRM-CM6-1/pdSST-pdSIC/.paths.txt"
# entryBug = "/bdd/CMIP6/CMIP/MIROC/MIROC-ES2L/abrupt-4xCO2/.paths.txt"
# # Simulation du traitement (INIT)
# ctx = Context(ARG(project,outcat,threads))
# # Simulation du traitement (GO)
# p=Process(ctx)
# p(entryBug) # pour un fichier complet .paths.txt
#Pour juste une ligne du fichier ...
drs = DRSParser(project)
pathCompletDeLaLigneBug = Path("CMIP6/PAMIP/CNRM-CERFACS/CNRM-CM6-1/pdSST-pdSIC/r116i1p1f2/AppldayPlev/va/gr/v20210409/va_AppldayPlev_CNRM-CM6-1_pdSST-pdSIC_r116i1p1f2_gr_20000401-20010531.nc")
pathCompletDeLaLigneBug="CMIP6/ScenarioMIP/EC-Earth-Consortium/EC-Earth3/ssp119/r102i1p1f1/Amon/pr/gr/v20200412/pr_Amon_EC-Earth3_ssp119_r102i1p1f1_gr_205901-205912.nc"
pathCompletDeLaLigneBug=Path(pathCompletDeLaLigneBug)
fa = drs.get_facets_from_path(pathCompletDeLaLigneBug)
print(fa)
\ No newline at end of file
path,project,activity_id,institution_id,source_id,experiment_id,member_id,table_id,variable_id,grid_label,version,period_start,period_end,latest
/bdd/CMIP6/PMIP/NUIST/NESM3/lig127k/r1i1p1f1/Ofx/areacello/gn/v20190928/areacello_Ofx_NESM3_lig127k_r1i1p1f1_gn.nc,CMIP6,PMIP,NUIST,NESM3,lig127k,r1i1p1f1,Ofx,areacello,gn,v20190928,,,true
/bdd/CMIP6/PMIP/NUIST/NESM3/lig127k/r1i1p1f1/Ofx/areacelli/gn/v20190924/areacelli_Ofx_NESM3_lig127k_r1i1p1f1_gn.nc,CMIP6,PMIP,NUIST,NESM3,lig127k,r1i1p1f1,Ofx,areacelli,gn,v20190924,,,true
/bdd/CMIP6/PMIP/NUIST/NESM3/lig127k/r1i1p1f1/day/tas/gn/v20190909/tas_day_NESM3_lig127k_r1i1p1f1_gn_16700101-16991231.nc,CMIP6,PMIP,NUIST,NESM3,lig127k,r1i1p1f1,day,tas,gn,v20190909,1670-01-01T00:00:00,1699-12-31T00:00:00,true
/bdd/CMIP6/PMIP/NUIST/NESM3/lig127k/r1i1p1f1/day/tas/gn/v20190909/tas_day_NESM3_lig127k_r1i1p1f1_gn_16350101-16691231.nc,CMIP6,PMIP,NUIST,NESM3,lig127k,r1i1p1f1,day,tas,gn,v20190909,1635-01-01T00:00:00,1669-12-31T00:00:00,true
/bdd/CMIP6/PMIP/NUIST/NESM3/lig127k/r1i1p1f1/day/tas/gn/v20190909/tas_day_NESM3_lig127k_r1i1p1f1_gn_16000101-16341231.nc,CMIP6,PMIP,NUIST,NESM3,lig127k,r1i1p1f1,day,tas,gn,v20190909,1600-01-01T00:00:00,1634-12-31T00:00:00,true
/bdd/CMIP6/PMIP/NUIST/NESM3/lig127k/r1i1p1f1/day/sfcWindmax/gn/v20190909/sfcWindmax_day_NESM3_lig127k_r1i1p1f1_gn_16000101-16341231.nc,CMIP6,PMIP,NUIST,NESM3,lig127k,r1i1p1f1,day,sfcWindmax,gn,v20190909,1600-01-01T00:00:00,1634-12-31T00:00:00,true
/bdd/CMIP6/PMIP/NUIST/NESM3/lig127k/r1i1p1f1/day/tasmin/gn/v20190909/tasmin_day_NESM3_lig127k_r1i1p1f1_gn_16000101-16341231.nc,CMIP6,PMIP,NUIST,NESM3,lig127k,r1i1p1f1,day,tasmin,gn,v20190909,1600-01-01T00:00:00,1634-12-31T00:00:00,true
/bdd/CMIP6/PMIP/NUIST/NESM3/lig127k/r1i1p1f1/day/tasmin/gn/v20190909/tasmin_day_NESM3_lig127k_r1i1p1f1_gn_16700101-16991231.nc,CMIP6,PMIP,NUIST,NESM3,lig127k,r1i1p1f1,day,tasmin,gn,v20190909,1670-01-01T00:00:00,1699-12-31T00:00:00,true
/bdd/CMIP6/PMIP/NUIST/NESM3/lig127k/r1i1p1f1/day/tasmin/gn/v20190909/tasmin_day_NESM3_lig127k_r1i1p1f1_gn_16350101-16691231.nc,CMIP6,PMIP,NUIST,NESM3,lig127k,r1i1p1f1,day,tasmin,gn,v20190909,1635-01-01T00:00:00,1669-12-31T00:00:00,true
/bdd/CMIP6/PMIP/NUIST/NESM3/lig127k/r1i1p1f1/day/sfcWindmax/gn/v20190909/sfcWindmax_day_NESM3_lig127k_r1i1p1f1_gn_16350101-16691231.nc,CMIP6,PMIP,NUIST,NESM3,lig127k,r1i1p1f1,day,sfcWindmax,gn,v20190909,1635-01-01T00:00:00,1669-12-31T00:00:00,true
/bdd/CMIP6/PMIP/NUIST/NESM3/lig127k/r1i1p1f1/day/sfcWindmax/gn/v20190909/sfcWindmax_day_NESM3_lig127k_r1i1p1f1_gn_16700101-16991231.nc,CMIP6,PMIP,NUIST,NESM3,lig127k,r1i1p1f1,day,sfcWindmax,gn,v20190909,1670-01-01T00:00:00,1699-12-31T00:00:00,true
/bdd/CMIP6/PMIP/NUIST/NESM3/lig127k/r1i1p1f1/day/tasmax/gn/v20190909/tasmax_day_NESM3_lig127k_r1i1p1f1_gn_16700101-16991231.nc,CMIP6,PMIP,NUIST,NESM3,lig127k,r1i1p1f1,day,tasmax,gn,v20190909,1670-01-01T00:00:00,1699-12-31T00:00:00,true
/bdd/CMIP6/PMIP/NUIST/NESM3/lig127k/r1i1p1f1/day/tasmax/gn/v20190909/tasmax_day_NESM3_lig127k_r1i1p1f1_gn_16350101-16691231.nc,CMIP6,PMIP,NUIST,NESM3,lig127k,r1i1p1f1,day,tasmax,gn,v20190909,1635-01-01T00:00:00,1669-12-31T00:00:00,true
/bdd/CMIP6/PMIP/NUIST/NESM3/lig127k/r1i1p1f1/day/pr/gn/v20190909/pr_day_NESM3_lig127k_r1i1p1f1_gn_16350101-16691231.nc,CMIP6,PMIP,NUIST,NESM3,lig127k,r1i1p1f1,day,pr,gn,v20190909,1635-01-01T00:00:00,1669-12-31T00:00:00,true
/bdd/CMIP6/PMIP/NUIST/NESM3/lig127k/r1i1p1f1/day/pr/gn/v20190909/pr_day_NESM3_lig127k_r1i1p1f1_gn_16000101-16341231.nc,CMIP6,PMIP,NUIST,NESM3,lig127k,r1i1p1f1,day,pr,gn,v20190909,1600-01-01T00:00:00,1634-12-31T00:00:00,true
/bdd/CMIP6/PMIP/NUIST/NESM3/lig127k/r1i1p1f1/day/pr/gn/v20190909/pr_day_NESM3_lig127k_r1i1p1f1_gn_16700101-16991231.nc,CMIP6,PMIP,NUIST,NESM3,lig127k,r1i1p1f1,day,pr,gn,v20190909,1670-01-01T00:00:00,1699-12-31T00:00:00,true
/bdd/CMIP6/PMIP/NUIST/NESM3/lig127k/r1i1p1f1/day/tasmax/gn/v20190909/tasmax_day_NESM3_lig127k_r1i1p1f1_gn_16000101-16341231.nc,CMIP6,PMIP,NUIST,NESM3,lig127k,r1i1p1f1,day,tasmax,gn,v20190909,1600-01-01T00:00:00,1634-12-31T00:00:00,true
/bdd/CMIP6/PMIP/NUIST/NESM3/lig127k/r1i1p1f1/Omon/tauuo/gn/v20190927/tauuo_Omon_NESM3_lig127k_r1i1p1f1_gn_160001-169912.nc,CMIP6,PMIP,NUIST,NESM3,lig127k,r1i1p1f1,Omon,tauuo,gn,v20190927,1600-01-01T00:00:00,1699-12-01T00:00:00,true
/bdd/CMIP6/PMIP/NUIST/NESM3/lig127k/r1i1p1f1/Omon/tos/gn/v20190927/tos_Omon_NESM3_lig127k_r1i1p1f1_gn_160001-169912.nc,CMIP6,PMIP,NUIST,NESM3,lig127k,r1i1p1f1,Omon,tos,gn,v20190927,1600-01-01T00:00:00,1699-12-01T00:00:00,true
/bdd/CMIP6/PMIP/NUIST/NESM3/lig127k/r1i1p1f1/Omon/sos/gn/v20190927/sos_Omon_NESM3_lig127k_r1i1p1f1_gn_160001-169912.nc,CMIP6,PMIP,NUIST,NESM3,lig127k,r1i1p1f1,Omon,sos,gn,v20190927,1600-01-01T00:00:00,1699-12-01T00:00:00,true
/bdd/CMIP6/PMIP/NUIST/NESM3/lig127k/r1i1p1f1/Omon/vo/gn/v20190927/vo_Omon_NESM3_lig127k_r1i1p1f1_gn_162001-163912.nc,CMIP6,PMIP,NUIST,NESM3,lig127k,r1i1p1f1,Omon,vo,gn,v20190927,1620-01-01T00:00:00,1639-12-01T00:00:00,true
/bdd/CMIP6/PMIP/NUIST/NESM3/lig127k/r1i1p1f1/Omon/vo/gn/v20190927/vo_Omon_NESM3_lig127k_r1i1p1f1_gn_168001-169912.nc,CMIP6,PMIP,NUIST,NESM3,lig127k,r1i1p1f1,Omon,vo,gn,v20190927,1680-01-01T00:00:00,1699-12-01T00:00:00,true
/bdd/CMIP6/PMIP/NUIST/NESM3/lig127k/r1i1p1f1/Omon/tauvo/gn/v20190927/tauvo_Omon_NESM3_lig127k_r1i1p1f1_gn_160001-169912.nc,CMIP6,PMIP,NUIST,NESM3,lig127k,r1i1p1f1,Omon,tauvo,gn,v20190927,1600-01-01T00:00:00,1699-12-01T00:00:00,true
/bdd/CMIP6/PMIP/NUIST/NESM3/lig127k/r1i1p1f1/Omon/vo/gn/v20190927/vo_Omon_NESM3_lig127k_r1i1p1f1_gn_160001-161912.nc,CMIP6,PMIP,NUIST,NESM3,lig127k,r1i1p1f1,Omon,vo,gn,v20190927,1600-01-01T00:00:00,1619-12-01T00:00:00,true
/bdd/CMIP6/PMIP/NUIST/NESM3/lig127k/r1i1p1f1/Omon/vo/gn/v20190927/vo_Omon_NESM3_lig127k_r1i1p1f1_gn_164001-165912.nc,CMIP6,PMIP,NUIST,NESM3,lig127k,r1i1p1f1,Omon,vo,gn,v20190927,1640-01-01T00:00:00,1659-12-01T00:00:00,true
/bdd/CMIP6/PMIP/NUIST/NESM3/lig127k/r1i1p1f1/Omon/vo/gn/v20190927/vo_Omon_NESM3_lig127k_r1i1p1f1_gn_166001-167912.nc,CMIP6,PMIP,NUIST,NESM3,lig127k,r1i1p1f1,Omon,vo,gn,v20190927,1660-01-01T00:00:00,1679-12-01T00:00:00,true
/bdd/CMIP6/PMIP/NUIST/NESM3/lig127k/r1i1p1f1/Omon/hfds/gn/v20190927/hfds_Omon_NESM3_lig127k_r1i1p1f1_gn_160001-169912.nc,CMIP6,PMIP,NUIST,NESM3,lig127k,r1i1p1f1,Omon,hfds,gn,v20190927,1600-01-01T00:00:00,1699-12-01T00:00:00,true
/bdd/CMIP6/PMIP/NUIST/NESM3/lig127k/r1i1p1f1/Omon/uo/gn/v20190927/uo_Omon_NESM3_lig127k_r1i1p1f1_gn_162001-163912.nc,CMIP6,PMIP,NUIST,NESM3,lig127k,r1i1p1f1,Omon,uo,gn,v20190927,1620-01-01T00:00:00,1639-12-01T00:00:00,true
/bdd/CMIP6/PMIP/NUIST/NESM3/lig127k/r1i1p1f1/Omon/uo/gn/v20190927/uo_Omon_NESM3_lig127k_r1i1p1f1_gn_166001-167912.nc,CMIP6,PMIP,NUIST,NESM3,lig127k,r1i1p1f1,Omon,uo,gn,v20190927,1660-01-01T00:00:00,1679-12-01T00:00:00,true
/bdd/CMIP6/PMIP/NUIST/NESM3/lig127k/r1i1p1f1/Omon/uo/gn/v20190927/uo_Omon_NESM3_lig127k_r1i1p1f1_gn_164001-165912.nc,CMIP6,PMIP,NUIST,NESM3,lig127k,r1i1p1f1,Omon,uo,gn,v20190927,1640-01-01T00:00:00,1659-12-01T00:00:00,true
/bdd/CMIP6/PMIP/NUIST/NESM3/lig127k/r1i1p1f1/Omon/uo/gn/v20190927/uo_Omon_NESM3_lig127k_r1i1p1f1_gn_168001-169912.nc,CMIP6,PMIP,NUIST,NESM3,lig127k,r1i1p1f1,Omon,uo,gn,v20190927,1680-01-01T00:00:00,1699-12-01T00:00:00,true
/bdd/CMIP6/PMIP/NUIST/NESM3/lig127k/r1i1p1f1/Omon/uo/gn/v20190927/uo_Omon_NESM3_lig127k_r1i1p1f1_gn_160001-161912.nc,CMIP6,PMIP,NUIST,NESM3,lig127k,r1i1p1f1,Omon,uo,gn,v20190927,1600-01-01T00:00:00,1619-12-01T00:00:00,true
/bdd/CMIP6/PMIP/NUIST/NESM3/lig127k/r1i1p1f1/Omon/zos/gn/v20190927/zos_Omon_NESM3_lig127k_r1i1p1f1_gn_160001-169912.nc,CMIP6,PMIP,NUIST,NESM3,lig127k,r1i1p1f1,Omon,zos,gn,v20190927,1600-01-01T00:00:00,1699-12-01T00:00:00,true
/bdd/CMIP6/PMIP/NUIST/NESM3/lig127k/r1i1p1f1/Omon/mlotst/gn/v20190927/mlotst_Omon_NESM3_lig127k_r1i1p1f1_gn_160001-169912.nc,CMIP6,PMIP,NUIST,NESM3,lig127k,r1i1p1f1,Omon,mlotst,gn,v20190927,1600-01-01T00:00:00,1699-12-01T00:00:00,true
/bdd/CMIP6/PMIP/NUIST/NESM3/lig127k/r1i1p1f1/SImon/siconc/gn/v20190911/siconc_SImon_NESM3_lig127k_r1i1p1f1_gn_160001-169912.nc,CMIP6,PMIP,NUIST,NESM3,lig127k,r1i1p1f1,SImon,siconc,gn,v20190911,1600-01-01T00:00:00,1699-12-01T00:00:00,true
/bdd/CMIP6/PMIP/NUIST/NESM3/lig127k/r1i1p1f1/SImon/sithick/gn/v20190911/sithick_SImon_NESM3_lig127k_r1i1p1f1_gn_160001-169912.nc,CMIP6,PMIP,NUIST,NESM3,lig127k,r1i1p1f1,SImon,sithick,gn,v20190911,1600-01-01T00:00:00,1699-12-01T00:00:00,true
/bdd/CMIP6/PMIP/NUIST/NESM3/lig127k/r1i1p1f1/SImon/sitemptop/gn/v20190911/sitemptop_SImon_NESM3_lig127k_r1i1p1f1_gn_160001-169912.nc,CMIP6,PMIP,NUIST,NESM3,lig127k,r1i1p1f1,SImon,sitemptop,gn,v20190911,1600-01-01T00:00:00,1699-12-01T00:00:00,true
/bdd/CMIP6/PMIP/NUIST/NESM3/lig127k/r1i1p1f1/fx/sftlf/gn/v20190915/sftlf_fx_NESM3_lig127k_r1i1p1f1_gn.nc,CMIP6,PMIP,NUIST,NESM3,lig127k,r1i1p1f1,fx,sftlf,gn,v20190915,,,true
/bdd/CMIP6/PMIP/NUIST/NESM3/lig127k/r1i1p1f1/fx/orog/gn/v20190915/orog_fx_NESM3_lig127k_r1i1p1f1_gn.nc,CMIP6,PMIP,NUIST,NESM3,lig127k,r1i1p1f1,fx,orog,gn,v20190915,,,true
/bdd/CMIP6/PMIP/NUIST/NESM3/lig127k/r1i1p1f1/Amon/hfls/gn/v20190909/hfls_Amon_NESM3_lig127k_r1i1p1f1_gn_160001-169912.nc,CMIP6,PMIP,NUIST,NESM3,lig127k,r1i1p1f1,Amon,hfls,gn,v20190909,1600-01-01T00:00:00,1699-12-01T00:00:00,true
/bdd/CMIP6/PMIP/NUIST/NESM3/lig127k/r1i1p1f1/Amon/rlds/gn/v20190909/rlds_Amon_NESM3_lig127k_r1i1p1f1_gn_160001-169912.nc,CMIP6,PMIP,NUIST,NESM3,lig127k,r1i1p1f1,Amon,rlds,gn,v20190909,1600-01-01T00:00:00,1699-12-01T00:00:00,true
/bdd/CMIP6/PMIP/NUIST/NESM3/lig127k/r1i1p1f1/Amon/vas/gn/v20190909/vas_Amon_NESM3_lig127k_r1i1p1f1_gn_160001-169912.nc,CMIP6,PMIP,NUIST,NESM3,lig127k,r1i1p1f1,Amon,vas,gn,v20190909,1600-01-01T00:00:00,1699-12-01T00:00:00,true
/bdd/CMIP6/PMIP/NUIST/NESM3/lig127k/r1i1p1f1/Amon/uas/gn/v20190909/uas_Amon_NESM3_lig127k_r1i1p1f1_gn_160001-169912.nc,CMIP6,PMIP,NUIST,NESM3,lig127k,r1i1p1f1,Amon,uas,gn,v20190909,1600-01-01T00:00:00,1699-12-01T00:00:00,true
/bdd/CMIP6/PMIP/NUIST/NESM3/lig127k/r1i1p1f1/Amon/hus/gn/v20190909/hus_Amon_NESM3_lig127k_r1i1p1f1_gn_160001-169912.nc,CMIP6,PMIP,NUIST,NESM3,lig127k,r1i1p1f1,Amon,hus,gn,v20190909,1600-01-01T00:00:00,1699-12-01T00:00:00,true
/bdd/CMIP6/PMIP/NUIST/NESM3/lig127k/r1i1p1f1/Amon/va/gn/v20190909/va_Amon_NESM3_lig127k_r1i1p1f1_gn_160001-169912.nc,CMIP6,PMIP,NUIST,NESM3,lig127k,r1i1p1f1,Amon,va,gn,v20190909,1600-01-01T00:00:00,1699-12-01T00:00:00,true
/bdd/CMIP6/PMIP/NUIST/NESM3/lig127k/r1i1p1f1/Amon/tauu/gn/v20190909/tauu_Amon_NESM3_lig127k_r1i1p1f1_gn_160001-169912.nc,CMIP6,PMIP,NUIST,NESM3,lig127k,r1i1p1f1,Amon,tauu,gn,v20190909,1600-01-01T00:00:00,1699-12-01T00:00:00,true
/bdd/CMIP6/PMIP/NUIST/NESM3/lig127k/r1i1p1f1/Amon/prsn/gn/v20190909/prsn_Amon_NESM3_lig127k_r1i1p1f1_gn_160001-169912.nc,CMIP6,PMIP,NUIST,NESM3,lig127k,r1i1p1f1,Amon,prsn,gn,v20190909,1600-01-01T00:00:00,1699-12-01T00:00:00,true
/bdd/CMIP6/PMIP/NUIST/NESM3/lig127k/r1i1p1f1/Amon/rlutcs/gn/v20190909/rlutcs_Amon_NESM3_lig127k_r1i1p1f1_gn_160001-169912.nc,CMIP6,PMIP,NUIST,NESM3,lig127k,r1i1p1f1,Amon,rlutcs,gn,v20190909,1600-01-01T00:00:00,1699-12-01T00:00:00,true
/bdd/CMIP6/PMIP/NUIST/NESM3/lig127k/r1i1p1f1/Amon/tas/gn/v20190909/tas_Amon_NESM3_lig127k_r1i1p1f1_gn_160001-169912.nc,CMIP6,PMIP,NUIST,NESM3,lig127k,r1i1p1f1,Amon,tas,gn,v20190909,1600-01-01T00:00:00,1699-12-01T00:00:00,true
/bdd/CMIP6/PMIP/NUIST/NESM3/lig127k/r1i1p1f1/Amon/clt/gn/v20190909/clt_Amon_NESM3_lig127k_r1i1p1f1_gn_160001-169912.nc,CMIP6,PMIP,NUIST,NESM3,lig127k,r1i1p1f1,Amon,clt,gn,v20190909,1600-01-01T00:00:00,1699-12-01T00:00:00,true
/bdd/CMIP6/PMIP/NUIST/NESM3/lig127k/r1i1p1f1/Amon/ua/gn/v20190909/ua_Amon_NESM3_lig127k_r1i1p1f1_gn_160001-169912.nc,CMIP6,PMIP,NUIST,NESM3,lig127k,r1i1p1f1,Amon,ua,gn,v20190909,1600-01-01T00:00:00,1699-12-01T00:00:00,true
/bdd/CMIP6/PMIP/NUIST/NESM3/lig127k/r1i1p1f1/Amon/hfss/gn/v20190909/hfss_Amon_NESM3_lig127k_r1i1p1f1_gn_160001-169912.nc,CMIP6,PMIP,NUIST,NESM3,lig127k,r1i1p1f1,Amon,hfss,gn,v20190909,1600-01-01T00:00:00,1699-12-01T00:00:00,true
/bdd/CMIP6/PMIP/NUIST/NESM3/lig127k/r1i1p1f1/Amon/ps/gn/v20190909/ps_Amon_NESM3_lig127k_r1i1p1f1_gn_160001-169912.nc,CMIP6,PMIP,NUIST,NESM3,lig127k,r1i1p1f1,Amon,ps,gn,v20190909,1600-01-01T00:00:00,1699-12-01T00:00:00,true
/bdd/CMIP6/PMIP/NUIST/NESM3/lig127k/r1i1p1f1/Amon/tauv/gn/v20190909/tauv_Amon_NESM3_lig127k_r1i1p1f1_gn_160001-169912.nc,CMIP6,PMIP,NUIST,NESM3,lig127k,r1i1p1f1,Amon,tauv,gn,v20190909,1600-01-01T00:00:00,1699-12-01T00:00:00,true
/bdd/CMIP6/PMIP/NUIST/NESM3/lig127k/r1i1p1f1/Amon/rsds/gn/v20190909/rsds_Amon_NESM3_lig127k_r1i1p1f1_gn_160001-169912.nc,CMIP6,PMIP,NUIST,NESM3,lig127k,r1i1p1f1,Amon,rsds,gn,v20190909,1600-01-01T00:00:00,1699-12-01T00:00:00,true
/bdd/CMIP6/PMIP/NUIST/NESM3/lig127k/r1i1p1f1/Amon/rlus/gn/v20190909/rlus_Amon_NESM3_lig127k_r1i1p1f1_gn_160001-169912.nc,CMIP6,PMIP,NUIST,NESM3,lig127k,r1i1p1f1,Amon,rlus,gn,v20190909,1600-01-01T00:00:00,1699-12-01T00:00:00,true
/bdd/CMIP6/PMIP/NUIST/NESM3/lig127k/r1i1p1f1/Amon/tasmin/gn/v20190909/tasmin_Amon_NESM3_lig127k_r1i1p1f1_gn_160001-169912.nc,CMIP6,PMIP,NUIST,NESM3,lig127k,r1i1p1f1,Amon,tasmin,gn,v20190909,1600-01-01T00:00:00,1699-12-01T00:00:00,true
/bdd/CMIP6/PMIP/NUIST/NESM3/lig127k/r1i1p1f1/Amon/ta/gn/v20190909/ta_Amon_NESM3_lig127k_r1i1p1f1_gn_160001-169912.nc,CMIP6,PMIP,NUIST,NESM3,lig127k,r1i1p1f1,Amon,ta,gn,v20190909,1600-01-01T00:00:00,1699-12-01T00:00:00,true
/bdd/CMIP6/PMIP/NUIST/NESM3/lig127k/r1i1p1f1/Amon/rlut/gn/v20190909/rlut_Amon_NESM3_lig127k_r1i1p1f1_gn_160001-169912.nc,CMIP6,PMIP,NUIST,NESM3,lig127k,r1i1p1f1,Amon,rlut,gn,v20190909,1600-01-01T00:00:00,1699-12-01T00:00:00,true
/bdd/CMIP6/PMIP/NUIST/NESM3/lig127k/r1i1p1f1/Amon/psl/gn/v20190909/psl_Amon_NESM3_lig127k_r1i1p1f1_gn_160001-169912.nc,CMIP6,PMIP,NUIST,NESM3,lig127k,r1i1p1f1,Amon,psl,gn,v20190909,1600-01-01T00:00:00,1699-12-01T00:00:00,true
/bdd/CMIP6/PMIP/NUIST/NESM3/lig127k/r1i1p1f1/Amon/pr/gn/v20190909/pr_Amon_NESM3_lig127k_r1i1p1f1_gn_160001-169912.nc,CMIP6,PMIP,NUIST,NESM3,lig127k,r1i1p1f1,Amon,pr,gn,v20190909,1600-01-01T00:00:00,1699-12-01T00:00:00,true
/bdd/CMIP6/PMIP/NUIST/NESM3/lig127k/r1i1p1f1/Amon/zg/gn/v20190909/zg_Amon_NESM3_lig127k_r1i1p1f1_gn_160001-169912.nc,CMIP6,PMIP,NUIST,NESM3,lig127k,r1i1p1f1,Amon,zg,gn,v20190909,1600-01-01T00:00:00,1699-12-01T00:00:00,true
/bdd/CMIP6/PMIP/NUIST/NESM3/lig127k/r1i1p1f1/Amon/tasmax/gn/v20190909/tasmax_Amon_NESM3_lig127k_r1i1p1f1_gn_160001-169912.nc,CMIP6,PMIP,NUIST,NESM3,lig127k,r1i1p1f1,Amon,tasmax,gn,v20190909,1600-01-01T00:00:00,1699-12-01T00:00:00,true
/bdd/CMIP6/PMIP/NUIST/NESM3/lig127k/r1i1p1f1/Amon/rsuscs/gn/v20190909/rsuscs_Amon_NESM3_lig127k_r1i1p1f1_gn_160001-169912.nc,CMIP6,PMIP,NUIST,NESM3,lig127k,r1i1p1f1,Amon,rsuscs,gn,v20190909,1600-01-01T00:00:00,1699-12-01T00:00:00,true
/bdd/CMIP6/PMIP/NUIST/NESM3/lig127k/r1i1p1f1/Amon/rsus/gn/v20190909/rsus_Amon_NESM3_lig127k_r1i1p1f1_gn_160001-169912.nc,CMIP6,PMIP,NUIST,NESM3,lig127k,r1i1p1f1,Amon,rsus,gn,v20190909,1600-01-01T00:00:00,1699-12-01T00:00:00,true
/bdd/CMIP6/PMIP/NUIST/NESM3/lig127k/r1i1p1f1/Amon/ts/gn/v20190909/ts_Amon_NESM3_lig127k_r1i1p1f1_gn_160001-169912.nc,CMIP6,PMIP,NUIST,NESM3,lig127k,r1i1p1f1,Amon,ts,gn,v20190909,1600-01-01T00:00:00,1699-12-01T00:00:00,true
/bdd/CMIP6/PMIP/NUIST/NESM3/lig127k/r1i1p1f1/Amon/rsut/gn/v20190909/rsut_Amon_NESM3_lig127k_r1i1p1f1_gn_160001-169912.nc,CMIP6,PMIP,NUIST,NESM3,lig127k,r1i1p1f1,Amon,rsut,gn,v20190909,1600-01-01T00:00:00,1699-12-01T00:00:00,true
/bdd/CMIP6/PMIP/NUIST/NESM3/lig127k/r1i1p1f1/Amon/rsdscs/gn/v20190909/rsdscs_Amon_NESM3_lig127k_r1i1p1f1_gn_160001-169912.nc,CMIP6,PMIP,NUIST,NESM3,lig127k,r1i1p1f1,Amon,rsdscs,gn,v20190909,1600-01-01T00:00:00,1699-12-01T00:00:00,true
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -64,18 +64,22 @@ class Process(object):
# Get facets from path.
facets = drs.get_facets_from_path(path)
#debug ="1"+str(facets)+"\n"
if facets!= None:
# Update facets from filename.
facets.update(drs.get_facets_from_filename(path.stem))
#debug = debug + "2"+str(facets)+"\n"
facets.update(drs.get_facets_from_filename(path.stem))
#debug = debug + "2"+str(facets)+"\n"
# Build CSV entry.
entry_facets = [facets[i] for i in drs.dir_keys]
#debug = debug + "3"+str(entry_facets)+"\n"
csvEntry = [IPSL_DATA_ROOT + path.as_posix(), self.project]
csvEntry.extend(entry_facets)
csvEntry.extend([str(facets['period_start']), str(facets['period_end']), latest])
# Build CSV entry.
entry_facets = [facets[i] for i in drs.dir_keys]
#debug = debug + "3"+str(entry_facets)+"\n"
entry = [IPSL_DATA_ROOT + path.as_posix(), self.project]
entry.extend(entry_facets)
entry.extend([str(facets['period_start']), str(facets['period_end']), latest])
res=res+','.join(entry) + '\n'
res=res+','.join(csvEntry) + '\n'
else:
print("PB : ",oneLine)
#print("RES est remplit Normalement \n",res)
# Build catalog filename.
##### JUSTE POUR DEBUG
......@@ -85,7 +89,7 @@ class Process(object):
##### FIN POUR DEBUG
if entry_facets ==None:
return #il n'y a pas de path à tratier si bien qu'il n'est pas passé dans la boucleau dessus
raise Exception("On a entry_facets = None \n"+debug)
#raise Exception("On a entry_facets = None \n"+debug)
catdepth = entry_facets[:drs.dir_keys.index(INPUT_SOURCES_GRAN[self.project]) + 1]
catpath = os.path.join(self.outcat,
......@@ -103,8 +107,8 @@ class Process(object):
header.extend(drs.dir_keys)
header.extend(['period_start', 'period_end', 'latest'])
# Ensure header and entry have same length.
assert len(header) == len(entry)
# # Ensure header and entry have same length.
# assert len(header) == len(entry)
# Write CSV header.
make_csv(catpath + CSV_EXTENSION, header)
......@@ -117,8 +121,12 @@ class Process(object):
f.write(res)
except Exception as e:
print("Exception pour :",entry,"\n", e)
raise
print("Exception pour :",entry,"\n", e,"\n")
if "csvEntry" in locals():
print(csvEntry,"\n")
# if "res" in locals():
# print(res,"\n")
pass
class Runner(object):
......@@ -268,6 +276,7 @@ class Context(object):
pass
drs = None
#drs = DRSParser("CMIP6")
nbTot=0
def main():
"""
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment