Skip to content

Commit 3a89bc5

Browse files
committed
ruff+black links.py
1 parent 8249f8c commit 3a89bc5

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

spglm/links.py

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
FLOAT_EPS = np.finfo(float).eps
99

1010

11-
class Link(object):
11+
class Link:
1212
"""
1313
A generic link function for one-parameter exponential family.
1414
1515
`Link` does nothing, but lays out the methods expected of any subclass.
1616
"""
1717

18-
def __call__(self, p):
18+
def __call__(self, p): # noqa ARG002
1919
"""
2020
Return the value of the link function. This is just a placeholder.
2121
@@ -31,7 +31,7 @@ def __call__(self, p):
3131
"""
3232
return NotImplementedError
3333

34-
def inverse(self, z):
34+
def inverse(self, z): # noqa ARG002
3535
"""
3636
Inverse of the link function. Just a placeholder.
3737
@@ -50,7 +50,7 @@ def inverse(self, z):
5050
"""
5151
return NotImplementedError
5252

53-
def deriv(self, p):
53+
def deriv(self, p): # noqa ARG002
5454
"""
5555
Derivative of the link function g'(p). Just a placeholder.
5656
@@ -230,7 +230,7 @@ def deriv2(self, p):
230230
return (2 * p - 1) / v**2
231231

232232

233-
class logit(Logit):
233+
class logit(Logit): # noqa N801
234234
pass
235235

236236

@@ -357,7 +357,7 @@ def inverse_deriv(self, z):
357357
return np.power(z, (1 - self.power) / self.power) / self.power
358358

359359

360-
class inverse_power(Power):
360+
class inverse_power(Power): # noqa N801
361361
"""
362362
The inverse transform
363363
@@ -369,10 +369,10 @@ class inverse_power(Power):
369369
"""
370370

371371
def __init__(self):
372-
super(inverse_power, self).__init__(power=-1.0)
372+
super().__init__(power=-1.0)
373373

374374

375-
class sqrt(Power):
375+
class sqrt(Power): # noqa N801
376376
"""
377377
The square-root transform
378378
@@ -384,11 +384,11 @@ class sqrt(Power):
384384
"""
385385

386386
def __init__(self):
387-
super(sqrt, self).__init__(power=0.5)
387+
super().__init__(power=0.5)
388388

389389

390-
class inverse_squared(Power):
391-
"""
390+
class inverse_squared(Power): # noqa N801
391+
r"""
392392
The inverse squared transform
393393
394394
Notes
@@ -399,10 +399,10 @@ class inverse_squared(Power):
399399
"""
400400

401401
def __init__(self):
402-
super(inverse_squared, self).__init__(power=-2.0)
402+
super().__init__(power=-2.0)
403403

404404

405-
class identity(Power):
405+
class identity(Power): # noqa N801
406406
"""
407407
The identity transform
408408
@@ -414,7 +414,7 @@ class identity(Power):
414414
"""
415415

416416
def __init__(self):
417-
super(identity, self).__init__(power=1.0)
417+
super().__init__(power=1.0)
418418

419419

420420
class Log(Link):
@@ -430,7 +430,7 @@ class Log(Link):
430430
def _clean(self, x):
431431
return np.clip(x, FLOAT_EPS, np.inf)
432432

433-
def __call__(self, p, **extra):
433+
def __call__(self, p):
434434
"""
435435
Log transform link function
436436
@@ -531,7 +531,7 @@ def inverse_deriv(self, z):
531531
return np.exp(z)
532532

533533

534-
class log(Log):
534+
class log(Log): # noqa N801
535535
"""
536536
The log transform
537537
@@ -655,7 +655,7 @@ def inverse_deriv(self, z):
655655
return 1 / self.deriv(self.inverse(z))
656656

657657

658-
class probit(CDFLink):
658+
class probit(CDFLink): # noqa N801
659659
"""
660660
The probit (standard normal CDF) transform
661661
@@ -669,7 +669,7 @@ class probit(CDFLink):
669669
pass
670670

671671

672-
class cauchy(CDFLink):
672+
class cauchy(CDFLink): # noqa N801
673673
"""
674674
The Cauchy (standard Cauchy CDF) transform
675675
@@ -681,7 +681,7 @@ class cauchy(CDFLink):
681681
"""
682682

683683
def __init__(self):
684-
super(cauchy, self).__init__(dbn=scipy.stats.cauchy)
684+
super().__init__(dbn=scipy.stats.cauchy)
685685

686686
def deriv2(self, p):
687687
"""
@@ -814,7 +814,7 @@ def inverse_deriv(self, z):
814814
return np.exp(z - np.exp(z))
815815

816816

817-
class cloglog(CLogLog):
817+
class cloglog(CLogLog): # noqa N801
818818
"""
819819
The CLogLog transform link function.
820820
@@ -829,7 +829,7 @@ class cloglog(CLogLog):
829829
pass
830830

831831

832-
class NegativeBinomial(object):
832+
class NegativeBinomial:
833833
"""
834834
The negative binomial link function
835835
@@ -950,7 +950,7 @@ def inverse_deriv(self, z):
950950
return t / (self.alpha * (1 - t) ** 2)
951951

952952

953-
class nbinom(NegativeBinomial):
953+
class nbinom(NegativeBinomial): # noqa N801
954954
"""
955955
The negative binomial link function.
956956

0 commit comments

Comments
 (0)