Skip to content

Commit

Permalink
Merge branch 'master' into misc
Browse files Browse the repository at this point in the history
  • Loading branch information
skirpichev committed Jun 7, 2022
2 parents b648654 + 868bdbb commit fdfec8c
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 17 deletions.
2 changes: 1 addition & 1 deletion diofant/polys/polyutils.py
Expand Up @@ -106,7 +106,7 @@ def _unify_gens(f_gens, g_gens):

for i, gen in enumerate(g_gens):
if gen in common:
g_gens[i], k = common[k], k + 1 # pylint: disable=unnecessary-list-index-lookup
g_gens[i], k = common[k], k + 1

for gen in common:
i = f_gens.index(gen)
Expand Down
2 changes: 1 addition & 1 deletion diofant/solvers/polysys.py
Expand Up @@ -230,7 +230,7 @@ def tr_surd(e):

denoms = []
for i, e in enumerate(eqs):
eqs[i], d = e.as_numer_denom() # pylint: disable=unnecessary-list-index-lookup
eqs[i], d = e.as_numer_denom()
if not d.is_constant(*gens):
denoms.insert(0, d)

Expand Down
3 changes: 1 addition & 2 deletions diofant/stats/crv.py
Expand Up @@ -162,8 +162,7 @@ class SingleContinuousDistribution(ContinuousDistribution, NamedArgsMixin):

def __new__(cls, *args):
args = list(map(sympify, args))
ret = Expr.__new__(cls, *args)
return ret
return Expr.__new__(cls, *args)

@staticmethod
def check(*args):
Expand Down
3 changes: 1 addition & 2 deletions diofant/stats/crv_types.py
Expand Up @@ -977,8 +977,7 @@ class FrechetDistribution(SingleContinuousDistribution):

def __new__(cls, a, s=1, m=0):
a, s, m = list(map(sympify, (a, s, m)))
ret = Expr.__new__(cls, a, s, m)
return ret
return Expr.__new__(cls, a, s, m)

def pdf(self, x):
a, s, m = self.a, self.s, self.m
Expand Down
3 changes: 1 addition & 2 deletions diofant/stats/drv.py
Expand Up @@ -21,8 +21,7 @@ class SingleDiscreteDistribution(Expr, NamedArgsMixin):

def __new__(cls, *args):
args = list(map(sympify, args))
ret = Expr.__new__(cls, *args)
return ret
return Expr.__new__(cls, *args)

@cacheit
def compute_cdf(self, **kwargs):
Expand Down
3 changes: 1 addition & 2 deletions diofant/stats/frv.py
Expand Up @@ -166,8 +166,7 @@ class SingleFiniteDistribution(Expr, NamedArgsMixin):

def __new__(cls, *args):
args = list(map(sympify, args))
ret = Expr.__new__(cls, *args)
return ret
return Expr.__new__(cls, *args)

@property # type: ignore[misc]
@cacheit
Expand Down
9 changes: 3 additions & 6 deletions diofant/stats/frv_types.py
Expand Up @@ -36,8 +36,7 @@ def dict(self):

def __new__(cls, density):
density = Dict(density)
ret = Expr.__new__(cls, density)
return ret
return Expr.__new__(cls, density)


def FiniteRV(name, density):
Expand Down Expand Up @@ -112,8 +111,7 @@ def __new__(cls, sides):
sides_sym = sympify(sides)
if fuzzy_not(fuzzy_and((sides_sym.is_integer, sides_sym.is_positive))):
raise ValueError("'sides' must be a positive integer.")
ret = super().__new__(cls, sides)
return ret
return super().__new__(cls, sides)

@property # type: ignore[misc]
@cacheit
Expand Down Expand Up @@ -224,8 +222,7 @@ def __new__(cls, *args):
raise ValueError(f"'n' must be positive integer. n = {n!s}.")
if fuzzy_not(fuzzy_and((p_sym.is_nonnegative, (p_sym - 1).is_nonpositive))):
raise ValueError(f"'p' must be: 0 <= p <= 1 . p = {p!s}")
ret = super().__new__(cls, *args)
return ret
return super().__new__(cls, *args)

@property
def n(self):
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Expand Up @@ -46,7 +46,7 @@ tests = ['pytest>=6', 'hypothesis', 'pytest-timeout', 'pexpect']
develop = ['diofant[tests]', 'flake8>=3.8', 'flake8-docstrings>=1.3',
'pep8-naming', 'flake8-comprehensions', 'flake8-isort>=4.1',
'flake8-rst', 'flake8-quotes>=3', 'flake8-sfs', 'pytest-xdist>=1.22',
'pytest-cov', 'pylint>=2.14', 'coverage[toml]>=6.1.2',
'pytest-cov', 'pylint>=2.14.1', 'coverage[toml]>=6.1.2',
'coverage_enable_subprocess', 'types-pkg_resources',
'mypy', 'build', 'flake8-pytest-style']
testing = ['diofant[develop]']
Expand Down

0 comments on commit fdfec8c

Please sign in to comment.