pymc-devs / nuts-rs

A implementation of NUTS in rust
MIT License
57 stars 3 forks source link

WIP Rewrite sample stats to use apache arrow #4

Closed aseyboldt closed 1 year ago

aseyboldt commented 1 year ago

This adds a new optional dependency to arrow and if it is enabled, sample stats can be collected in arrow arrays. This makes it easier for other libraries to collect the sampler stats into a trace.

The old custom system that uses an enum to describe the different datatypes is removed, so this is a breaking change.

TODO: Add back in divergance meta information.

codecov-commenter commented 1 year ago

Codecov Report

Patch coverage: 74.61% and project coverage change: -0.87 :warning:

Comparison is base (b5054ca) 88.70% compared to head (bf5a2b9) 87.84%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #4 +/- ## ========================================== - Coverage 88.70% 87.84% -0.87% ========================================== Files 9 8 -1 Lines 1620 1752 +132 ========================================== + Hits 1437 1539 +102 - Misses 183 213 +30 ``` | [Impacted Files](https://app.codecov.io/gh/pymc-devs/nuts-rs/pull/4?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pymc-devs) | Coverage Δ | | |---|---|---| | [src/math.rs](https://app.codecov.io/gh/pymc-devs/nuts-rs/pull/4?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pymc-devs#diff-c3JjL21hdGgucnM=) | `99.06% <ø> (ø)` | | | [src/adapt\_strategy.rs](https://app.codecov.io/gh/pymc-devs/nuts-rs/pull/4?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pymc-devs#diff-c3JjL2FkYXB0X3N0cmF0ZWd5LnJz) | `87.23% <66.66%> (-6.38%)` | :arrow_down: | | [src/cpu\_state.rs](https://app.codecov.io/gh/pymc-devs/nuts-rs/pull/4?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pymc-devs#diff-c3JjL2NwdV9zdGF0ZS5ycw==) | `79.80% <66.66%> (-0.78%)` | :arrow_down: | | [src/nuts.rs](https://app.codecov.io/gh/pymc-devs/nuts-rs/pull/4?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pymc-devs#diff-c3JjL251dHMucnM=) | `82.17% <71.63%> (-2.20%)` | :arrow_down: | | [src/cpu\_potential.rs](https://app.codecov.io/gh/pymc-devs/nuts-rs/pull/4?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pymc-devs#diff-c3JjL2NwdV9wb3RlbnRpYWwucnM=) | `88.97% <76.92%> (+13.97%)` | :arrow_up: | | [src/cpu\_sampler.rs](https://app.codecov.io/gh/pymc-devs/nuts-rs/pull/4?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pymc-devs#diff-c3JjL2NwdV9zYW1wbGVyLnJz) | `91.54% <100.00%> (+0.04%)` | :arrow_up: | | [src/mass\_matrix.rs](https://app.codecov.io/gh/pymc-devs/nuts-rs/pull/4?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pymc-devs#diff-c3JjL21hc3NfbWF0cml4LnJz) | `97.61% <100.00%> (+1.19%)` | :arrow_up: | | [src/stepsize.rs](https://app.codecov.io/gh/pymc-devs/nuts-rs/pull/4?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pymc-devs#diff-c3JjL3N0ZXBzaXplLnJz) | `88.75% <100.00%> (ø)` | | ... and [1 file with indirect coverage changes](https://app.codecov.io/gh/pymc-devs/nuts-rs/pull/4/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pymc-devs)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.