-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DM-15554: Convert pipe_tasks to numpydoc status #219
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have gone through a couple of the modules and found consistent things that need to be changed throughout. Can you please make those changes and then I'll review the rest? Let me know if anything I said isn't clear!
python/lsst/pipe/tasks/calibrate.py
Outdated
|
||
|
||
Examples |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A lot of the "examples" here (and throughout pipe_tasks) don't really stand alone. I think an "Examples" doc section should show an example of using the class or object just documented in a general sense. In contrast, this is just an example of how to use a custom debugger. I suggest absorbing this and similar mini-examples into the "Notes" section.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm, understood. I'm not sure if this applied to many .py files in pipe_tasks or not, but a lot of the "Examples" sections come from when someone wrote a lot of doxygen documentation - but the example dox doc pages would often link to code that wasn't there anymore which resulted in a lot of empty white boxes. So I would cut out almost everything but still left the remaining part of the section. I'll go through and fix these.
python/lsst/pipe/tasks/calibrate.py
Outdated
Schema values specified in config.icSourceFieldsToCopy will be | ||
taken from this schema. If set to None, no values will be | ||
propagated from the icSourceCatalog | ||
@param[in,out] kwargs other keyword arguments for | ||
kwargs : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The format for documenting kwargs is here.
@@ -278,26 +266,33 @@ def DebugInfo(name): | |||
|
|||
def __init__(self, butler=None, astromRefObjLoader=None, | |||
photoRefObjLoader=None, icSourceSchema=None, **kwargs): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
init methods should not have docstrings, and instead this info should be moved up to the class level. See here.
python/lsst/pipe/tasks/calibrate.py
Outdated
@param[in] butler The butler is passed to the refObjLoader constructor | ||
Parameters | ||
---------- | ||
butler : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This (and many other parameters) is missing a type after the name. This one should read butler : lsst.daf.persistence.Butler
, for example. You can find a lot of the common ones in the assembleCoadd.py module that I numpydoc-ified a few months ago. This is tedious but really important so users can understand what kind of object each parameter is.
- exposure: characterized exposure; image is repaired by interpolating over cosmic rays, | ||
Returns | ||
------- | ||
dmeRes : `struct` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is super close to the right format for a struct, but needs some tweaking (see earlier comment).
@param[in] butler A butler object is passed to the refObjLoader constructor in case | ||
Parameters | ||
---------- | ||
butler : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, this and all subsequent parameters need a type
@@ -264,6 +264,8 @@ def run(self, skyInfo, tempExpRefList, imageScalerList, weightList, | |||
supplementaryData=None): | |||
"""Assemble the coadd. | |||
|
|||
Notes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this needs to be in a Notes section, it can just be the extended description as-is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mrawls No, The extended description should be at most a few sentences. We can't allow the extended description to push the parameter and returns descriptions too far down the page. Notes
is totally appropriate and necessary here.
https://developer.lsst.io/python/numpydoc.html#extended-summary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bad, I didn't catch that the "Notes" was more than the next sentence that followed! Completely agree with @jonathansick, this is fine as-is.
@@ -283,7 +285,7 @@ def run(self, skyInfo, tempExpRefList, imageScalerList, weightList, | |||
|
|||
Once the ``DcrModel`` reaches convergence or the maximum number of | |||
iterations has been reached, fill the metadata for each subfilter | |||
image and make them proper ``coaddExposure``s. | |||
image and make them proper ``coaddExposure`` . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not clear why you removed the plural 's' here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Anything with the format word
s causes the numpydoc build to complain.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The solution is:
``coaddExposure``\ 's.
https://developer.lsst.io/restructuredtext/style.html#inline-text-styling
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...and then you need to tell python it's a r"""
string to prevent warnings about unknown escapes.
@@ -297,7 +299,6 @@ def run(self, skyInfo, tempExpRefList, imageScalerList, weightList, | |||
The weight to give each input exposure in the coadd | |||
supplementaryData : `lsst.pipe.base.Struct` | |||
Result struct returned by ``makeSupplementaryData`` with components: | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this white space is correct, see here
Hey @DavidStaker, I just want to alert you that the Git history here is a little wonky. I think (forgive me if I'm wrong) that this branch might have been updated with the green button on the PR page. This has the effect or merging I'm sure someone at UW can walk you through the rebase if you need assistance. |
e6a5e2a
to
87b7a13
Compare
3399b68
to
14ec627
Compare
Lots of work to do to finish this; original review is outdated.
See ticket comment on details. Minor style corrections.
14ec627
to
07a0009
Compare
97856c3
to
070a161
Compare
Just a note to say that we should not delete this branch yet, as we are still using it as reference for the ongoing doxygen->numpydoc conversion (see DM-35939). |
No description provided.