astropy/sphinx-astropy

Missing parentheses in SourceProperties/source_properties example call

Opened this issue · 5 comments

Edit: This has been moved over from photutils. Rendered issue is visible here: https://photutils.readthedocs.io/en/latest/api/photutils.segmentation.source_properties.html#photutils.segmentation.source_properties


In the online docs for both the source_properties() function and the SourceProperties class, the example call with all arguments listed is missing parentheses around the kron_params tuple entries:

Screen Shot 2020-10-29 at 9 38 57 PM

I think it should be:

 photutils.segmentation.source_properties(data, segment_img, error=None, mask=None, 
                                                       background=None, filter_kernel=None, 
                                                       wcs=None, labels=None, 
                                                       localbkg_width=None, 
                                                       kron_params=**(**'mask', 2.5, 0.0, 'exact', 5**)**)

I would have fixed it myself, but it seems to be fine in all of the source code, and it runs well. Is this just an issue with the online docs?

Thanks!

Thanks for reporting,

The code itself is indeed fine, this is an issue with the docs building.

Locally everything builds without an issue using sphinx 2.4, but upgrading to the latest, 3.2.1 I get the same issue as in the report, so I think we better move the issue to the sphinx-astropy repo.

Screen Shot 2020-10-29 at 19 14 37

cc @astropy/documentation-infrastructure-maintainers

pllim commented

At a glance, I don't see anything we have that customizes function signature appearance. What if you simply use vanilla Sphinx, does it still happen? If so, then maybe this is a Sphinx bug further upstream.

pllim commented

Or maybe this issue should be moved to https://github.com/astropy/sphinx-automodapi/ . I think it is either a Sphinx bug or our automodapi . cc @astrofrog

I didn't have more time to investigate rather than just confirming the behaviour. I also failed to find a similar usage for the core, so I'm fairly certain this is a not very frequent issue, and therefore is only low priority.

(Oh, re moving it here: my thinking was that this can be a parking spot until it becomes clear whether it is due to sphinx, or sphinx-automodapi. An a workaround could certainly be to limit the sphinx version here (but again, this is a very minor rendering issue so I don't think it's worth limiting the version just because of it)