Skip to content
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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

DavidStaker
Copy link

No description provided.

@DavidStaker DavidStaker changed the title Tickets/dm 15554 - WIP Tickets/dm 15554 - Convert pipe_tasks to numpydoc status Sep 10, 2018
mrawls
mrawls previously requested changes Sep 11, 2018
Copy link
Contributor

@mrawls mrawls left a 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!

doc/lsst.pipe.tasks/index.rst Outdated Show resolved Hide resolved


Examples
Copy link
Contributor

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.

Copy link
Author

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.

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 :
Copy link
Contributor

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):
Copy link
Contributor

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.

@param[in] butler The butler is passed to the refObjLoader constructor
Parameters
----------
butler :
Copy link
Contributor

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`
Copy link
Contributor

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 :
Copy link
Contributor

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
Copy link
Contributor

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.

Copy link
Member

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

Copy link
Contributor

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`` .
Copy link
Contributor

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?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anything with the format words causes the numpydoc build to complain.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

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:

Copy link
Contributor

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

@mrawls mrawls changed the title Tickets/dm 15554 - Convert pipe_tasks to numpydoc status DM-15554: Convert pipe_tasks to numpydoc status Sep 11, 2018
@jonathansick
Copy link
Member

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 master into your PR's branch, which isn't what we do. We do a git rebase -based workflow described here:
https://developer.lsst.io/work/flow.html#pushing-code

I'm sure someone at UW can walk you through the rebase if you need assistance.

@kgabor kgabor force-pushed the tickets/DM-15554 branch 3 times, most recently from e6a5e2a to 87b7a13 Compare December 18, 2018 07:03
@mrawls mrawls force-pushed the tickets/DM-15554 branch 2 times, most recently from 3399b68 to 14ec627 Compare December 19, 2018 22:39
@mrawls mrawls dismissed their stale review December 19, 2018 22:40

Lots of work to do to finish this; original review is outdated.

@parejkoj
Copy link
Contributor

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants