Skip to content

MyPy Errors in Distributions Module #2036

@juanitorduz

Description

@juanitorduz

Bug Description

In the PR, adding type hints to the distributions module #2032, the CI did not check for consistency, and we have many lint errors.

Steps to Reproduce

Steps to reproduce the behavior.

We must always add the module into the mypy config in the pyproject.toml file as

[[tool.mypy.overrides]]
module = [
    "numpyro.contrib.control_flow.*",       # types missing
    "numpyro.contrib.funsor.*",             # types missing
    "numpyro.contrib.hsgp.*",
    "numpyro.contrib.stochastic_support.*",
    "numpyro.diagnostics.*",
    "numpyro.distributions.*",    # <-- This line was missing!
    "numpyro.handlers.*",
    "numpyro.infer.elbo.*",
    "numpyro.optim.*",
    "numpyro.primitives.*",
    "numpyro.patch.*",
    "numpyro.util.*",
]
ignore_errors = false

When I add this line and do the mypy checks, we have many errors

...
Found 1043 errors in 14 files (checked 88 source files)

Expected Behavior

We should add the line "numpyro.distributions.*" to the pyproject.toml file as above and fix all the errors.
As there are many, we can do it in small PRs.

FYI: @Qazalbash

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions