Skip to content

Conversation

@pllim
Copy link
Member

@pllim pllim commented Dec 13, 2025

Reverts #1292

@pllim pllim added docs no-changelog-entry-needed changelog bot directive labels Dec 13, 2025
@pllim
Copy link
Member Author

pllim commented Dec 13, 2025

Okay, so I think I am able to trace where the prod API doc is coming from but I don't know what is the proper way to fix it. SpectralAxis goes through a chain of inheritance that basically ends up with class Quantity(numpy.ndarray) and therefore, the prod doc (https://specutils.readthedocs.io/en/latest/api/specutils.SpectralAxis.html#specutils.SpectralAxis.prod) comes from https://github.com/numpy/numpy/blob/aa843d5af41179e66129ae7d30579c7556657ab8/numpy/_core/_add_newdocs.py#L4056

_array_method_doc('prod', "axis=None, dtype=None, out=None, **kwargs",
    f"""
    a.prod(axis=None, dtype=None, out=None, *, {_KWARGS_REDUCE})

    Return the product of the array elements over the given axis

    Refer to `numpy.prod` for full documentation.

    See Also
    --------
    numpy.prod : equivalent function
    """)

Somehow Sphinx 9 broke API doc from such inheritance. I wonder if @AA-Turner has any ideas on how to solve this short of the hacky way of just not showing inherited methods. 🙏

The error:

docs/api/specutils.SpectralAxis.rst:51: WARNING: failed to import object specutils.SpectralAxis.prod
WARNING: error while formatting signature for specutils.SpectralAxis.prod: list assignment index out of range [autodoc]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs no-changelog-entry-needed changelog bot directive

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant