SpecialFunctions.jl
SpecialFunctions.jl copied to clipboard
Updated Lambert W function implementation
This is a fork of #84. I did:
- rebased PR #84 against the current master
- synced with the current master of LambertW.jl
- implemented suggestions from #84
- made some code simplifications that utilize compile-time dispatch
- updated tests to check for compile-time type inference and improved approximation testing
- ~~moved Omega and 1/e constants to IrrationalConstants.jl (PR https://github.com/JuliaMath/IrrationalConstants.jl/issues/12), so this PR requires that Omega constant PR is merged~~uses inve = 1/e constant from https://github.com/JuliaMath/IrrationalConstants.jl/issues/13
-
Omega constant is exported as
LambertW.Omega
orLambertW.Ω
Codecov Report
Patch coverage: 96.74
% and project coverage change: -0.07
:warning:
Comparison is base (
07a890c
) 94.25% compared to head (ed3c825
) 94.19%.
Additional details and impacted files
@@ Coverage Diff @@
## master #371 +/- ##
==========================================
- Coverage 94.25% 94.19% -0.07%
==========================================
Files 14 15 +1
Lines 2908 3031 +123
==========================================
+ Hits 2741 2855 +114
- Misses 167 176 +9
Flag | Coverage Δ | |
---|---|---|
unittests | 94.19% <96.74%> (-0.07%) |
:arrow_down: |
Flags with carried forward coverage won't be shown. Click here to find out more.
Impacted Files | Coverage Δ | |
---|---|---|
src/SpecialFunctions.jl | 100.00% <ø> (ø) |
|
src/lambertw.jl | 96.74% <96.74%> (ø) |
|
src/beta_inc.jl | 91.46% <0.00%> (-0.75%) |
:arrow_down: |
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
cc @jlapeyre
Can this be merged? Seems well tested and well documented
No, I don't think it should be merged. My impression from the discussion in https://github.com/JuliaMath/SpecialFunctions.jl/pull/84 was that there was a tendency/agreement to keep the function in a separate package.
At this point I wonder if you are interested to improve the implementation of this function at all.
There's a package with this function, and the general opinion (not just my personal one) was to keep the function there. So if it can be improved, I guess you should open a PR in that repo.
The "general opinion" is a bit of a stretch. But thank you for your efforts to guard the quality of Julia ecosystem.
As for me, I think trying to put this code elsewhere would be a waste of my resources, given that nobody have reviewed it here (I have noted "if it can be improved").
@alyst thanks for putting it together. It is generally true that it has been hard to get reviews here.
I'm sorry for you that the PR is not reviewed, but I guess many people, including myself, are not eager to review a PR in detail if there's already a longer discussion that indicates that there is no general agreement that the Lambert W function should be added to SpecialFunctions but instead shows that people seem to be in favour of keeping it in LambertW.jl. Therefore my suggestion was to make a PR to LambertW.jl instead if you would like to improve its implementation. I think you will receive more reviews and comments there.
It did seem that the original author @jlapeyre (IIRC, and if I have my facts straight) expressed interest in keeping it separate - and thus I feel that we should respect that opinion.
Since I was the one who triggered the original thought of getting this in - I would like to apologize for causing wasted effort here. :-(
I'm also sorry if I caused wasted effort. Like many people, I'm over-extended and this is not the highest priority. I was also reluctant to put effort into a PR because I made one (for the same question) a few years ago, and it sat around till it bitrotted. I'm not blaming anyone: Most of us are not paid for this and have other obligations. But, my best estimation was that the best first step is to put LambertW under the JuliaMath org. I asked how to do that in the appropriate (I think) channel in slack a few weeks ago. But, I never got a response.
@jlapeyre I can help with moving LambertW.jl to the JuliaMath org. I'm inviting you as an owner of JuliaMath, and you should be able to then transfer the package.
The separate package has been moved here https://github.com/JuliaMath/LambertW.jl