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-6640: IsrTask is not a valid CmdLineTask #65

Merged
merged 1 commit into from Sep 24, 2018
Merged

Conversation

czwa
Copy link
Contributor

@czwa czwa commented Sep 5, 2018

This ticket adds a stand-alone runIsr.py script, as well as ensuring that runIsr.py and processCcd.py read the same ISR configuration files.

@anchor IsrWrapperTask_

@brief Task to wrap the main IsrTask to allow camera specific retargeting.
"""
Copy link
Contributor

Choose a reason for hiding this comment

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

Please make the new docstrings numpydoc, otherwise we'll just have to convert them later.

Also, can you please expand on this documentation a bit? I don't really understand what makes it different from the original IsrTask.

Copy link
Contributor

Choose a reason for hiding this comment

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

It wraps IsrTask, so that it can be retargeted.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ditto on numpydoc.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Docstrings updated to numpydoc. I didn't use a sufficiently new comparison to get the new format.

Docstring also amended to include information on what this change does, and why it's needed.

Copy link
Contributor

@PaulPrice PaulPrice left a comment

Choose a reason for hiding this comment

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

I think the two commits should be squashed: the second doesn't add much and is strongly related to the first.

@@ -1225,3 +1225,50 @@ def getSaturation(self):

def getSuspectLevel(self):
return float("NaN")


class IsrWrapperTaskConfig(pexConfig.Config):
Copy link
Contributor

Choose a reason for hiding this comment

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

IsrWrapperConfig

Copy link
Contributor

Choose a reason for hiding this comment

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

And double check that you update the config file name to match this in obs_base too

@anchor IsrWrapperTask_

@brief Task to wrap the main IsrTask to allow camera specific retargeting.
"""
Copy link
Contributor

Choose a reason for hiding this comment

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

It wraps IsrTask, so that it can be retargeted.

@anchor IsrWrapperTask_

@brief Task to wrap the main IsrTask to allow camera specific retargeting.
"""
Copy link
Contributor

Choose a reason for hiding this comment

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

Ditto on numpydoc.

@param[in] *kwargs a dictionary of keyword arguments passwed on to the
Task constructor
Call the lsst.pipe.base.task.Task.__init__ method,
then setup the default IsrTask as a subtask
Copy link
Contributor

Choose a reason for hiding this comment

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

You don't need this explanation: that's exactly what the code says, and the code says it in fewer words.

Copy link
Contributor

Choose a reason for hiding this comment

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

Agree with earlier comments re. numpydoc, also please note our guide explicitly says not to have a docstring for init methods. More details at https://developer.lsst.io/python/numpydoc.html#py-docstring-class-structure

"""!Perform instrument signature removal on a ButlerDataRef of a Sensor
Parameters
----------
dataRef : `daf.persistence.butlerSubset.ButlerDataRef`
Copy link
Contributor

Choose a reason for hiding this comment

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

Should be:

dataRef : `lsst.daf.persistence.ButlerDataRef`

(Needs to be fully-qualified, but you can drop the butlerSubset because ButlerDataRef gets pulled into the parent namespace.)

Parameters
----------
dataRef : `daf.persistence.butlerSubset.ButlerDataRef`
DataRef of the detector data to be processed
Copy link
Contributor

Choose a reason for hiding this comment

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

Data reference of the ...


Returns
-------
result :
Copy link
Contributor

Choose a reason for hiding this comment

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

Need a type.

#!/usr/bin/env python
#
# LSST Data Management System
# Copyright 2008, 2009, 2010 LSST Corporation.
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 we need the copyleft here, do we? If so, fix the year and the copyright owner (Trustees of Princeton University).

Copy link
Contributor

@yalsayyad yalsayyad Sep 10, 2018

Choose a reason for hiding this comment

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

We do generally have copylefts in our scripts in bin.src/

More info:

The new-style preamble assumes you have COPYRIGHT file in the repo.

Copy link
Member

Choose a reason for hiding this comment

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

We should put the standard boiler plate (which changed recently so check in https://developer.lsst.io/stack/license-and-copyright.html?highlight=copyright ) in each source file. Copyrights should be in a COPYRIGHT file though, not each file.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I found the updated boiler plate today while looking, so that has been updated as well.

#
from lsst.ip.isr.isrTask import IsrWrapperTask

IsrWrapperTask.parseAndRun()
Copy link
Contributor

Choose a reason for hiding this comment

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

Might just be me, but I would expect this to tun RunIsrTask given the name of the script is runIsr. Remember all the eye-rolling over bin/measureCoaddSources.py calling
MeasureMergedCoaddSourcesTask.parseAndRun() and the like in pipe_tasks

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am open to different solutions, but I don't see one that doesn't involve either 1) making separate runIsr_obsX.py scripts for each obs_package; or 2) making the current RunIsrTask into RunIsrRealTask or something equivalent.

Copy link
Contributor

Choose a reason for hiding this comment

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

Is there already a RunIsrTask???

Copy link
Contributor

Choose a reason for hiding this comment

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

The pattern now should be IsrTask + camera-specific IsrTask's like DecamNullIsrTask. To my knowledge, there is no RunIsrTask. I'm going offline for the night. I don't care enough for you to change it to RunIsrTask, but be aware one of the PipelineTask precursor/refactoring jobs that @natelust going to work on is making the multiband script names match their Task names in pipe_tasks.

_DefaultName = "isrWrap"

def __init__(self, *args, **kwargs):
pipeBase.Task.__init__(self, *args, **kwargs)
Copy link
Member

Choose a reason for hiding this comment

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

I think @natelust is or shortly will be going through the Tasks and making them use super() in places like this, so we can use multiple inheritance if we need to during the CmdLineTask->PipelineTask transition. Might be good to go ahead and do that in new code right now.

The IsrTask was not usable as a CmdLineTask, as it was written to be
called as a subtask of ProcessCcdTask.  This allows the default
IsrTask to be retargeted to camera-specific versions of the ISR
processing.  A new RunIsrTask now exists to hold IsrTask for
retargetting in standalone processing, and both processCcd.py and
runIsr.py now read from the same configuration files for each obs_
package.  This has involved migrating configuration values from
config/processCcd.py to config/isr.py for many obs_ packages.
@czwa czwa merged commit 436b4c3 into master Sep 24, 2018
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

7 participants