-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Labels
Description
If you try to set a Seasonal Parameter directly by its toy-attribute, you receive an error because the shape has been not initialized yet.
hydpy.pub.timegrids = "2018-01-01", "2019-01-01", "1d" model = hydpy.prepare_model("dam_v008") model.parameters.control.neardischargeminimumthreshold.toy_1_1(5)
AttributeError: Seasonal parameter neardischargeminimumthreshold of element ? has neither a normal attribute nor does it handle a "time of year" named toy_1_1.
Workarounds:
Setting the parameter directly or with a dictionary:
model.parameters.control.neardischargeminimumthreshold(**{"toy_1_1": 5})
Define shape:
model.parameters.control.neardischargeminimumthreshold.shape = None
model.parameters.control.neardischargeminimumthreshold.shape
(366,)
model.parameters.control.neardischargeminimumthreshold.toy_1_1(5)