cta-observatory / ctapipe

Low-level data processing pipeline software for CTAO or similar arrays of Imaging Atmospheric Cherenkov Telescopes
https://ctapipe.readthedocs.org
BSD 3-Clause "New" or "Revised" License
62 stars 266 forks source link

Some examples not showing in API docs #2513

Closed kosack closed 4 months ago

kosack commented 4 months ago

Describe the bug

Looking at the docs for example here: https://ctapipe.readthedocs.io/en/latest/api/ctapipe.core.telescope_component.TelescopeParameter.html#ctapipe.core.telescope_component.TelescopeParameter

There is a set of examples in the docstring under the Examples heading. The heading appears in the Sphinx output ,but not the examples for some reason.

According to the NumPyDoc documentation, the Examples section should be shown

Expected behavior

Full documentation is shown

Supporting information

image image

Additional context Add any other context about the problem here.

kosack commented 4 months ago

Could it be that that using .. code-block is ignored? The Numpydoc examples use doctest format, but these examples are not tests and should not be executed, only displayed.

maxnoe commented 4 months ago

This is a rst Syntax issue,

Code block needs two colons:

.. code-block:: Python

    Foo
kosack commented 4 months ago

I don't know how many times I looked at that and didn't notice :-) Thanks!