Skip to content

Commit 488aa59

Browse files
committed
fix: ruff
1 parent fcffc43 commit 488aa59

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

rework_pysatl_mpest/distributions/cauchy.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,12 @@ def lpdf(self, X):
152152
X = np.asarray(X, dtype=self.dtype)
153153
dtype = self.dtype
154154

155-
return np.log(dtype(1.0)) - np.log(dtype(np.pi)) - np.log(self.scale) - np.log(dtype(1.0) + ((X - self.loc) / self.scale) ** 2)
155+
return (
156+
np.log(dtype(1.0))
157+
- np.log(dtype(np.pi))
158+
- np.log(self.scale)
159+
- np.log(dtype(1.0) + ((X - self.loc) / self.scale) ** 2)
160+
)
156161

157162
def _dlog_loc(self, X):
158163
"""Partial derivative of the lpdf w.r.t. the :attr:`loc` parameter.

rework_tests/unit/distributions/test_beta.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def test_initialization_successful(self, dtype):
7878
"""Tests that the instance is initialized correctly with valid parameters."""
7979

8080
shape1, shape2, left_border, right_border = 0.5, 2.0, -1.0, 1.0
81-
dist = Beta(alpha=shape1, beta=shape2, lower_bound=left_border, upper_bound=right_border, dtype=dtype)
81+
dist = Beta(alpha=shape1, beta=shape2, left_border=left_border, right_border=right_border, dtype=dtype)
8282
assert dist.alpha.dtype == dtype
8383
assert dist.beta.dtype == dtype
8484
assert dist.left_border.dtype == dtype
@@ -145,7 +145,7 @@ def test_invariant_bounds_violation(self, dtype):
145145
def test_repr_method(self, dtype):
146146
"""Tests that the __repr__ method provides a reproducible string."""
147147

148-
dist = Beta(alpha=1.1, beta=2.1, lower_bound=10.1, upper_bound=20.1, dtype=dtype)
148+
dist = Beta(alpha=1.1, beta=2.1, left_border=10.1, right_border=20.1, dtype=dtype)
149149
repr_str = repr(dist)
150150
assert (
151151
repr_str == f"Beta(alpha={dist.alpha}, beta={dist.beta}, left_border={dist.left_border}, "

0 commit comments

Comments
 (0)