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

support non_scalar parameters for rvs, cdf and ppf methods #162

Merged
merged 2 commits into from
Jan 5, 2023

Conversation

aloctavodia
Copy link
Contributor

@aloctavodia aloctavodia commented Jan 4, 2023

This will be useful among other cases when defining "PreliZ models" for prior predictive elicitation/checks (coming soon). For the moment functions like plot_* or summary does not support parameters being arrays, instead, we raise an error indicating the user to use scalars. It should not be too much work to extend the support for non_scalar parameters, but it will certainly add some complexity to the code-base and the benefit will be marginal as users can easily get the same result right now by just adding a for loop. So a benefit could be consistency, but not sure of functionality. Finally, this PR also adds more tests.

@codecov-commenter
Copy link

Codecov Report

Merging #162 (46de6cb) into main (6d22c2a) will increase coverage by 1.34%.
The diff coverage is 96.72%.

❗ Current head 46de6cb differs from pull request most recent head e4d2558. Consider uploading reports for the commit e4d2558 to get more accurate results

@@            Coverage Diff             @@
##             main     #162      +/-   ##
==========================================
+ Coverage   77.79%   79.13%   +1.34%     
==========================================
  Files          18       18              
  Lines        2265     2329      +64     
==========================================
+ Hits         1762     1843      +81     
+ Misses        503      486      -17     
Impacted Files Coverage Δ
preliz/distributions/distributions.py 89.36% <76.19%> (+4.69%) ⬆️
preliz/utils/utils.py 80.59% <92.30%> (+24.23%) ⬆️
preliz/distributions/continuous.py 93.53% <100.00%> (ø)
preliz/distributions/discrete.py 99.39% <100.00%> (+<0.01%) ⬆️
preliz/tests/test_distributions.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@aloctavodia aloctavodia merged commit c07e179 into main Jan 5, 2023
@aloctavodia aloctavodia deleted the non_scalar branch January 5, 2023 11:53
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.

2 participants