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
Many libraries that use numpydoc also use the Sphinx linkcode feature. In order to use it, they all must define a linkcode_resolve function that returns the web URL where the code for a given Python object can be found.
I first noticed this bug in scikit-learn and reported it in scikit-learn/scikit-learn#10542. @jnothman suggested that instead of fixing the bug in scikit-learn only, it might make sense to put a shared, default version of linkcode_resolve in numpydoc, so that changes propagate to other libraries that implement linkcode_resolve.
Does anyone have thoughts about whether
it makes sense to consolidate this logic, and
numpydoc is the right place to put it? (One possible alternative would be to put it in Sphinx.)
I might be able to help with this consolidation, as time permits 😄
The text was updated successfully, but these errors were encountered:
It might be best to develop a reusable piece of code and offer it here, so
that we can see concretely what can/should be shared. The current
implementations depend on the code being hosted at GitHub, on git being
used for version control, a specified relationship between version numbers
and git tags, source code directory structure, etc.
Yes, it seems like Sphinx could offer a helper for applying heuristics to
determine likely source code lines...
Many libraries that use numpydoc also use the Sphinx
linkcode
feature. In order to use it, they all must define alinkcode_resolve
function that returns the web URL where the code for a given Python object can be found.These libraries mostly seem to be using slightly modified versions of the numpy one -- for example, here are the pandas version and the scikit-learn version. Consequently, an error in the original logic has propagated to these other libraries: decorated functions often generate incorrect links. See e.g. the source code links for numpy.isposinf and sklearn.pipeline.Pipeline.predict_log_proba.
I first noticed this bug in scikit-learn and reported it in scikit-learn/scikit-learn#10542. @jnothman suggested that instead of fixing the bug in scikit-learn only, it might make sense to put a shared, default version of
linkcode_resolve
innumpydoc
, so that changes propagate to other libraries that implementlinkcode_resolve
.Does anyone have thoughts about whether
numpydoc
is the right place to put it? (One possible alternative would be to put it in Sphinx.)I might be able to help with this consolidation, as time permits 😄
The text was updated successfully, but these errors were encountered: