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-42576: Write task to compute predicted positions for an upcoming visit #229

Merged
merged 1 commit into from
Sep 6, 2024

Conversation

Gerenjie
Copy link
Contributor

{Summary of changes. Prefix PR title with JIRA issue.}


  • [x ] Do unit tests pass (scons and/or stack-os-matrix)?
  • [x ] Did you run ap_verify.py on at least one of the standard datasets?
    For changes to metrics, the print_metricvalues script from lsst.verify will be useful.
  • [ x] Is the Sphinx documentation up-to-date?

@kfindeisen
Copy link
Member

It looks like something went wrong with the rebase -- AFAICT "Added logic for MPSkyEphemerisQueryTask" should be the only commit on the PR. I'll continue the review on just 9ae80ca, but you might want to re-rebase on your end in the meantime.

Copy link
Member

@kfindeisen kfindeisen left a comment

Choose a reason for hiding this comment

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

Looks good, mostly style comments. Please remember to describe the PR in the title -- people also come across PRs from the GitHub side, and most can't remember arbitrary 5-digit codes. 🙂

@@ -0,0 +1,16 @@
.. py:currentmodule:: lsst.ap.verify

.. program:: ap_verify.py
Copy link
Member

Choose a reason for hiding this comment

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

The program:: directive is unnecessary -- it's used for defining :option: links to command-line arguments.

Comment on lines 11 to 16
mpSkyEphemerisQueryTask
=======================
``ap_verify`` now runs mpSkyEphemerisQuery, which includes a request to mpSky.
mpSky is not expected to host ephemerides for all test datasets, so it will
often (or always) fail. When requests fail, mpSkyEphemerisQuery should return
an empty DataFrame, and no detections will be associated.
Copy link
Member

Choose a reason for hiding this comment

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

Please follow the RST style guide, in particular having a space after the header and not hard-wrapping the text. Hard-wrapping makes it hard to tell what's been edited in later changes.


mpSkyEphemerisQueryTask
=======================
``ap_verify`` now runs mpSkyEphemerisQuery, which includes a request to mpSky.
Copy link
Member

Choose a reason for hiding this comment

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

Strictly speaking, ap_verify is just a framework for running preconfigured pipelines on preconfigured data sets, and has nothing to do with the pipeline contents (except for the APDB, out of necessity). How about:

Suggested change
``ap_verify`` now runs mpSkyEphemerisQuery, which includes a request to mpSky.
The AP pipelines now run :py:class:`lsst.ap.association.MPSkyEphemerisQueryTask`, which includes a request to mpSky.

An :lsst-task: role would be more appropriate, but I'm guessing you don't want to add a task topic page to ap_association at this point.

Copy link
Member

Choose a reason for hiding this comment

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

This file is not actually linked to the documentation in any way, and users won't be able to see it. Nor is "mpSkyEphemerisQueryTask external request" really an ap_verify topic as such...

Would you be willing to expand this page into a "Known Limitations" topic, and make the MPSkyEphemerisQueryTask text a section of it?

# name=VISIT, instrument=INSTRUMENT,
# class_name="lsst.obs.base.instrument_tests.DummyCam",
# )

Copy link
Member

Choose a reason for hiding this comment

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

Please do not commit unused code.

cls.repo.registry.syncDimensionData("instrument", instrumentRecord)
butlerTests.addDataIdValue(cls.repo, "physical_filter", PHYSICAL, band=BAND)
butlerTests.addDataIdValue(cls.repo, "subfilter", SUB_FILTER)
butlerTests.addDataIdValue(cls.repo, "exposure", VISIT)
butlerTests.addDataIdValue(cls.repo, "visit", VISIT)
butlerTests.addDataIdValue(cls.repo, "group", VISIT)
Copy link
Member

Choose a reason for hiding this comment

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

This is not correct; group is always a string, not an integer. Please make a new value (currently group names are always timestamps, but this is not guaranteed so there's no need to enforce it here).

@@ -220,6 +232,7 @@ def testMockGetTemplateTask(self):
pipelineTests.runTestQuantum(task, self.butler, quantum, mockRun=False)

def testMockAlardLuptonSubtractTask(self):

Copy link
Member

Choose a reason for hiding this comment

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

I'm ignoring most of the gratuitous whitespace changes, but this one is actually against Python conventions. I'm surprised flake8 didn't complain.

@@ -351,14 +379,14 @@ def testMockDiaPipelineTask(self):
pipelineTests.assertValidOutput(task, result)

self.butler.put(pandas.DataFrame(), "deepDiff_diaSrcTable", self.visitId)
self.butler.put(pandas.DataFrame(), "visitSsObjects", self.visitId)
self.butler.put(pandas.DataFrame(), "preloaded_ssObjects", self.groupId)
Copy link
Member

Choose a reason for hiding this comment

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

It's a bit strange that you can drop visitSsObjects, because the default DiaPipelineConnections still takes them as inputs. That and the fix below means this code wasn't being exercised in the first place. 😞

I'd recommend leaving this with visitSsObjects, since what we're supposed to be testing here is whether MockDiaPipelineTask is still representative of DiaPipelineTask, which has not been modified to support the new group-based dataset.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

tests/test_testPipeline.py::MockTaskTestSuite::testMockDiaPipelineTask fails when this is left with visitSsObjects but does not when this is left with preloaded_SsObjects (new capitalization).

@kfindeisen kfindeisen changed the title DM-42576 DM-42576: Write task to compute predicted positions for an upcoming visit Jul 29, 2024
@kfindeisen
Copy link
Member

Before I try to re-review this, can you please re-rebase onto main to drop everybody else's commits? Either @isullivan or I can help you with that if you need it.

@Gerenjie
Copy link
Contributor Author

Before I try to re-review this, can you please re-rebase onto main to drop everybody else's commits? Either @isullivan or I can help you with that if you need it.

Done!

Copy link
Member

@kfindeisen kfindeisen left a comment

Choose a reason for hiding this comment

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

Looks good, just a few comments about the new docs.


########################################
Known Limitations
########################################
Copy link
Member

Choose a reason for hiding this comment

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

Sphinx requires that the header symbol lines be exactly as long as the header text. Please do run package-docs build, it will catch such things.

mpSkyEphemerisQueryTask
=======================

The AP pipelines now run :py:class:`lsst.ap.association.MPSkyEphemerisQueryTask`, which includes a request to mpSky. mpSky is not expected to host ephemerides for all test datasets, so it will often (or always) fail. When requests fail, mpSkyEphemerisQuery should return an empty DataFrame, and no detections will be associated.
Copy link
Member

Choose a reason for hiding this comment

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

Please write each sentence on a new line; this makes it easier to spot future changes (as opposed to, say, changing one word and git diff counting it as replacing the whole paragraph).

Copy link
Member

Choose a reason for hiding this comment

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

The last sentence is out of date now. 🙂

@kfindeisen
Copy link
Member

kfindeisen commented Sep 5, 2024

Please squash the "Formatting" commit, as it's a classic "fixup". You'll also need to rebase again; fortunately the merge conflict is easy to resolve because testPipeline.py and test_testPipeline.py can just be deleted.

@Gerenjie Gerenjie force-pushed the tickets/DM-42576 branch 2 times, most recently from 3ae9676 to 7650473 Compare September 6, 2024 18:20
@Gerenjie Gerenjie merged commit 2672fb0 into main Sep 6, 2024
2 checks passed
@Gerenjie Gerenjie deleted the tickets/DM-42576 branch September 6, 2024 18:26
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.

2 participants