Skip to content

Commit

Permalink
Fix bug that mu always had a power3 function.
Browse files Browse the repository at this point in the history
  • Loading branch information
ahaselsteiner committed Jan 9, 2020
1 parent a8dbb3b commit b62b8b3
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions tests/test_fitting.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ def test_fit_lnsquare2(self):
self.assertLess(dist1.scale.b, 10) # Should be about 2-10
self.assertGreater(dist1.scale(0), 0.1)
self.assertLess(dist1.scale(0), 10)
self.assertEqual(dist1.scale.func_name, 'lnsquare2')


def test_multi_processing(selfs):
Expand Down
1 change: 1 addition & 0 deletions tests/test_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def test_FunctionParam_lnsquare2(self):

test_func = FunctionParam(1, 1, None, 'lnsquare2')
self.assertEqual(test_func._value(0), 0)
self.assertEqual(test_func.func_name, 'lnsquare2')


def test_FunctionParam_unknown(self):
Expand Down
2 changes: 1 addition & 1 deletion viroconcom/distributions.py
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ def __init__(self, shape=None, loc=None, scale=None, **kwargs):
# Keep possibly already existing wrapper
scale_wrapper = Wrapper(np.exp, self.mu._wrapper)
# Create new FunctionParam so the passed one does not get altered
scale = FunctionParam(_a, _b, _c, "power3", wrapper=scale_wrapper)
scale = FunctionParam(_a, _b, _c, self.mu.func_name, wrapper=scale_wrapper)
scale._func = _func
else:
scale = ConstantParam(np.exp(self.mu(None)))
Expand Down
2 changes: 1 addition & 1 deletion viroconcom/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '1.2.8'
__version__ = '1.2.9'

0 comments on commit b62b8b3

Please sign in to comment.