stan-dev / cmdstanpy

CmdStanPy is a lightweight interface to Stan for Python users which provides the necessary objects and functions to compile a Stan program and fit the model to data using CmdStan.
BSD 3-Clause "New" or "Revised" License
149 stars 67 forks source link

Add a num_threads helper argument to pathfinder() #741

Closed WardBrian closed 3 months ago

WardBrian commented 3 months ago

Submission Checklist

Summary

Closes #738 by adding a keyword argument num_threads. This checks that the model was compiled with STAN_THREADS defined and if so, sets the environment variable STAN_NUM_THREADS to the desired value.

This also fixes a small oversight pointed out on the forums: https://discourse.mc-stan.org/t/pathfinder-does-not-accept-multiple-inits/34580/

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):

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

codecov-commenter commented 3 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 79.67%. Comparing base (b420952) to head (71d22e0). Report is 5 commits behind head on develop.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #741 +/- ## =========================================== - Coverage 79.81% 79.67% -0.14% =========================================== Files 75 25 -50 Lines 11502 3843 -7659 =========================================== - Hits 9180 3062 -6118 + Misses 2322 781 -1541 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

WardBrian commented 3 months ago

I will do a patch release tomorrow