MPoL-dev / MPoL

A flexible Python platform for Regularized Maximum Likelihood imaging
https://mpol-dev.github.io/MPoL/
MIT License
33 stars 11 forks source link

Docstrings do not fully render for several mpol.plot routines #234

Closed iancze closed 9 months ago

iancze commented 9 months ago

Describe the bug The docstrings for some routines in mpol.plot do not render correctly.

When building the docs, I get

/Users/ian/Documents/Research/Disks/RML/MPoL/src/mpol/plot.py:docstring of mpol.plot.vis_1d_fig:20: ERROR: Unexpected indentation.
/Users/ian/Documents/Research/Disks/RML/MPoL/src/mpol/plot.py:docstring of mpol.plot.vis_1d_fig:35: ERROR: Unexpected indentation.
/Users/ian/Documents/Research/Disks/RML/MPoL/src/mpol/plot.py:docstring of mpol.plot.get_residual_image:10: WARNING: Block quote ends without a blank line; unexpected unindent.
/Users/ian/Documents/Research/Disks/RML/MPoL/src/mpol/plot.py:docstring of mpol.plot.radial_fig:5: ERROR: Unexpected indentation.
/Users/ian/Documents/Research/Disks/RML/MPoL/src/mpol/plot.py:docstring of mpol.plot.get_image_cmap_norm:1: WARNING: Block quote ends without a blank line; unexpected unindent.
/Users/ian/Documents/Research/Disks/RML/MPoL/src/mpol/plot.py:docstring of mpol.plot.radial_fig:13: ERROR: Unexpected indentation.
/Users/ian/Documents/Research/Disks/RML/MPoL/src/mpol/plot.py:docstring of mpol.plot.radial_fig:38: ERROR: Unexpected indentation.
/Users/ian/Documents/Research/Disks/RML/MPoL/src/mpol/plot.py:docstring of mpol.plot.get_residual_image:13: WARNING: Block quote ends without a blank line; unexpected unindent.

This is with a fresh pip install -e '.[dev]' off of main and after doing make clean. The render failure can also be seen live, e.g. for vis_1d_fig, the intended list of plots seen in the source code

    Figure for comparison of 1D projected MPoL model visibilities and observed 
    visibilities. Plots:
    - Re(V): observed and MPoL model (projected unless `geom` is supplied)
    - Residual Re(V): observed - MPoL model (projected unless `geom` is supplied)
    - Im(V): observed and MPoL model (projected unless `geom` is supplied)
    - Residual Im(V): observed - MPoL model (projected unless `geom` is supplied)

renders as

Figure for comparison of 1D projected MPoL model visibilities and observed visibilities. Plots: - Re(V): observed and MPoL model (projected unless geom is supplied) - Residual Re(V): observed - MPoL model (projected unless geom is supplied) - Im(V): observed and MPoL model (projected unless geom is supplied) - Residual Im(V): observed - MPoL model (projected unless geom is supplied)

To reproduce Run docs build with current main branch ff7e4bd

Expected behavior The docs build does not report errors and the live docs render correctly.

Screenshots

Screenshot 2023-12-09 at 23 07 54

Suggested fix Convert these docstrings to follow the napoleon format as specified in docs/conf.py and used by the other routines in MPoL.