SciML / ADTypes.jl

Repository for automatic differentiation backend types
https://sciml.github.io/ADTypes.jl/
MIT License
38 stars 11 forks source link

Export sparsity detection interface #82

Closed adrhill closed 6 days ago

adrhill commented 1 week ago

The interface for sparsity detection should be exported, or at least marked as public. The exported symbols are very unlikely to cause name collisions:

The same applies to the matrix coloring interface as well.

ChrisRackauckas commented 1 week ago

sounds fine to me.

adrhill commented 1 week ago

I'll open a PR if @gdalle doesn't object.

gdalle commented 1 week ago

Marked as public, definitely, but that would require bringing Compat as an additional dependency since the public keyword only lands in Julia 1.11.

Exports are essentially useless because they don't semantically denote public API, they just clutter the namespace. I would be okay with exporting the first two, but no one is ever gonna use the latter two in their code so I'm firmly against exporting those.

gdalle commented 1 week ago

On second thought it's not a great idea to export jacobian_sparsity and hessian_sparsity because Symbolics also defines functions with the same name (which are not just methods for the ADTypes functions). In other words, if Symbolics ever decides to export them, the code of anyone who wrote

using ADTypes, Symbolics

will be broken

ChrisRackauckas commented 1 week ago

Symbolics should extend.

gdalle commented 1 week ago

Unclear because the Symbolics functions apply to different data types (symbolic variables and expressions)