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

Implement FromIterator<f64> for Empirical and remove from_vec #305

Merged

Conversation

FreezyLemon
Copy link
Contributor

The implementation is identical, but expands support to any source of type T: IntoIterator<f64>.

Also remove now redundant `Empirical::from_vec`
@FreezyLemon FreezyLemon force-pushed the empirical-impl-fromiterator branch from 4e2e956 to f3ceeb4 Compare October 2, 2024 15:53
Copy link

codecov bot commented Oct 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.73%. Comparing base (993a4b5) to head (f3ceeb4).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #305   +/-   ##
=======================================
  Coverage   93.73%   93.73%           
=======================================
  Files          53       53           
  Lines       12010    12010           
=======================================
  Hits        11258    11258           
  Misses        752      752           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@YeungOnion
Copy link
Contributor

Thanks, this is a good API choice, even if we don't expose it as a collection. Maybe we can later implement Extend

Was kind of thinking that a streaming empirical distribution should be distinct from a static one. Optimizations for inserts/removals would be tree-like data but searches could be faster1 flat data over contiguous memory

Footnotes

  1. up to details

@YeungOnion YeungOnion merged commit ce3ebf6 into statrs-dev:master Oct 9, 2024
10 checks passed
@FreezyLemon FreezyLemon deleted the empirical-impl-fromiterator branch October 9, 2024 18:59
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