Addresses assortment of bmi implementation concerns; many previously posted under GitHub's Issues. See listing below
Additions
Reintroduces fractional update calls.
def update_frac(self, time_frac):
"""Update model by a fraction of a time step.
Parameters
----------
time_frac : float
Fraction fo a time step.
"""
if self.verbose > 0:
print("Warning: This version of the LSTM is designed to make predictions on one hour timesteps.")
time_step = self.get_time_step()
self._time_step_size = time_frac * self._time_step_size
self.update()
self._time_step_size = time_step
Know this function is called in bmi.update_until() only.
Include a python script, lstm_serialization_test.py, for testing serialization, similar to existing jupyter notebook. Fixes #15
Changes
Use python's built-in getattr() or set_attr() approach vs self._values[var_name]. Fixes #5. For example,
def get_value_ptr(self, var_name):
"""Reference to values.
Parameters
----------
var_name : str
Name of variable as CSDMS Standard Name.
Returns
-------
array_like
Value array.
"""
return getattr(self, var_name) # IN USE
# return self._values[var_name] # NO LONGER IN USE
This effects the following functions
create_scaled_input_tensor()
bmi.get_value_ptr()
bmi.initialize()
scale_output()
set_static_attributes()
set_value()
Directory structure:
jupyter notebooks in /notebooks
python scripts in /src
all links and refs adjusted for pathing change
Updates to readme & markdown docs
Bound runoff to zero; fixes #17 self.surface_runoff_mm = max(self.surface_runoff_mm,0.0)
Addresses assortment of bmi implementation concerns; many previously posted under GitHub's Issues. See listing below
Additions
Reintroduces fractional update calls.
Know this function is called in
bmi.update_until()
only.Include a python script,
lstm_serialization_test.py
, for testing serialization, similar to existing jupyter notebook. Fixes #15Changes
Use python's built-in
getattr()
orset_attr()
approach vsself._values[var_name]
. Fixes #5. For example,This effects the following functions
create_scaled_input_tensor()
bmi.get_value_ptr()
bmi.initialize()
scale_output()
set_static_attributes()
set_value()
Directory structure:
/notebooks
/src
Updates to readme & markdown docs
Bound runoff to zero; fixes #17
self.surface_runoff_mm = max(self.surface_runoff_mm,0.0)
Remove any
-
and replace with_
in py scriptsTesting
/notebooks
and/src