-
Notifications
You must be signed in to change notification settings - Fork 40
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
relax type definition of middle #28
Conversation
Thoughts @nalimilan? |
This could do with some tests. But that aside, I think |
Why isn't that well-defined for |
|
Could always add a mehod for |
It would very nice to be able to compute medians of unitful types, but I understand your argument about Complex numbers. I would be happy with something like @kleinschmidt's suggestion. |
Tangentially, I'm slightly surprised that unitful quantities subtype |
What is the best way of figuring out whether we can change the supertype of unitful quantities? Seems risky to restrict the type from its current definition. |
Surely middle should be defined for complex numbers, or whenever x/2+y/2 is defined for that matter? Median will fail on complex numbers because PartialSort fails, which seems correct to me.
I think impedance? |
@ararslan Given that allowing |
Sure, sounds good to me. |
Before doing so it would be good to update the docstring as Bogumił mentioned. Might also be nice to have a test for non-reals. |
OK, let's go with that then. @tlnagy Do you want to update the PR? |
this adds support for computing the median of unitful types, see PainterQubits/Unitful.jl#202
Thanks everyone for the constructive feedback, I've updated the PR. I think it's ready to merge! This will close #43 |
bump |
Thanks @tlnagy! (And for the reminder!) |
To get this included in the upcoming 1.6.0-alpha release, would you make a PR similar to JuliaLang/julia#35869 to use the latest Statistics commit in Julia? Thanks! |
Hi @nalimilan, I'm not sure how how to create a PR like that? |
The manual process is to copy the git SHA of the latest commit, put it in stdlib/Statistics.version, run |
And I should do that when building the latest julia master from source, right? |
I submitted a PR (JuliaLang/julia#37950) against Base to bump Statistics. It would be great to have it in Julia 1.6! |
frequencies: https://en.wikipedia.org/wiki/Laplace_transform |
this adds support for computing the median of unitful types, fixes PainterQubits/Unitful.jl#202