Skip to content

Commit 414385a

Browse files
devmotionoxinaboxViralBShah
authored
Add upgrade guide (#369)
* Add upgrade guide Co-authored-by: Lyndon White <oxinabox@ucc.asn.au> Co-authored-by: Viral B. Shah <ViralBShah@users.noreply.github.com>
1 parent 1febdd0 commit 414385a

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,21 @@ Documentation:
1414

1515
Test status (most recent release):
1616
[![PkgEval](https://juliaci.github.io/NanosoldierReports/pkgeval_badges/S/SpecialFunctions.svg)](https://juliaci.github.io/NanosoldierReports/pkgeval_badges/report.html)
17+
18+
## Upgrading from SpecialFunctions 1
19+
20+
SpecialFunctions 2 has only a [single breaking change](https://github.com/JuliaMath/SpecialFunctions.jl/pull/297):
21+
The removal of the type piracy `Base.factorial(x::Number) = gamma(x + 1)`.
22+
For most users this change will not break anything but for users of `factorial` it might.
23+
If you want to upgrade from SpecialFunctions 1 to SpecialFunctions 2 we recommend:
24+
25+
- If your code does not use `factorial` then update the compat entry for SpecialFunctions to e.g. `"1.8.1, 2"`.
26+
- If your code does use `factorial` then check for all occurrences of `factorial`:
27+
28+
- If `factorial` is called on an `Integer`, keep `factorial`,
29+
- Otherwise replace `factorial(x)` with a call to `gamma(x + 1)`.
30+
31+
Afterwards update the compat entry for SpecialFunctions and check that your package works with SpecialFunctions 2.
32+
33+
As the previous overload of `factorial` was type piratical ([added 4 years ago when code was moved out of Base](https://github.com/fredrikekre/SpecialFunctions.jl/blame/148574086f3da1d9f7e05d4eb538f91a73775d96/src/gamma.jl#L757-L758)), it is possible that you used it without a direct dependency on SpecialFunctions as long as SpecialFunctions was loaded.
34+
The package ecosystem was analyzed and this only impacted a couple of packages. However, it is possible that private packages that depend on this may need updating, or stay with the older release of SpecialFunctions.jl.

0 commit comments

Comments
 (0)