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-11592: Better documentation for ap_verify #12
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.
@kfindeisen, looks really good. I've added some suggested changes as line comments.
doc/ap_verify/index.rst
Outdated
ap_verify | ||
######### | ||
|
||
The ``ap_verify`` package wraps :py:mod:`ap_pipe <lsst.ap.pipe>` with support for managing :py:mod:`verify <lsst.verify>` metrics. |
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.
For "verify" use the actual module namespace for clarity:
for managing `lsst.verify` metrics.
Note that single back-ticks can be used for any type of Python API reference (being the default 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.
So :mod:
is also redundant?
------------- | ||
|
||
The Dataset framework requires that the computer have version 13.0 or later of the LSST Stack (specifically, the ``obs`` packages and their dependencies) installed. | ||
`Installing lsst_distrib <https://pipelines.lsst.io/#installation>`_ is the simplest way to ensure all dependencies are satisfied. |
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.
:ref:`Installing lsst_distrib <part-installation>` [...]
The Dataset framework requires that the computer have version 13.0 or later of the LSST Stack (specifically, the ``obs`` packages and their dependencies) installed. | ||
`Installing lsst_distrib <https://pipelines.lsst.io/#installation>`_ is the simplest way to ensure all dependencies are satisfied. | ||
|
||
The framework also requires `Git LFS`_ and the `EUPS`_ package management system. The latter is usually included by the Stack installation process. |
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.
Second sentence:
EUPS is included in the Stack installation.
|
||
.. TODO: should we have a proper versioning system for datasets? (DM-12853) | ||
|
||
Once the dataset has been installed, use ``eups declare`` to register the downloaded directory. |
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.
Try to wrap inline shell commands in the command
role, like
:command:`eups declare`
|
||
.. code-block:: sh | ||
|
||
$ git clone https://github.com/lsst/ap_verify_hits2015 mydata |
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 been leaving out any $
or >
characters to reduce copy-paste errors. There are special directives for making uncopyable prompts but I've had some trouble with them.
doc/lsst.ap.verify/running.rst
Outdated
|
||
``ap_verify`` is a Python script designed to be run on both developer machines and verification servers. | ||
This page describes the minimum options needed to run ``ap_verify``. | ||
For more details, see the :ref:`ap-verify-cmd` or run ``ap_verify`` with the ``-h`` argument. |
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.
[...] or run :option:`ap_verify.py -h`.
(links to the reference docs).
python/lsst/ap/verify/ap_verify.py
Outdated
"""Measure any metrics that apply to the final result of the AP pipeline, | ||
rather than to a particular processing stage. | ||
|
||
Parameters | ||
---------- | ||
metadata: `lsst.daf.base.PropertySet` | ||
The metadata produced by the AP pipeline. | ||
metrics_job: `verify.Job` | ||
metricsJob: `verify.Job` |
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.
lsst.verify.Job
— needs the actual namespace to make the link.
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.
Huh. It looks like the dev guide contradicts itself here:
- https://developer.lsst.io/docs/py_docs.html#parameter-types says to use the full namespace
- https://developer.lsst.io/docs/py_docs.html#see-also says to start with the lowest common ancestor
Does the link generation actually work differently in these two contexts?
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.
Ah, I may need to update those docs. I guess we'll see if the link works when it's integrated into pipelines.lsst.io.
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.
Related question: should exceptions also be fully qualified? There are a few that are not in __builtins__
, and the dev guide doesn't say.
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.
Yes, fully-qualified.
def measure_from_metadata(metadata): | ||
"""Attempts to compute all known metrics on Task metadata. | ||
def measureFromMetadata(metadata): | ||
"""Attempt to compute all known metrics on Task metadata. |
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.
Leave out the "Attempt to" part.
|
||
Raises | ||
------ | ||
`RuntimeError`: | ||
the config file exists, but does not contain the expected data | ||
RuntimeError: |
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.
No colon after the exception in the Raises section
Raises
------
RuntimeError
The ``ap_verify`` configuration file exists, but does not contain the
expected data under ``measurements``.
(check the Raises sections of other docstrings)
The fully qualified name of the metric being measured, e.g., | ||
"pipe_tasks.ProcessCcdTime" | ||
|
||
Returns | ||
------- | ||
an `lsst.verify.Measurement` for `metric_name`, or `None` if the timing | ||
information for `task_name` is not present in `metadata` | ||
an `lsst.verify.Measurement` for `metricName`, or `None` if the timing |
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.
Returns is formatted like Parameters, even if you need to make up the name of the return variable. For example, I'd write this one as:
Returns
-------
measurement : `lsst.verify.Measurement`
The metric measurement, or `None` if timing information for ``taskName`` is not present in the ``metadata``.
4f8ce9a
to
32fd6aa
Compare
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.
Looks good overall--just need to make a clarification about parallelization.
|
||
.. prompt:: bash | ||
|
||
python ap_verify/bin/ap_verify.py --dataset HiTS2015 --output workspace/hits/ --dataIdString "visit=54123 ccd=25 filter=g" --silent |
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 would note here that running ap_verify
in parallel causes the metric output to be clobbered, and reference DM-13042 (which is the ticket to fix that).
How to Use Measurements of Metrics | ||
---------------------------------- | ||
|
||
After ``ap_verify`` has run, it will produce a file named :file:`ap_verify.verify.json` in the working directory. |
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 would make the same comment here about parallelization also.
32fd6aa
to
eb71f9a
Compare
A compiled version [zip] of the latest docs. |
doc/lsst.ap.verify/running.rst
Outdated
|
||
.. warning:: | ||
|
||
``ap_verify.py`` is not designed to have multiple instances running concurrently. |
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.
how about "...does not currently support running multiple instances concurrently." instead.
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.
Sure.
eb71f9a
to
9040f71
Compare
This PR adds new-style documentation to the
ap_verify
package. Since the package is not a library and has a minimal public-facing API, most of the documentation is instructions forap_verify
users and guides to keyap_verify
concepts (in particular, datasets).There are a number of cross-references to the other
ap
packages, theverify
documentation, thepipe_base
documentation, and the butler and obs framework topic documentation. Naturally, these references will need to be updated once these documents actually exist.Since new-style documentation is not yet built by Travis, I don't have an HTML version of the documentation to link to.