Skip to content

Commit

Permalink
Merge pull request #52 from lsst/tickets/DM-16296-obs_cfht
Browse files Browse the repository at this point in the history
DM-16296: Flake8 Fixes
  • Loading branch information
timj committed Oct 25, 2018
2 parents aec0f8b + 1b07518 commit f74bbc9
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 14 deletions.
2 changes: 1 addition & 1 deletion bin.src/megacamCalibRegistry.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def convertUnixTime(time):


if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Parse the CFHT Elixir detrend database to create " +
parser = argparse.ArgumentParser(description="Parse the CFHT Elixir detrend database to create "
"a calibration registry")
parser.add_argument("table", nargs=1, help="FITS table to parse")
parser.add_argument("--create", action="store_true", help="Create new registry?")
Expand Down
2 changes: 1 addition & 1 deletion bin/genCameraRepository.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def makeDir(dirPath, doClobber=False):
camConfigPath = os.path.join(outputDir, "camera.py")
with open(camConfigPath, 'w') as outfile:
outfile.write(
"#!!!!This file is auto generated.----Do not edit!!!!\n" +
"#!!!!This file is auto generated.----Do not edit!!!!\n"
"#!!!!Edit input file and regenerate with $OBS_CFHT_DIR/bin/genCameraRepository.py\n")
camConfig.saveToStream(outfile)

Expand Down
15 changes: 7 additions & 8 deletions python/lsst/obs/cfht/megacamMapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,8 @@

from lsst.daf.persistence import Policy
from lsst.obs.base import CameraMapper, exposureFromImage
import lsst.pex.policy as pexPolicy
from .makeMegacamRawVisitInfo import MakeMegacamRawVisitInfo

# Solely to get boost serialization registrations for Measurement subclasses
import lsst.meas.algorithms # flake8: noqa


class MegacamMapper(CameraMapper):
"""Camera Mapper for CFHT MegaCam."""
Expand All @@ -50,9 +46,11 @@ def __init__(self, **kwargs):
policy = Policy(policyFile)
super(MegacamMapper, self).__init__(policy, os.path.dirname(policyFile), **kwargs)

# The "ccd" provided by the user is translated through the registry into an extension name for the "raw"
# template. The template therefore doesn't include "ccd", so we need to ensure it's explicitly included
# so the ArgumentParser can recognise and accept it.
# The "ccd" provided by the user is translated through the registry
# into an extension name for the "raw" template. The template
# therefore doesn't include "ccd", so we need to ensure it's
# explicitly included so the ArgumentParser can recognise and accept
# it.

self.exposures['raw'].keyDict['ccd'] = int

Expand All @@ -71,7 +69,8 @@ def __init__(self, **kwargs):
# define filters?
self.filterIdMap = dict(u=0, g=1, r=2, i=3, z=4, i2=5, u2=6, g2=7, r2=8, i3=9, z2=10)

# Ensure each dataset type of interest knows about the full range of keys available from the registry
# Ensure each dataset type of interest knows about the full range of
# keys available from the registry
keys = {'runId': str,
'object': str,
'visit': int,
Expand Down
6 changes: 2 additions & 4 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@ max-line-length = 110
ignore = E133, E226, E228, N802, N803, N806
exclude =
__init__.py,
config/*,
config/*
megacam/camera/camera.py


[tool:pytest]
addopts = --flake8
flake8-ignore = E133 E226 E228 N802 N803 N806
__init__.py
config/*
megacam/camera/camera.py

0 comments on commit f74bbc9

Please sign in to comment.