Skip to content

Commit

Permalink
Remove the _clean() function as now predictN won't modify the model o…
Browse files Browse the repository at this point in the history
…bject and _clean() is useless.
  • Loading branch information
wwrechard committed Apr 24, 2018
1 parent 6e5aa6f commit b9aa643
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 23 deletions.
17 changes: 1 addition & 16 deletions pydlm/dlm.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,6 @@ def fitForwardFilter(self, useRollingWindow=False, windowLength=3):
self.turnOn('filtered plot')
self.turnOn('predict plot')

# reset everything that needs reset
self._clean()

if self._printInfo:
print('Forward filtering completed.')

Expand Down Expand Up @@ -250,9 +247,6 @@ def fitBackwardSmoother(self, backLength=None):
self.result.smoothedSteps = [self.n - backLength, self.n - 1]
self.turnOn('smoothed plot')

# reset everything that needs reset
self._clean()

if self._printInfo:
print('Backward smoothing completed.')

Expand Down Expand Up @@ -679,7 +673,7 @@ def exportBuilder():
if length(self.builder.dynamicComponents) > 0:
raise ValueError('Cannot export dlm builder with dynamic components.')

return self.builder
return deepcopy(self.builder)

# ======================= data appending, popping and altering ===============

Expand Down Expand Up @@ -726,9 +720,6 @@ def append(self, data, component='main'):
else:
raise NameError('Such dynamic component does not exist.')

# reset everything that needs reset
self._clean()

# pop the data of a specific date out
def popout(self, date):
""" Pop out the data for a given date
Expand Down Expand Up @@ -768,9 +759,6 @@ def popout(self, date):
elif self.result.smoothedSteps[0] > self.result.smoothedSteps[1]:
self.result.smoothedSteps = [0, -1]

# reset everything that needs reset
self._clean()

# alter the data of a specific days
def alter(self, date, data, component='main'):
""" To alter the data for a specific date and a specific component.
Expand Down Expand Up @@ -822,9 +810,6 @@ def alter(self, date, data, component='main'):
elif self.result.smoothedSteps[0] > self.result.smoothedSteps[1]:
self.result.smoothedSteps = [0, -1]

# reset everything that needs reset
self._clean()

# ignore the data of a given date
def ignore(self, date):
""" Ignore the data for a specific day. treat it as missing data
Expand Down
7 changes: 0 additions & 7 deletions pydlm/func/_dlm.py
Original file line number Diff line number Diff line change
Expand Up @@ -608,13 +608,6 @@ def _printSystemInfo(self, yes):
self._printInfo = False
self.builder._printInfo = False

def _clean(self):
""" Clean up everything that needs to be reset. A common
place to take care of of them.
"""
self.result.predictStatus = None

# function to judge whether a component is in the model
def _checkComponent(self, name):
""" Check whether a component is contained by the dlm.
Expand Down

0 comments on commit b9aa643

Please sign in to comment.