Skip to content

Make package Julia native#97

Merged
MikaelSlevinsky merged 5 commits into
JuliaMath:masterfrom
TSGut:master
Jul 2, 2026
Merged

Make package Julia native#97
MikaelSlevinsky merged 5 commits into
JuliaMath:masterfrom
TSGut:master

Conversation

@TSGut

@TSGut TSGut commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Now that Gamma.jl is in good shape, faster or same as SpecialFunctions.jl in all cases and also slimmer as a dependency (and supporting Complex Bigfloat better), I want to propose making HypergeometricFunctions.jl Julia native as well.

This PR does that by swapping out SpecialFunctions.jl for Gamma.jl. That's basically it. All tests pass since we intentionally made the Gamma.jl API compatible, so it's very minor changes.

@MikaelSlevinsky: There is a design choice to be made here relating to the unsafe_gamma thing you had: I am not extremely sure why you had that extra call in there - I guess you prefer getting NaN from C rather than throwing an error? So I kept that behaviour in place but all tests also pass if we just remove unsafe_gamma and call gamma, so I am not sure what it's trying to accomplish or correct. If you tell me I will match your design choice, for now I hardcoded C-like behavior. Even more odd because for complex values you also just called gamma, so... ?


I will also tag @juliohm and @oscardssmith, since they were part of the original chat on Julia Discourse (https://discourse.julialang.org/t/ann-meijerg-jl-a-julia-package-for-calculating-meijer-g-functions/136577/11) and Oscar is helping with Gamma.jl.

If this is approved and merged, this also paves the way for MeijerG.jl to become Julia native since gammas and pFq are all I need for that.

@codecov

codecov Bot commented Jul 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.11%. Comparing base (306a99b) to head (107dfa9).

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #97      +/-   ##
==========================================
+ Coverage   84.89%   85.11%   +0.22%     
==========================================
  Files           7        7              
  Lines        1470     1465       -5     
==========================================
- Hits         1248     1247       -1     
+ Misses        222      218       -4     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread src/specialfunctions.jl Outdated
@MikaelSlevinsky

Copy link
Copy Markdown
Collaborator

Hi @TSGut, this is great, thank you! One comment: it looks like you changed the random tests to definite tests, which is something that should have happened a long time ago. Let me recommend a change (that passes locally).

@TSGut

TSGut commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

In Gamma.jl we run 10k seeded random tests for each input type we support, so that's a way to get random in but in any case it should be pseudo random with a fixed seed or just static because otherwise CI is a nightmare (it bit me a few times here which is why I changed it).

Though I guess it isn't the point of this PR, I would also be happy to extract a big ensemble of test cases from e.g. mpmath into a text file at high precision and route them in, similar to what I did for Gamma.jl and MeijerG.jl.

Updated test cases for hypergeometric functions to use new ranges for complex and real numbers.
@MikaelSlevinsky

Copy link
Copy Markdown
Collaborator

Ok I changed the line. If the tests pass, I'll merge

@MikaelSlevinsky MikaelSlevinsky self-assigned this Jul 2, 2026
@MikaelSlevinsky MikaelSlevinsky self-requested a review July 2, 2026 15:37
@MikaelSlevinsky MikaelSlevinsky removed their assignment Jul 2, 2026
@TSGut

TSGut commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

Only thing to consider then is what to do with version number, since I haven't touched that.

Comment thread test/runtests.jl
@MikaelSlevinsky MikaelSlevinsky merged commit 17b375d into JuliaMath:master Jul 2, 2026
18 checks passed
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.

3 participants