Source code for vortex_cen.data.packedfiles
# -*- coding: utf-8 -*-
"""
packedfiles.py
--------------
Packed resources (tar files) including several small files.
.. inheritance-diagram:: vortex_cen.data.packedfiles
:top-classes: vortex.data.flow.GeoFlowResource
:private-bases:
:parts: 4
.. autoclass:: CenPackedFiles
:show-inheritance:
.. autoclass:: SurfexPackedFiles
:show-inheritance:
"""
from vortex_cen.syntax.stdattrs import cendateperiod_deco
from vortex.data.flow import GeoFlowResource
from vortex.syntax.stddeco import namebuilding_delete
[docs]
class CenPackedFiles(GeoFlowResource):
"""
Abstract class for CEN archives to reduce the number of small files.
"""
_abstract = True,
_footprint = [
cendateperiod_deco,
dict(
info = 'Any packed file covering a given period',
attr = dict(
nativefmt = dict(
values = ['tar', 'tar.gz'],
default = 'tar'
),
datebegin = dict(
info = "First date of the archive",
),
dateend =dict(
info = "Last date of the archive",
),
date = dict(
optional = True,
),
cutoff = dict(
optional = True,
),
model = dict(
optional = True,
),
),
)
]
@property
def realkind(self):
return self.kind
[docs]
@namebuilding_delete('src')
@namebuilding_delete('geo')
class SurfexPackedFiles(CenPackedFiles):
"""
Class for Surfex packed files.
"""
# TODO : Is this really used ?
_footprint = [
dict(
info='Surfex packed files covering a given period',
attr=dict(
kind=dict(
values = ['FORCING', 'PREP', 'PRO'],
),
model = dict(
values = ['surfex', 's2m'],
optional = True,
),
)
)
]