-
Notifications
You must be signed in to change notification settings - Fork 89
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
WIP: support SpecialFunctions 0.8 and 0.7 #119
Conversation
cc @fredrikekre for the Pkg stuff |
Whats wrong with @static if isdefined(SpecialFunctions, :loggamma)
@scalar_rule(SpecialFunctions.loggamma(x), SpecialFunctions.digamma(x))
else
@scalar_rule(SpecialFunctions.lgamma(x), SpecialFunctions.digamma(x))
end |
A valid point. It does feel less semantic and kinda adhoc, Unrelated:
I guess that last section has some bearing on the first.
|
It is just a more reliable way of doing it; you want to examine the loaded package, not what happened to be found in the env.
I guess you want @static if isdefined(SpecialFunctions, :loggamma)
@scalar_rule(SpecialFunctions.loggamma(x), SpecialFunctions.digamma(x))
end
@static if isdefined(SpecialFunctions, :lgamma)
@scalar_rule(SpecialFunctions.lgamma(x), SpecialFunctions.digamma(x))
end |
Well that shoots that idea out. I guess I can just not worry about versions and just worry about what exists. The corner-case that I do worry about is when we get a circumstance that a functions name stays the same, but its behavour (and thus derivative) changes. |
Aren't we at risk of this generally anyway? edit: to elaborate a little: this is presumably something that a package could pull on us whenever it fancies. I can't see any way to avoid this kind of thing other than with careful unit testing. |
They can use SemVer to tell us, what kind of change they think it is.
Even with careful unit testing assuming we find it on any version, |
Can't we just set the |
We do not want to depend on SpecialFunctions, and we cannot set compat for a package we don't depend on, hence using Requires and this dance around Requires not supporting compat bounds |
Can we just focus on solving the |
@fredrikekre 's plan sounds best for now. |
We can; you can put whatever you want in |
Registrator will complain, no? It is also (IMO) kinda weird to demand specific versions of packages while not depending on them. |
I didn't think so, since we have SpecialFunctions in |
Well, we sort of do depend on it, just not in the |
So why refuse to add it as a real deps then :) |
I see no reason not to, tbh |
We only depend on SpecialFunctions.jl in service to SpecialFunctions.jl. Pragamatically the reason not to is that it add a binary dependency. More likely than adding SpecialFunctions as a dependency to ChainRules is creating a fully standalone glue package for this code. |
When done will close #118
it basically requires solving JuliaPackaging/Requires.jl#3
Right now this just contains the tooling for how to findout package versions and a single example of using it.
Cross-ref:
TODO:
Maybe there is a better way.
Ideally from ChainRules perspective would just put the rules into SpecialFunctions.jl
and then they would always be the right version.
However @ararslan as a maintainer of SpecialFunctions.jl makes the reasonable argument that the SpecialFunctions.jl maintainers should not be obliged to take on responsibility for maintaining the derivatives of the SpecialFunctions.
Particularly while ChainRules is still in alpha.