You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I suspect that different libraries will want a different way to include docs from backends.
It would be nice to develop a common pattern, but overall, I am not convinced that it is a priority.
It seems fine to do some default here (i.e. what we currently have), but I think it would make sense to just allow to customize this and just pass on the full metadata defined in the .toml file.
(Or just the additional_docs field, but allow it to be anything and not just a string.)
Adding such a function, begs the question whether it wouldn't be nicer to define a backend as a subclass:
class _BS(spatch.backend_system.BackendSystem):
def documentation_hook():
(or fake class) just to make it less weird to pass functions (but passing a function is also not a big deal for now).
I want to look into this, I wonder if you have thoughts on it @eriknw or @Schefflera-Arboricola?
(The reason is that SciPy already has fancy docs, and whatever they do, for now the easiest is to do nothing, I think. And long-term it'll be something project specific there.)
I could even see a fake class:
@spatch.backend_system.BackendSystem
class _bs:
entry_point = ...
def documentation_hook(...):
...
although, I suppose I can just go with a lot of kwargs for now, i.e. just add BackendSystem(documentation_hook=function|None). This can always be a small alternative spelling (both the decorator or an inheritance style).
Activity
seberg commentedon Oct 13, 2025
I want to look into this, I wonder if you have thoughts on it @eriknw or @Schefflera-Arboricola?
(The reason is that SciPy already has fancy docs, and whatever they do, for now the easiest is to do nothing, I think. And long-term it'll be something project specific there.)
I could even see a fake class:
although, I suppose I can just go with a lot of
kwargsfor now, i.e. just addBackendSystem(documentation_hook=function|None). This can always be a small alternative spelling (both the decorator or an inheritance style).