-
Notifications
You must be signed in to change notification settings - Fork 84
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
Implement concrete Error types for each distribution's new
function
#265
Implement concrete Error types for each distribution's new
function
#265
Conversation
93b5c2c
to
ece3dac
Compare
new
functionnew
function
1870451
to
5cc30d2
Compare
5cc30d2
to
04bd36d
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #265 +/- ##
==========================================
+ Coverage 93.54% 93.58% +0.04%
==========================================
Files 53 53
Lines 11657 11822 +165
==========================================
+ Hits 10904 11064 +160
- Misses 753 758 +5 ☔ View full report in Codecov by Sentry. |
#269 would reduce the effort needed to add tests in this PR significantly, so I'll wait for that. |
04bd36d
to
aa543c4
Compare
aa543c4
to
1e62fa7
Compare
edit: Coverage is still only so-so because there is no code path hitting the |
Regarding coverage, our CI is running nightly cargo, so we could use this attribute on functions (from cargo-llvm-cov) in /// ... docs
#![cfg_attr(coverage_nightly, feature(coverage_attribute))] in modules impl std::fmt::Display for D {
#[cfg_attr(coverage_nightly, coverage(off))]
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
//...
}
} in manifest [lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(coverage,coverage_nightly)'] } Let me know if you want me to do the proofreading as part of my review and I'll check that off when I've done it. |
2208742
to
1d966b1
Compare
Thanks for offering. I plan on going through the docs and Display impls once myself, there's some inconsistencies that I know of which I want to fix. Feel free to proofread when reviewing, but I'd wait until I've done my first pass. |
1d966b1
to
8d02292
Compare
8d02292
to
ffc095a
Compare
Includes notable changes: - Add internal `test_create_err` function - Use `Beta` in unit tests for testing_boiler - Validate Dirichlet params inside `new` and remove `is_valid_alpha` function - Use `Result<Empirical, ()>` for Empirical (infallible `::new` function) - Validate Multinomial params inside `new` and remove `check_multinomial` function - Add a concrete error type to fisher's exact test, too (it is dependent on Hypergeometric, which is why it's included in this change)
ffc095a
to
f8793d1
Compare
Alright, I changed the things I wanted to and finally added the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gave it all a read, everything matches up and the language is consistent, thanks for this.
added a Send + Sync check like in #226 let me know if that works for you. |
Co-authored-by: FreezyLemon <contact@freezylemon.com>
eebdd03
to
6cd01db
Compare
Yeah. I refactored it a bit.. I realized after 226 that it's trivial to do |
See #221 (comment).
Ignore the massive amount of commits, that's for my organisation and can/will be squashed later.
Outstanding issues:
Clippy (ignoredEmpirical
): Returning aResult<_, ()>
is not best practice. clippy suggests anOption
which makes less sense here, so either ignore or return aEmpirical
directly (the function is infallible)Changed my mind on this. Should be fine to change, it's not much code to replicate insideMultinomialError
has not been implemented (yet). I noticed that the parameter validation is moved to theinternal
module which implies thecheck_multinomial
function will be reused somewhere else, so I didn't want to start changing stuff before that project is donenew
(e.g. Categorical does basically the same check insidenew
)Unit Tests
Proofread
After everything is done: Check
StatsError
to see where it is still used and if it can be replaced by something else