Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some mypy issues #1262

Open
wd60622 opened this issue Dec 11, 2024 · 1 comment
Open

Some mypy issues #1262

wd60622 opened this issue Dec 11, 2024 · 1 comment

Comments

@wd60622
Copy link
Contributor

wd60622 commented Dec 11, 2024

Some mypy issues:

pymc_marketing/mmm/transformers.py:542: error: Argument 2 to "logistic_saturation" has incompatible type "ndarray[tuple[int, ...], dtype[floating[Any]]] | float"; expected "ndarray[tuple[int, ...], dtype[float64]] | float"  [arg-type]
pymc_marketing/clv/utils.py:383: error: No overload variant of "timedelta64" matches argument types "int", "str"  [call-overload]
pymc_marketing/clv/utils.py:383: note: Possible overload variants:
pymc_marketing/clv/utils.py:383: note:     def [_TD64ItemT_co: timedelta | int | None] __init__(self, _TD64ItemT_co | timedelta64[_TD64ItemT_co], /) -> timedelta64[_TD64ItemT_co]
pymc_marketing/clv/utils.py:383: note:     def [_TD64ItemT_co: timedelta | int | None] __init__(self) -> timedelta64[Literal[0]]
pymc_marketing/clv/utils.py:383: note:     def [_TD64ItemT_co: timedelta | int | None] __init__(self, Literal['NAT', 'NaT', 'nat', b'NAT', b'NaT', b'nat'] | None, Literal['Y', 'M', b'Y', b'M', 'W', 'D', b'W', b'D', 'h', 'm', 's', 'ms', 'us', 'μs', b'h', b'm', b's', b'ms', b'us', 'ns', 'ps', 'fs', 'as', b'ns', b'ps', b'fs', b'as'] | tuple[Literal['Y', 'M', b'Y', b'M', 'W', 'D', b'W', b'D', 'h', 'm', 's', 'ms', 'us', 'μs', b'h', b'm', b's', b'ms', b'us', 'ns', 'ps', 'fs', 'as', b'ns', b'ps', b'fs', b'as'], SupportsIndex], /) -> timedelta64[None]
pymc_marketing/clv/utils.py:383: note:     def [_TD64ItemT_co: timedelta | int | None] __init__(self, timedelta, Literal['ns', 'ps', 'fs', 'as', b'ns', b'ps', b'fs', b'as'] | tuple[Literal['ns', 'ps', 'fs', 'as', b'ns', b'ps', b'fs', b'as'], SupportsIndex], /) -> timedelta64[int]
pymc_marketing/clv/utils.py:383: note:     def [_TD64ItemT_co: timedelta | int | None] __init__(self, int, Literal['Y', 'M', b'Y', b'M', 'ns', 'ps', 'fs', 'as', b'ns', b'ps', b'fs', b'as'] | tuple[Literal['Y', 'M', b'Y', b'M', 'ns', 'ps', 'fs', 'as', b'ns', b'ps', b'fs', b'as'], SupportsIndex] = ..., /) -> timedelta64[int]
pymc_marketing/clv/utils.py:383: note:     def [_TD64ItemT_co: timedelta | int | None] __init__(self, timedelta | int, Literal['W', 'D', b'W', b'D', 'h', 'm', 's', 'ms', 'us', 'μs', b'h', b'm', b's', b'ms', b'us'] | tuple[Literal['W', 'D', b'W', b'D', 'h', 'm', 's', 'ms', 'us', 'μs', b'h', b'm', b's', b'ms', b'us'], SupportsIndex] = ..., /) -> timedelta64[timedelta]
pymc_marketing/clv/utils.py:383: note:     def [_TD64ItemT_co: timedelta | int | None] __init__(self, int | bytes | str | timedelta | None, Literal['Y', 'M', b'Y', b'M', 'W', 'D', b'W', b'D', 'h', 'm', 's', 'ms', 'us', 'μs', b'h', b'm', b's', b'ms', b'us', 'ns', 'ps', 'fs', 'as', b'ns', b'ps', b'fs', b'as'] | tuple[Literal['Y', 'M', b'Y', b'M', 'W', 'D', b'W', b'D', 'h', 'm', 's', 'ms', 'us', 'μs', b'h', b'm', b's', b'ms', b'us', 'ns', 'ps', 'fs', 'as', b'ns', b'ps', b'fs', b'as'], SupportsIndex] = ..., /) -> timedelta64[_TD64ItemT_co]
pymc_marketing/clv/utils.py:389: error: No overload variant of "timedelta64" matches argument types "int", "str"  [call-overload]
pymc_marketing/clv/utils.py:389: note: Possible overload variants:
pymc_marketing/clv/utils.py:389: note:     def [_TD64ItemT_co: timedelta | int | None] __init__(self, _TD64ItemT_co | timedelta64[_TD64ItemT_co], /) -> timedelta64[_TD64ItemT_co]
pymc_marketing/clv/utils.py:389: note:     def [_TD64ItemT_co: timedelta | int | None] __init__(self) -> timedelta64[Literal[0]]
pymc_marketing/clv/utils.py:389: note:     def [_TD64ItemT_co: timedelta | int | None] __init__(self, Literal['NAT', 'NaT', 'nat', b'NAT', b'NaT', b'nat'] | None, Literal['Y', 'M', b'Y', b'M', 'W', 'D', b'W', b'D', 'h', 'm', 's', 'ms', 'us', 'μs', b'h', b'm', b's', b'ms', b'us', 'ns', 'ps', 'fs', 'as', b'ns', b'ps', b'fs', b'as'] | tuple[Literal['Y', 'M', b'Y', b'M', 'W', 'D', b'W', b'D', 'h', 'm', 's', 'ms', 'us', 'μs', b'h', b'm', b's', b'ms', b'us', 'ns', 'ps', 'fs', 'as', b'ns', b'ps', b'fs', b'as'], SupportsIndex], /) -> timedelta64[None]
pymc_marketing/clv/utils.py:389: note:     def [_TD64ItemT_co: timedelta | int | None] __init__(self, timedelta, Literal['ns', 'ps', 'fs', 'as', b'ns', b'ps', b'fs', b'as'] | tuple[Literal['ns', 'ps', 'fs', 'as', b'ns', b'ps', b'fs', b'as'], SupportsIndex], /) -> timedelta64[int]
pymc_marketing/clv/utils.py:389: note:     def [_TD64ItemT_co: timedelta | int | None] __init__(self, int, Literal['Y', 'M', b'Y', b'M', 'ns', 'ps', 'fs', 'as', b'ns', b'ps', b'fs', b'as'] | tuple[Literal['Y', 'M', b'Y', b'M', 'ns', 'ps', 'fs', 'as', b'ns', b'ps', b'fs', b'as'], SupportsIndex] = ..., /) -> timedelta64[int]
pymc_marketing/clv/utils.py:389: note:     def [_TD64ItemT_co: timedelta | int | None] __init__(self, timedelta | int, Literal['W', 'D', b'W', b'D', 'h', 'm', 's', 'ms', 'us', 'μs', b'h', b'm', b's', b'ms', b'us'] | tuple[Literal['W', 'D', b'W', b'D', 'h', 'm', 's', 'ms', 'us', 'μs', b'h', b'm', b's', b'ms', b'us'], SupportsIndex] = ..., /) -> timedelta64[timedelta]
pymc_marketing/clv/utils.py:389: note:     def [_TD64ItemT_co: timedelta | int | None] __init__(self, int | bytes | str | timedelta | None, Literal['Y', 'M', b'Y', b'M', 'W', 'D', b'W', b'D', 'h', 'm', 's', 'ms', 'us', 'μs', b'h', b'm', b's', b'ms', b'us', 'ns', 'ps', 'fs', 'as', b'ns', b'ps', b'fs', b'as'] | tuple[Literal['Y', 'M', b'Y', b'M', 'W', 'D', b'W', b'D', 'h', 'm', 's', 'ms', 'us', 'μs', b'h', b'm', b's', b'ms', b'us', 'ns', 'ps', 'fs', 'as', b'ns', b'ps', b'fs', b'as'], SupportsIndex] = ..., /) -> timedelta64[_TD64ItemT_co]
pymc_marketing/mmm/plot.py:276: error: List comprehension has incompatible type List[tuple[Sequence[Any], ...]]; expected List[tuple[int, int]]  [misc]
pymc_marketing/mmm/base.py:559: error: Argument "alpha" to "_add_hdi_to_plot" of "MMMModelBuilder" has incompatible type "floating[Any]"; expected "float"  [arg-type]
Found 5 errors in 4 files (checked 40 source files)

Originally posted by @wd60622 in #1260 (comment)

@nataziel
Copy link
Contributor

had some spare time this arvo so popped a quick fix in for the mypy error in base.py. Will try fix a few more when I have time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants