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-15681: convert skymap documentation to numpydoc #25
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've left some comments: see if you can apply them to the rest of the code, and I'll take another look (so I'm not making the same comment repeatedly). Please ask questions if my comments aren't clear (or if I got something wrong about the documentation policy).
@return a list of face centers (in index order); each a unit vector (numpy array) | ||
Returns | ||
------- | ||
results : `self.faceVecList[:]` |
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.
that's not a type
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.
Does this also just count as "callable"?
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 it's a np.ndarray
.
Hey @DavidStaker, just to alert you that something might be wonky with the Git history here. Generally a PR shouldn't have a merge commit from another PR (did you update your branch using the green button)? There's also some Git merge conflict markup in |
d501ffa
to
4060c64
Compare
Made my own edits: Russell is reviewing now.
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.
Please take another pass. If you want help I am willing.
@@ -0,0 +1,47 @@ | |||
.. py:currentmodule:: lsst.skymap | |||
|
|||
.. _lsst.skymap: |
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 is redundant with the title on line 6 and on my home Mac that redundancy gives a warning
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 how it is shown in the stack template example:
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.
There shouldn't be a pre-existing label with this name. I'll take a look around the package to see what's up.
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 can't reproduce the warning with the lsst.skymap
label.
These are the only warnings I get:
/Users/jsick/lsst/pipelines_lsst_io_stack/stacks/d_2018_12_07/stack/miniconda3-4.5.4-fcd27eb/DarwinX86/pex_config/16.0-8-g4734f7a/python/lsst/pex/config/config.py:docstring of lsst.skymap.BaseSkyMapConfig.compare:12: WARNING: Unexpected indentation.
/Users/jsick/lsst/pipelines_lsst_io_stack/stacks/d_2018_12_07/stack/miniconda3-4.5.4-fcd27eb/DarwinX86/pex_config/16.0-8-g4734f7a/python/lsst/pex/config/config.py:docstring of lsst.skymap.BaseSkyMapConfig.loadFromStream:7: WARNING: Unexpected indentation.
/Users/jsick/lsst/pipelines_lsst_io_stack/stacks/d_2018_12_07/stack/miniconda3-4.5.4-fcd27eb/DarwinX86/pex_config/16.0-8-g4734f7a/python/lsst/pex/config/config.py:docstring of lsst.skymap.DodecaSkyMapConfig.compare:12: WARNING: Unexpected indentation.
/Users/jsick/lsst/pipelines_lsst_io_stack/stacks/d_2018_12_07/stack/miniconda3-4.5.4-fcd27eb/DarwinX86/pex_config/16.0-8-g4734f7a/python/lsst/pex/config/config.py:docstring of lsst.skymap.DodecaSkyMapConfig.loadFromStream:7: WARNING: Unexpected indentation.
/Users/jsick/lsst/pipelines_lsst_io_stack/stacks/d_2018_12_07/stack/miniconda3-4.5.4-fcd27eb/DarwinX86/pex_config/16.0-8-g4734f7a/python/lsst/pex/config/config.py:docstring of lsst.skymap.EquatSkyMapConfig.compare:12: WARNING: Unexpected indentation.
/Users/jsick/lsst/pipelines_lsst_io_stack/stacks/d_2018_12_07/stack/miniconda3-4.5.4-fcd27eb/DarwinX86/pex_config/16.0-8-g4734f7a/python/lsst/pex/config/config.py:docstring of lsst.skymap.EquatSkyMapConfig.loadFromStream:7: WARNING: Unexpected indentation.
/Users/jsick/lsst/pipelines_lsst_io_stack/stacks/d_2018_12_07/stack/miniconda3-4.5.4-fcd27eb/DarwinX86/pex_config/16.0-8-g4734f7a/python/lsst/pex/config/config.py:docstring of lsst.skymap.baseSkyMap.BaseSkyMapConfig.compare:12: WARNING: Unexpected indentation.
/Users/jsick/lsst/pipelines_lsst_io_stack/stacks/d_2018_12_07/stack/miniconda3-4.5.4-fcd27eb/DarwinX86/pex_config/16.0-8-g4734f7a/python/lsst/pex/config/config.py:docstring of lsst.skymap.baseSkyMap.BaseSkyMapConfig.loadFromStream:7: WARNING: Unexpected indentation.
/Users/jsick/lsst/pipelines_lsst_io_stack/stacks/d_2018_12_07/stack/miniconda3-4.5.4-fcd27eb/DarwinX86/pex_config/16.0-8-g4734f7a/python/lsst/pex/config/config.py:docstring of lsst.skymap.healpixSkyMap.HealpixSkyMapConfig.compare:12: WARNING: Unexpected indentation.
/Users/jsick/lsst/pipelines_lsst_io_stack/stacks/d_2018_12_07/stack/miniconda3-4.5.4-fcd27eb/DarwinX86/pex_config/16.0-8-g4734f7a/python/lsst/pex/config/config.py:docstring of lsst.skymap.healpixSkyMap.HealpixSkyMapConfig.loadFromStream:7: WARNING: Unexpected indentation.
/Users/jsick/lsst/pipelines_lsst_io_stack/stacks/d_2018_12_07/stack/miniconda3-4.5.4-fcd27eb/DarwinX86/pex_config/16.0-8-g4734f7a/python/lsst/pex/config/config.py:docstring of lsst.skymap.ringsSkyMap.RingsSkyMapConfig.compare:12: WARNING: Unexpected indentation.
/Users/jsick/lsst/pipelines_lsst_io_stack/stacks/d_2018_12_07/stack/miniconda3-4.5.4-fcd27eb/DarwinX86/pex_config/16.0-8-g4734f7a/python/lsst/pex/config/config.py:docstring of lsst.skymap.ringsSkyMap.RingsSkyMapConfig.loadFromStream:7: WARNING: Unexpected indentation.
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
writing output... [100%] py-api/lsst.skymap.ringsSkyMap.RingsSkyMapConfig
generating indices...
writing additional pages... search
copying static files... done
copying extra files... done
dumping search index in English (code: en) ... done
dumping object inventory... done
build succeeded, 12 warnings.
The HTML pages are in doc/_build/html.
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.
@r-owen what version of Sphinx do you have installed?
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.
Oh, that's dope. I'm still very interested in getting to the bottom of the warning Russell is experiencing.
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 was seeing it at home. I'll have to check it there.
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 forgot to do this last night. But I am confused. @jonathansick why isn't the link redundant? I thought all titles made links automatically, so:
###########
lsst.skymap
###########
should make an anchor lsst.skymap
which is the same as the anchor above that my build complained about.
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.
If you use a link target, like
.. _lsst.skymap:
###########
lsst.skymap
###########
It means you can link to that page/title with a ref
:
:ref:`lsst.skymap`
Without the label, the ref role won't make a link. Now, if it does, that means that another lsst.skymap
label is defined elsewhere, which wouldn't be good.
It's true that Sphinx always autoslugifies headings and turns those into permalink, regardless of their being a link target associated with the header. But those automatic anchor links are only accessible from HTML, and aren't accessible from reStructuredText's ref
role.
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.
@jonathansick thank you for the explanation. Today when I got home I tried package-docs clean
followed by package-docs build
and saw no warnings. I don't know where that warning came from.
``lsst.skymap`` is developed at https://github.com/lsst/skymap. | ||
You can find Jira issues for this module under the `skymap <https://jira.lsstcorp.org/issues/?jql=project%20%3D%20DM%20AND%20component%20%3D%20skymap>`_ component. | ||
|
||
.. If there are topics related to developing this module (rather than using it), link to this from a toctree placed 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.
I suggest deleting this line
.. If there are topics related to developing this module (rather than using it), link to this from a toctree placed here. | ||
|
||
.. .. toctree:: | ||
.. :maxdepth: 1 |
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 is redundant with the toctree on line 19 (but examine the built html if in doubt).
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 is in the template example.
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.
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.
But you can delete the comment right now if you like.
doc/lsst.skymap/index.rst
Outdated
:no-main-docstr: | ||
:no-inheritance-diagram: | ||
.. automodapi:: lsst.skymap.detail | ||
.. automodapi:: lsst.skymap.baseSkyMap |
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.
Is this needed? baseSkyMap is included by skymap/__init__.py
unlike the others (detail, cachingSkyMap...). I'm a bit surprised that the modules listed in lines 45-47 are not included, but they aren't and changing that may be out of scope (though I wouldn't complain if you did it).
python/lsst/skymap/baseSkyMap.py
Outdated
Parameters | ||
---------- | ||
config : `BaseSkyMapConfig` or None | ||
The configuration for this SkyMap; if None use the default config. |
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 parameters should be moved to the class doc string any __init__.py
should not have any doc string. https://developer.lsst.io/python/numpydoc.html#documenting-classes
Sorry about that. I wrote a lot of this before that rule and until that rule I always documented __init__.py
.
Please look for this everywhere in the package.
python/lsst/skymap/ringsSkyMap.py
Outdated
|
||
Returns | ||
------- | ||
tractList : |
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.
Specify the type as `list` of `TractInfo`
and simplify the text on the next line (e.g. "Tracts which include...").
python/lsst/skymap/ringsSkyMap.py
Outdated
|
||
@note | ||
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.
Again the note is obsolete (sorry I missed that when I got rid of afw.Coord).
python/lsst/skymap/ringsSkyMap.py
Outdated
Parameters | ||
---------- | ||
coordList : `list` of `lsst.geom.SpherePoint` | ||
list of sky coordinates |
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.
ICRS sky coordinates
python/lsst/skymap/tractInfo.py
Outdated
@@ -364,7 +426,7 @@ def __init__(self, ident, patchInnerDimensions, patchBorder, ctrCoord, radius, t | |||
self._vertexCoordList = finalWcs.pixelToSky(bboxD.getCorners()) | |||
|
|||
def _minimumBoundingBox(self, wcs): | |||
"""The minimum bounding box is calculated using the nominated radius""" | |||
"""The minimum bounding box is calculated using the nominated radius.""" |
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.
Consider rewording as a proper doc string, e.g.
"""Calculate the minimum bounding box for the tract, given the WCS,
and the nominated radius.
"""
python/lsst/skymap/tractInfo.py
Outdated
@warning: this is not a deep copy | ||
Notes | ||
----- | ||
**Warning:** this is not a deep copy |
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.
SkyWcs is immutable, so this note is obsolete.
I suggest specifying the return type of afw.math.SkyWcs
.
Ok, I think I took care of all your comments, @r-owen. Still no build warnings for me. |
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.
Some of the things I looked at haven't been fixed. I didn't check the others.
@@ -0,0 +1,47 @@ | |||
.. py:currentmodule:: lsst.skymap | |||
|
|||
.. _lsst.skymap: |
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 was seeing it at home. I'll have to check it there.
|
||
class Dodecahedron: | ||
"""A dodecahedron | ||
|
||
Contains positions of faces and associated vertices |
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.
Still no docs for the constructor parameter here or for DodecaSkyMap. Please look harder for this. All classes should document their constructor arguments.
python/lsst/skymap/baseSkyMap.py
Outdated
- This routine will be more efficient if coord is ICRS. | ||
- If coord is equidistant between multiple sky tract centers then one is arbitrarily chosen. | ||
- The default implementation is not very efficient; subclasses may wish to override. | ||
|
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 still find 4 instances of this. Did you push your changes?
I think I hadn't pushed between going to your office and you looking at it. It is pushed now (your above comments no longer apply). |
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.
Still some changes to make, but at this point I'd say make them and merge.
------- | ||
reList : `list` of `TractInfo` or `PatchInfo` | ||
For tracts and patches that contain, or may contain, the specified | ||
region. The list will be empty if there is no overlap. |
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 return type is wrong. This function returns `list` of (`TractInfo`, `list` of `PatchInfo`)
See RingSkyMap.py for a skymap that has this correct. Please make them the same. (You could delete the version in RingSkyMap if the rendered document picks it up from the base class).
Returns | ||
------- | ||
result : `distTractInfoList` | ||
TractInfo of tract whose center is nearest the specified coord. |
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 wrong. It should read tractInfo : `TractInfo`
all subclasses, but called only by the base class implementation of | ||
`getSha1()`. | ||
`getSha1` . |
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.
Also for the register
method below: the name
and registry
arguments should be documented. @TallJimbo wrote this code so I am hoping he can weigh in on this.
name
is of type str
and if Jim cannot provide a better description then I suggest you use "Name of sky map" but it is too vague to make me happy.
I don't know the data type for a Gen3 butler registry. Jim?
@@ -0,0 +1,47 @@ | |||
.. py:currentmodule:: lsst.skymap | |||
|
|||
.. _lsst.skymap: |
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 forgot to do this last night. But I am confused. @jonathansick why isn't the link redundant? I thought all titles made links automatically, so:
###########
lsst.skymap
###########
should make an anchor lsst.skymap
which is the same as the anchor above that my build complained about.
python/lsst/skymap/baseSkyMap.py
Outdated
@@ -76,24 +76,30 @@ class BaseSkyMap: | |||
|
|||
See TractInfo for more information. | |||
|
|||
Parameters | |||
---------- | |||
config : `BaseSkyMapConfig` or None |
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 suggest config : `BaseSkyMapConfig` (optional)
and look for all other instances of config :
because there is a wide variation in how this is listed.
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 cleaned it up as best I could: there's also variation in the __init__
call signatures (some default None, some don't).
python/lsst/skymap/tractInfo.py
Outdated
Returns | ||
------- | ||
finalBBox : `lsst.geom.Box2I` | ||
revised bounding box, |
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.
"Revised bounding box" (with or without a final period). Please don't end with a comma.
python/lsst/skymap/tractInfo.py
Outdated
finalBBox : `lsst.geom.Box2I` | ||
revised bounding box, | ||
wcs : `lsst.afw.geom.SkyWcs` | ||
revised Wcs |
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.
"Revised WCS"
python/lsst/skymap/tractInfo.py
Outdated
ICRS sky coordinate of center of inner region of tract; also used as | ||
the CRVAL for the WCS. | ||
vertexCoordList : `list` of `lsst.afw.geom.SpherePoint` | ||
Of vertices that define the boundaries of the inner region. |
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.
"Vertices that define" or "List of vertices that define". Looks like an error from automatic conversion.
python/lsst/skymap/tractInfo.py
Outdated
Notes | ||
----- | ||
warning: | ||
- This may give incorrect answers on regions that are larger than a tract |
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.
Please fix to make warning bold and render the items as an unordered list:
**warning:**
- This may give...
- This uses...
(especially if..
python/lsst/skymap/tractInfo.py
Outdated
Returns | ||
------- | ||
result : `list` of `lsst.skymap.PatchInfo` | ||
List of PatchInfo for patches that contain, or may contain, the specified region. |
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 line is too long. The warnings below are also too long.
Update doc/ directory to contain pipelines RST files. Fix `__all__`
2ca9271
to
10b8c01
Compare
No description provided.