Skip to content

Commit

Permalink
Allow the timestep to be set from the model specification, but keep t…
Browse files Browse the repository at this point in the history
…he default at 328 sec
  • Loading branch information
jzuhone committed Nov 29, 2017
1 parent b06fd65 commit fe5b160
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions xija/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ class XijaModel(object):
:param name: model name
:param start: model start time (any DateTime format)
:param stop: model stop time (any DateTime format)
:param dt: delta time step (default=328 sec, do not change)
:param dt: delta time step (default=328 sec)
:param model_spec: model specification (None | filename | dict)
:param cmd_states: commanded states input (None | structured array)
"""
def __init__(self, name=None, start=None, stop=None, dt=328.0,
def __init__(self, name=None, start=None, stop=None, dt=None,
model_spec=None, cmd_states=None):

# If model_spec supplied as a string then read model spec as a dict
Expand All @@ -88,13 +88,16 @@ def __init__(self, name=None, start=None, stop=None, dt=328.0,
stop = stop or model_spec['datestop']
start = start or model_spec['datestart']
name = name or model_spec['name']
dt = dt or model_spec['dt']

if stop is None:
stop = DateTime() - 30
if start is None:
start = DateTime(stop) - 45
if name is None:
name = 'xijamodel'
if dt is None:
dt = 328.0

self.name = name
self.comp = OrderedDict()
Expand Down

0 comments on commit fe5b160

Please sign in to comment.