Skip to content

Commit

Permalink
bugfix in smoothness
Browse files Browse the repository at this point in the history
  • Loading branch information
jpn-- committed Jun 2, 2017
1 parent 9103602 commit 3ae09e5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion py/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,7 @@ def loads(self, content="@@@", *, use_base64=False, echo=False, d=None):
self = Model()
inf = numpy.inf
nan = numpy.nan
import pickle
_Str = lambda s: (base64.standard_b64decode(s)).decode()
if use_base64:
content = base64.standard_b64decode(content)
Expand All @@ -537,7 +538,6 @@ def loads(self, content="@@@", *, use_base64=False, echo=False, d=None):
content = zlib.decompress(content)
except zlib.error:
pass
import pickle
try:
content = pickle.loads(content)
except pickle.UnpicklingError:
Expand Down
2 changes: 1 addition & 1 deletion py/util/piecewise.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def smoothed_piecewise_linear(basevar, breaks, smoothness=1):
]

if isinstance(smoothness, (int,float)):
smoothness = numpy.full_like( breaks, smoothness )
smoothness = numpy.full_like( breaks, smoothness, dtype=type(smoothness) )
else:
smoothness = numpy.asarray(smoothness)

Expand Down

0 comments on commit 3ae09e5

Please sign in to comment.