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

more accurate type hints #631

Merged
merged 1 commit into from
Oct 31, 2022

Conversation

ahsiungsg
Copy link
Contributor

@ahsiungsg ahsiungsg commented Oct 31, 2022

Submission Checklist

  • Run unit tests
  • Declare copyright holder and open-source license: see below

Summary

The optimized_params_dict method generates its dictionary by iterating over a numpy array, which produces a numpy item type instead of the base python type; however, the method was annotated with Dict[str, float]. This was creating type checking errors downstream. Here, the annotation is changed to Dict[str, np.float64]

In addition, the various linters were upgraded to get pre-commit to run, since they weren't working on newer python versions.

Copyright and Licensing

Please list the copyright holder for the work you are submitting (this will be you or your assignee, such as a university or company):

  • Stan Developers and their Assignees

By submitting this pull request, the copyright holder is agreeing to license the submitted work under the following licenses:

@codecov-commenter
Copy link

codecov-commenter commented Oct 31, 2022

Codecov Report

Merging #631 (8a7f509) into develop (43f01a9) will decrease coverage by 0.35%.
The diff coverage is n/a.

@@             Coverage Diff             @@
##           develop     #631      +/-   ##
===========================================
- Coverage    80.33%   79.97%   -0.36%     
===========================================
  Files           46       46              
  Lines         6886     6888       +2     
===========================================
- Hits          5532     5509      -23     
- Misses        1354     1379      +25     
Impacted Files Coverage Δ
cmdstanpy/cmdstanpy/utils/filesystem.py 66.95% <0.00%> (-0.59%) ⬇️
a/cmdstanpy/cmdstanpy/cmdstanpy/progress.py
a/cmdstanpy/cmdstanpy/cmdstanpy/cmdstan_args.py
.../cmdstanpy/cmdstanpy/cmdstanpy/stanfit/__init__.py
a/cmdstanpy/cmdstanpy/cmdstanpy/stanfit/runset.py
a/cmdstanpy/cmdstanpy/cmdstanpy/utils/logging.py
...mdstanpy/cmdstanpy/cmdstanpy/utils/data_munging.py
a/cmdstanpy/cmdstanpy/cmdstanpy/__init__.py
a/cmdstanpy/cmdstanpy/cmdstanpy/stanfit/mcmc.py
a/cmdstanpy/cmdstanpy/cmdstanpy/utils/cmdstan.py
... and 39 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@WardBrian
Copy link
Member

Thanks!

@WardBrian WardBrian merged commit 061c438 into stan-dev:develop Oct 31, 2022
@WardBrian WardBrian mentioned this pull request Jan 10, 2023
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 this pull request may close these issues.

3 participants