scikit-learn: BUG: Stable docs intersphinx has a duplicate std:term:y

When building with intersphinx we get a warning which you can replicate with intersphinx directly

$ python -m sphinx.ext.intersphinx https://scikit-learn.org/stable/objects.inv | grep "    y "
WARNING:sphinx.sphinx.util.inventory:inventory <> contains multiple definitions for std:term:y
    y                                                                                : glossary.html#term-y

Only one term shows up in the grep presumably because intersphinx chooses one of the two, but the WARNING line actually shows up in doc builds.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 15 (10 by maintainers)

Most upvoted comments

Thanks @jayaddison, my question was mostly out of curiosity and at this time I feel this is not worth opening a sphinx issue about it because this is a YAGNI. If the use case really happened in scikit-learn and somehow y and Y are moved to separate glossary entries, we will reconsider.

As a summary of the previous comments:

  • y and Y are the same entry in the scikit-learn glossary so we can live with the limitation that objects.inv is case insensitive
  • sphinx 7.4.4 remove the puzzling warning for scikit-learn objects.inv consumers

I’ve a potential change open at https://github.com/sphinx-doc/sphinx/pull/12586 that would filter these warnings provided that the item being pointed to is the same – so the current warning about y and Y would disappear… but if they are modified to point to distinct targets, the warning would reappear (because the Intersphinx v2 inventory format does not support case-sensitive matches).

I realize that could present some friction in cases where there is a desire to use names that vary only by character-casing; but I think we should surface the ambiguity.

Done

Agreed, seems to have been magically fixed! 🪄