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-17831: Rewrite docstrings in numpydoc format #66

Merged
merged 8 commits into from Feb 14, 2019
Merged

Conversation

timj
Copy link
Member

@timj timj commented Feb 9, 2019

Still needs a sphinx directory.

Ensure that max-doc-length <= 79
builders.py and installation.py have problems due to the
memberOf decorator.
@timj
Copy link
Member Author

timj commented Feb 10, 2019

I've added some Sphinx building. The main remaining problem seems to be that the @memberOf decorator confuses sphinx by injecting methods into a SCons class and it complains about the toctree.

This allows the memberOf methods that have been monkey
patched into the base SConsEnvironment to have their
documentation displayed.
Copy link
Member

@jonathansick jonathansick left a comment

Choose a reason for hiding this comment

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

This is brilliant 🏆 Thank you @timj!

I don't have much to add, and I think this definitely adds a lot of value and future potential and we should add this to the pipelines_lsst_io build.

It might be useful to have some explainer after the first paragraph on the index.rst saying that the SConsUtilsEnvironment collects all the methods?/functions? available in the SCons environment, but is itself a construct for the purpose of the documentation. Up to you, if you can word it (I don't understand it enough at the moment).

There's also a fix to make in scripts.py, but that's it.

as independent single tests. By default this list is empty
and all tests are run in a single pytest call.
Items specified here will not appear in the default pyList
and should not start with "test_" (such that they will not
Copy link
Member

Choose a reason for hiding this comment

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

Believe it or not, this line is generating this warning:

scripts.py:docstring of lsst.sconsUtils.scripts.BasicSConscript.tests:44: WARNING: Unknown target name: "test".

(that is, it wants to make test_ a link.

Luckily it can be fixed by making it a literal:

``"test_"``

Copy link
Member Author

Choose a reason for hiding this comment

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

Thank you! That warning was bugging me and I couldn't work out what line it was talking about.

doc/conf.py Outdated

"""Sphinx configuration file for an LSST stack package.

This configuration only affects single-package Sphinx documenation builds.
Copy link
Contributor

Choose a reason for hiding this comment

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

"documenation" → "documentation"

lsst.sconsUtils
###############

The ``sconsUtils`` module provides tooling to support the building of standard
Copy link
Contributor

Choose a reason for hiding this comment

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

One line per sentence?

Copy link
Contributor

@ktlim ktlim left a comment

Choose a reason for hiding this comment

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

Minor suggestions.


Many of the methods defined in this package are injected directly into
the base SConsEnvironment.
The `~lsst.sconsUtils.installation.SConsUtilsEnvironment` class solely exists to allow these methods to be documented.
Copy link
Contributor

Choose a reason for hiding this comment

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

"solely exists" → "exists solely"; maybe make this a .. note::?


Files are chosen if they match fileRegex; toplevel directories in list
ignoreDirs are ignored.
This routine won't do anything unless you specified a "TAGS" target
Copy link
Contributor

Choose a reason for hiding this comment

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

Add a period?

The name of the calling .cfg file, usually just passed in with the
special variable ``__file__``. This will be parsed to extract the
package name and root.
headers : `list`, optional
Copy link
Contributor

Choose a reason for hiding this comment

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

'list' of 'str' (with backquotes)?

Returns
-------
result : `bool`
Did the flag work?
Copy link
Contributor

Choose a reason for hiding this comment

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

"flag"? Looks like this was copied from the function above. Same goes for the next function.


Notes
-----
.. code-block:: python
Copy link
Contributor

Choose a reason for hiding this comment

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

Add a line of text saying at least "Sample usage:"?

with glob patterns. If a file is listed as "@fileName", the @ is
stripped and we don't bother to check if fileName exists (useful for
machine-generated files).
expectedFalures : `dict`, optional
Copy link
Contributor

Choose a reason for hiding this comment

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

"expectedFalures" → "expectedFailures"

Notes
-----

.. code-block:: python
Copy link
Contributor

Choose a reason for hiding this comment

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

Again, "Sample usage:"

Returns
-------
hasSIP : `bool`
`True` if SIP is present in this operationing system version.
Copy link
Contributor

Choose a reason for hiding this comment

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

"operationing" → "operating"

@timj timj merged commit edfe965 into master Feb 14, 2019
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.

None yet

3 participants