Skip to content

Commit 20b54a1

Browse files
committed
cosmetic change to CGMS14 data providers
1 parent 373448f commit 20b54a1

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

pcse/db/cgms14/data_providers.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -686,6 +686,10 @@ class SiteDataProvider(dict):
686686
column POTENTIAL_WATER_STARTDATE. This value can be accessed as
687687
an attribute `start_date_waterbalance`.
688688
"""
689+
_defaults = {"IFUNRN": 0,
690+
"NOTINF": 0,
691+
"SSMAX": 0.0,
692+
"SSI": 0.0}
689693

690694
def __init__(self, engine, idgrid, idcrop_parametrization, campaign_year, idstu):
691695
# Initialise
@@ -720,10 +724,7 @@ def __init__(self, engine, idgrid, idcrop_parametrization, campaign_year, idstu)
720724
self.start_date_waterbalance = check_date(row.potential_water_startdate)
721725

722726
# Set some missing parameters in CGMS14 to default values
723-
self["IFUNRN"] = 0
724-
self["NOTINF"] = 0
725-
self["SSMAX"] = 0.0
726-
self["SSI"] = 0.0
727+
self.update(self._defaults)
727728

728729
def __str__(self):
729730
result = ("Site parameter values for grid_no=%s, idcrop_parametrization=%s (%s), stu_no=%s, "

0 commit comments

Comments
 (0)