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

Replace Base.floatrange with simplified implementation #792

Merged
merged 2 commits into from May 20, 2022
Merged

Replace Base.floatrange with simplified implementation #792

merged 2 commits into from May 20, 2022

Conversation

metab0t
Copy link
Contributor

@metab0t metab0t commented May 18, 2022

Base.floatrange has bugs and is not public API anymore
See JuliaLang/julia#45336
Use a simplified implementation instead
Fixes #667 and #616

Base.floatrange has bugs and is not public API anymore
See JuliaLang/julia#45336
Use a simplified implementation instead
@getzze
Copy link
Contributor

getzze commented May 19, 2022

Thanks for find a workaround for this worrying bug!
Base.TwicePrecision is also not public API, so it would be better not to use it either, but instead to rework the histrange to simplify it in the first place. What do you think?

@ararslan
Copy link
Member

It's true that TwicePrecision is technically not public but there are a lot of packages that use it (and have done so for a long time). I think it's okay to use it here.

src/hist.jl Outdated Show resolved Hide resolved
@metab0t
Copy link
Contributor Author

metab0t commented May 20, 2022

It's true that TwicePrecision is technically not public but there are a lot of packages that use it (and have done so for a long time). I think it's okay to use it here.

I agree. Depending on TwicePrecision is more reliable because of its clear semantics and IIRC it is designed to use with StepRangeLen.

Copy link
Member

@ararslan ararslan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The failures on Julia nightly are unrelated. Thanks for the contribution, much appreciated!

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.

StatsBase.fit(StatsBase.Histogram) produces wrong output
3 participants