casangi / xradio

Xarray Radio Astronomy Data IO
Other
9 stars 5 forks source link

Convert docstrings to numpy style (in vis) #175

Closed FedeMPouzols closed 1 month ago

FedeMPouzols commented 1 month ago

This is an uneventful PR. It simply converts the docstring syntax, from the old reST to numpy style in src/vis. I run pyment and then corrected manually a few formatting issues plus a few small bugs in the docs that came up in the process. Finally run black on the files changed to catch up with the changes in some type annotations.

Note for the future: in these changes, the types of parameter/returns are included in the docstrings. But for the future I'd favor not including types manually in the docstrings. I think it would be easier to maintain if we use the types directly from the type hints via extensions (for our case `sphinx-autodoc-napoleon-typehints). This way we can get the types auto-populated in the documentation from the type hints, avoiding duplication (and also avoiding relying on doc text which would tend to be less dependable than type hints).

About pyment, docconvert was a bit more reliable but it doesn't seem to handle types from the annotations.


Note well:

This contribution is made under the current ALMA software agreements.
(c) European Southern Observatory, 2024
Copyright by ESO (in the framework of the ALMA collaboration)
CLAassistant commented 1 month ago

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

FedeMPouzols commented 1 month ago

Merging after fixing an small merge conflict after #176 was merged.