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

Missing py.typed file #2

Closed
peterschutt opened this issue Jan 30, 2024 · 3 comments · Fixed by #3
Closed

Missing py.typed file #2

peterschutt opened this issue Jan 30, 2024 · 3 comments · Fixed by #3

Comments

@peterschutt
Copy link
Contributor

Hi,

Just started using shin - thanks for making the package available!

In testing I've noticed that while the source is typed correctly mypy won't recognize it as typed due to missing the py.typed marker file.

Here is mypy output:

src/domain/utils.py:5: error: Skipping analyzing "shin": module is installed, but missing library stubs or py.typed marker  [import-untyped]
src/domain/utils.py:5: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
@peterschutt
Copy link
Contributor Author

Closed in #3

@mberk
Copy link
Owner

mberk commented Jan 30, 2024

Thanks for the interest and your contribution. I don't personally use mypy but having a play with your change, it seems to me that some additional changes would be required to fix the outstanding errors that mypy reports:

  1. A shin.pyi file providing type hints for the Rust optimise function
  2. A couple of problems with variable assignments

Can you please confirm and if so one of us can add these changes to the new release branch

@peterschutt
Copy link
Contributor Author

Thanks for the interest and your contribution. I don't personally use mypy but having a play with your change, it seems to me that some additional changes would be required to fix the outstanding errors that mypy reports:

1. A `shin.pyi` file providing type hints for the Rust optimise function

2. A couple of problems with variable assignments

Can you please confirm and if so one of us can add these changes to the new release branch

I just opened another issue with some improvements I've been experimenting with.. I did also add a .pyi for shin too :)

def optimise(
    inverse_odds: list[float],
    sum_inverse_odds: float,
    n: int,
    max_iterations: int = 1000,
    convergence_threshold: float = 1e-12,
) -> tuple[float, float, float]:
    ...

I just assumed it would take the same args as the python func given how its used.

I'd be happy to tidy these things up and add mypy to your testing/ci?

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

Successfully merging a pull request may close this issue.

2 participants