ES-DOC / pyessv

Python Earth Science Standard Vocabularies
Other
8 stars 7 forks source link

Filename parsing #10

Open glevava opened 5 years ago

glevava commented 5 years ago

Using "parsing" feature for filename syntax requires enhancement for optional filename parts. For instance : %(variable)s%(domain)s%(drivingmodel)s%(experiment)s%(ensemble)s%(rcmmodel)s%(rcmversion)s%(timefrequency)s[%(period_start)s-%(period_end)s].nc

"period_start" and "period_end" do not occur in each filename. Fixed variables don't have period info. Another example are the "*-start-end-clim.nc" files which are climatological data.

It could be useful to define pyessv template as "{}_{}_{}_[]-[].nc" where "{}" are mandatory parts and "[]" optional ones. This would also take care of the separators just before.

As in the example, this also requires to support several separator types that can occur in the same template.