Skip to content

Commit

Permalink
fix typing errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jorenham committed Aug 24, 2024
1 parent 87a9258 commit e12ba18
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 45 deletions.
2 changes: 1 addition & 1 deletion lmo/_poly.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@


if TYPE_CHECKING:
from .typing import np as lnpt
import lmo.typing.np as lnpt


__all__ = (
Expand Down
28 changes: 11 additions & 17 deletions lmo/contrib/scipy_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,8 @@
import lmo.typing as lmt
import lmo.typing.np as lnpt
import lmo.typing.scipy as lspt
from lmo import (
inference,
l_moment as l_moment_est,
)
from lmo import inference
from lmo._lm import l_moment as l_moment_est
from lmo._utils import (
clean_order,
clean_orders,
Expand Down Expand Up @@ -1089,33 +1087,29 @@ def l_fit(
self,
data: lnpt.AnyVectorInt | lnpt.AnyVectorFloat,
*args: float,
n_extra: int = 0,
trim: lmt.AnyTrim = 0,
n_extra: int = ...,
trim: lmt.AnyTrimInt = ...,
full_output: Literal[True],
fit_kwargs: Mapping[str, Any] | None = None,
fit_kwargs: Mapping[str, Any] | None = ...,
**kwds: Any,
) -> tuple[float, ...]:
...

) -> tuple[float, ...]: ...
@overload
def l_fit(
self,
data: lnpt.AnyVectorInt | lnpt.AnyVectorFloat,
*args: float,
n_extra: int = 0,
trim: lmt.AnyTrim = 0,
n_extra: int = ...,
trim: lmt.AnyTrimInt = ...,
full_output: bool = ...,
fit_kwargs: Mapping[str, Any] | None = None,
fit_kwargs: Mapping[str, Any] | None = ...,
**kwds: Any,
) -> tuple[float, ...]:
...

) -> tuple[float, ...]: ...
def l_fit(
self,
data: lnpt.AnyVectorInt | lnpt.AnyVectorFloat,
*args: float,
n_extra: int = 0,
trim: lmt.AnyTrim = 0,
trim: lmt.AnyTrimInt = 0,
full_output: bool = False,
fit_kwargs: Mapping[str, Any] | None = None,
random_state: int | np.random.Generator | None = None,
Expand Down
2 changes: 1 addition & 1 deletion lmo/ostats.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
if TYPE_CHECKING:
import optype.numpy as onpt

from .typing import np as lnpt
import lmo.typing.np as lnpt


__all__ = 'weights', 'from_cdf'
Expand Down
7 changes: 2 additions & 5 deletions lmo/pwm_beta.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,10 @@
if TYPE_CHECKING:
import optype.numpy as onpt

from .typing import np as lnpt
import lmo.typing.np as lnpt


__all__ = (
'weights',
'cov',
)
__all__ = 'weights', 'cov'


_F = TypeVar('_F', bound=np.floating[Any], default=np.float64)
Expand Down
31 changes: 10 additions & 21 deletions lmo/special.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,12 @@
import optype.numpy as onpt
import scipy.special as sc

import lmo.typing as lmt
import lmo.typing.np as lnpt
from ._utils import clean_orders
from .typing import (
AnyOrder,
AnyOrderND,
np as lnpt,
)


__all__ = (
'fpow',
'gamma2',
'harmonic',
'norm_sh_jacobi',
'fourier_jacobi',
)
__all__ = 'fpow', 'gamma2', 'harmonic', 'norm_sh_jacobi', 'fourier_jacobi'


_DTYPE_CHARS: Final[str] = '?bBhHiIlLqQpP'
Expand Down Expand Up @@ -66,8 +57,6 @@ def fpow(
/,
out: onpt.Array[_T_shape, _T_float],
) -> onpt.Array[_T_shape, _T_float]: ...


def fpow(
x: lnpt.AnyScalarFloat | lnpt.AnyArrayFloat,
n: lnpt.AnyScalarFloat | lnpt.AnyArrayFloat,
Expand Down Expand Up @@ -126,8 +115,6 @@ def gamma2(
/,
out: onpt.Array[_T_shape, _T_float],
) -> onpt.Array[_T_shape, _T_float]: ...


def gamma2(
a: lnpt.AnyScalarFloat,
x: lnpt.AnyScalarFloat | lnpt.AnyArrayFloat,
Expand Down Expand Up @@ -224,17 +211,19 @@ def harmonic(


@overload
def norm_sh_jacobi(n: AnyOrder, alpha: float, beta: float) -> np.float64: ...
def norm_sh_jacobi(
n: lmt.AnyOrder,
alpha: float,
beta: float,
) -> np.float64: ...
@overload
def norm_sh_jacobi(
n: AnyOrderND,
n: lmt.AnyOrderND,
alpha: float,
beta: float,
) -> onpt.Array[onpt.AtLeast1D, np.float64]: ...


def norm_sh_jacobi(
n: AnyOrder | AnyOrderND,
n: lmt.AnyOrder | lmt.AnyOrderND,
alpha: float,
beta: float,
) -> np.float64 | onpt.Array[onpt.AtLeast1D, np.float64]:
Expand Down

0 comments on commit e12ba18

Please sign in to comment.