Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mathause committed Sep 18, 2024
1 parent d8e8265 commit 248680d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions mesmer/mesmer_x/train_utils_mesmerx.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def _interpret_distrib(self):
" https://docs.scipy.org/doc/scipy/reference/stats.html"
)

self.is_distrib_discrete = self.distrib in _DISCRETE_DISTRIBUTIONS
self.is_distrib_discrete = dist in _DISCRETE_DISTRIBUTIONS
self.distrib = getattr(sp.stats, dist)

def _find_expr_parameters(self):
Expand Down Expand Up @@ -168,7 +168,7 @@ def _find_parameters_list(self):
if self.distrib.name in _CONTINUOUS_DISTRIBUTIONS:
parameters_list += ["scale"]

self.parameters_values = parameters_list
self.parameters_list = parameters_list

# prepary basic boundaries on parameters: incomplete, did not find a way to
# evaluate automatically the limits on shape parameters
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/test_mesmer_x_expression.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ def test_expression_wrong_math_function():
def test_expression_wrong_numpy_or_math_function():

match = (
"The term 'wrong' appears in the expression 'wrong(c1)' for 'loc', but couldn't"
" find an equivalent in numpy or math."
"The term 'wrong' appears in the expression 'wrong\(c1\)' for 'loc', but"
" couldn't find an equivalent in numpy or math."
)

with pytest.raises(ValueError, match=match):
Expand Down Expand Up @@ -118,7 +118,7 @@ def test_expression_binom():
assert expr.expression_name == "name"

assert expr.distrib == sp.stats.binom
assert not expr.is_distrib_discrete
assert expr.is_distrib_discrete

assert expr.parameters_list == ["n", "p", "loc"]

Expand Down

0 comments on commit 248680d

Please sign in to comment.