Manual type promotion for arcsine distribution#1373
Manual type promotion for arcsine distribution#1373jzmaddock merged 7 commits intoboostorg:developfrom
Conversation
|
@mborland what do you think of this version? I made a number of actual changes to the code that I'd like to get your opinion on. I left comments below. On an unrelated note, I wasn't able to get |
It is setup to run, and I just tried it on head and the test ran fine. What's the issue? You can try |
|
I do think this approach looks better. Thanks! |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #1373 +/- ##
===========================================
+ Coverage 95.34% 95.35% +0.01%
===========================================
Files 825 825
Lines 68160 68175 +15
===========================================
+ Hits 64986 65010 +24
+ Misses 3174 3165 -9
... and 1 file with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
There were just a ton of errors in my code. I missed a couple of closing brackets which caused a large amount of errors. |
|
@mborland and @jzmaddock I think this is ready to merge as long as neither of you see any other issues. Do these changes need to be applied to every distribution in the |
|
@mborland and @jzmaddock just pinging you guys to let you know this PR is ready to merge. |
No, in general most of the distributions are fairly trivial wrappers around some special function or other, so all the argument promotion stuff is handled there anyway. There are a small number (possibly just this one, not sure) of distributions which use trivial arithmetic or std lib functions only, and for those we couldn't really see the point in jumping through all the hoops of applying the type promotion policies. I'm not necessarily convinced it'll have much if any effect on this one either to be honest given the calculations are so simple and error rates so low, but there we go... Thanks for this, merging... |
Ah, that makes sense to me. #1299 added the manual promotion for the Beta and Bernoulli distribution. @mborland are their any other distributions that you know which have this issue? I'll do this for the Beta and Bernoulli distribution and take a look at the other distributions. |
|
Just curious, what do you guys think needs to change in the beta distribution? It's just a thin wrapper around the ibeta family of functions? |
There are a couple of functions like variance and skewness that are direct calculations rather than wrappers. I honestly don't know how much this stuff matters, especially on newer GCC where promotion is already happening on their end. |
|
Hmmmm, if this isn't that high of a priority are there any other projects I could work on for the time being? |
Depending on the scale of what you're looking for we have a pinned feature wishlist. If you're interested the last open feature request from the SciPy guys would be helpful: #303 (comment) |
|
Something smaller that would also be super helpful is getting the lib to run with -Wall or -Wextra and -Werror. I did some way back, but you'll still see your terminal rapidly fill with warnings if you run the test suites. |
I'm happy to read this suggestion. It is another world, the fascinating drive toward quality, offering tangible and long-lasting results. We have worked on warning reduction (and of course all quality aspects) for years now. I've worked on this also from time to time over the years.
Formal correctness adds quite a bit more than you might think at the outset and really helps with portability and long-term maintenance. |
|
There is also the (probably never ending and never finished) job of improving our testing coverage. I started going through all the special functions with the aim of getting to 100% coverage on all of them, if you look down a recent PR run and drill down you'll see: https://app.codecov.io/gh/boostorg/math/pull/1379/tree/include/boost/math/special_functions?dropdown=coverage where there are lots of 100%'s but a few that have recently dropped below that :( I also haven't got into the special_functions/detail directory yet where there are lots with low coverage currently. |
This tries to rewrite #1299 in a more human readable way. See #1294 for the same issue with the logistic distribution.