Skip to content

ENH: template-ify lambertw with overloads for double, float, and complex<float>#116

Open
kandersolar wants to merge 5 commits intoscipy:mainfrom
kandersolar:lambertw-overloads
Open

ENH: template-ify lambertw with overloads for double, float, and complex<float>#116
kandersolar wants to merge 5 commits intoscipy:mainfrom
kandersolar:lambertw-overloads

Conversation

@kandersolar
Copy link
Copy Markdown

This PR adds overloads for lambertw for double, float, and complex<float> inputs. The implementation follows @steppi's suggested approach in this forum thread: https://discuss.scientific-python.org/t/scipy-special-faster-real-only-versions-of-special-functions/2271/4

Please note that this is my first time dealing with modern C++. Please review the code assuming it was written by someone that figured it out as they went :)

I can say at least that it compiles and passes pixi run tests, which I take to mean that I did not break the existing complex<double> path. However, I'll need some guidance with creating tests for the new dtypes. I see there are parquet files with test values, but I'm lost beyond that.

@steppi
Copy link
Copy Markdown
Member

steppi commented Mar 27, 2026

Thanks @kandersolar. For testing, the parquet files contain test cases from the entire scipy.special test suite and the tests and files were generated automatically. Check out tests in xsf/tests/xsf_tests for examples of test code which was added manually. This should be fairlystraightforward to review; I will try to take a look within the next week or two.

@steppi
Copy link
Copy Markdown
Member

steppi commented Mar 27, 2026

The windows failures are known and unrelated. You don't have to worry about the formatting issues for now.

@kandersolar kandersolar changed the title Add lambertw overloads for double, float, and complex<float> ENH: template-ify lambertw with overloads for double, float, and complex<float> Apr 7, 2026
kandersolar added a commit to kandersolar/xsf that referenced this pull request Apr 8, 2026
@fbourgey fbourgey added the enhancement New feature or request label Apr 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants