Skip to content

Commit

Permalink
Merge pull request #58 from lsst/tickets/DM-16296-obs_sdss
Browse files Browse the repository at this point in the history
DM-16296: Flake8 fixes and remove python2 support
  • Loading branch information
timj committed Oct 25, 2018
2 parents 71b33fa + 78f998a commit 2881fbd
Show file tree
Hide file tree
Showing 15 changed files with 8 additions and 41 deletions.
1 change: 0 additions & 1 deletion bin.src/genCoaddRegistry.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
# see <http://www.lsstcorp.org/LegalNotices/>.
#

from __future__ import print_function
import glob
from optparse import OptionParser
import os
Expand Down
1 change: 0 additions & 1 deletion bin.src/genInputRegistry.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
# see <http://www.lsstcorp.org/LegalNotices/>.
#

from __future__ import print_function
import glob
from optparse import OptionParser
import os
Expand Down
1 change: 0 additions & 1 deletion config/sourceAssoc.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
config.inputLevel = "filter"
config.inputSourceDataset = "src"
config.inputCalexpMetadataDataset = "calexp_md"
Expand Down
1 change: 0 additions & 1 deletion python/lsst/obs/sdss/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import absolute_import
#
# LSST Data Management System
# Copyright 2008, 2009, 2010 LSST Corporation.
Expand Down
2 changes: 0 additions & 2 deletions python/lsst/obs/sdss/convertOpECalib.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import, division, print_function
from builtins import range
import os

import numpy as np
Expand Down
3 changes: 0 additions & 3 deletions python/lsst/obs/sdss/convertasTrans.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
from __future__ import absolute_import, division, print_function
from builtins import range
from builtins import object
#
# LSST Data Management System
# Copyright 2008, 2009, 2010 LSST Corporation.
Expand Down
3 changes: 0 additions & 3 deletions python/lsst/obs/sdss/convertfpM.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
from __future__ import absolute_import, division, print_function
from builtins import range
from builtins import object
#
# LSST Data Management System
# Copyright 2008, 2009, 2010 LSST Corporation.
Expand Down
2 changes: 0 additions & 2 deletions python/lsst/obs/sdss/convertpsField.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import, division, print_function
from builtins import range
#
# LSST Data Management System
# Copyright 2008, 2009, 2010 LSST Corporation.
Expand Down
1 change: 0 additions & 1 deletion python/lsst/obs/sdss/converttsField.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import absolute_import, division, print_function
#
# LSST Data Management System
# Copyright 2008, 2009, 2010 LSST Corporation.
Expand Down
3 changes: 0 additions & 3 deletions python/lsst/obs/sdss/makeCamera.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
from __future__ import absolute_import, division, print_function
from builtins import str
from builtins import range
#
# LSST Data Management System
# Copyright 2008, 2009, 2010 LSST Corporation.
Expand Down
12 changes: 3 additions & 9 deletions python/lsst/obs/sdss/sdssMapper.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import, division, print_function
from builtins import map
#
# LSST Data Management System
# Copyright 2008, 2009, 2010 LSST Corporation.
Expand Down Expand Up @@ -33,9 +31,6 @@
from lsst.obs.sdss.converttsField import converttsField
import lsst.afw.image.utils as afwImageUtils

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


class SdssMapper(CameraMapper):
packageName = 'obs_sdss'
Expand Down Expand Up @@ -67,10 +62,9 @@ def _computeCcdExposureId(self, dataId):
@param dataId (dict) Data identifier with run, rerun, filter, camcol, field
"""
return ((int(dataId['run'])
* 10 + self.filterIdMap[dataId['filter']])
* 10 + dataId['camcol']) \
* 10000 + dataId['field']
return ((int(dataId['run']) * 10 +
self.filterIdMap[dataId['filter']]) * 10 +
dataId['camcol']) * 10000 + dataId['field']

def _computeCoaddExposureId(self, dataId, singleFilter):
"""Compute the 64-bit (long) identifier for a coadd.
Expand Down
3 changes: 1 addition & 2 deletions python/lsst/obs/sdss/sdssNullIsr.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
# the GNU General Public License along with this program. If not,
# see <https://www.lsstcorp.org/LegalNotices/>.
#
from __future__ import absolute_import, division, print_function
import lsst.pex.config as pexConfig
import lsst.pipe.base as pipeBase
import lsst.afw.image as afwImage
Expand Down Expand Up @@ -69,7 +68,7 @@ class SdssNullIsrConfig(ProcessCcdTask.ConfigClass):
# \}

class SdssNullIsrTask(pipeBase.Task):
"""!Load SDSS post-ISR data from fpC, fpM, asTrans, etc. files
r"""!Load SDSS post-ISR data from fpC, fpM, asTrans, etc. files
@anchor SdssNullIsrTask_
Expand Down
8 changes: 2 additions & 6 deletions python/lsst/obs/sdss/yanny.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@
#
# Modules
#
from __future__ import print_function
from builtins import range
from past.builtins import basestring
import re
import os
import os.path
Expand Down Expand Up @@ -332,9 +329,8 @@ def __init__(self, filename=None, np=False, debug=False):
# Handle file-like objects
#
# NOTE: commented out to remove astropy.extern.six dependency
# NOTE: Should be revisited when Python 3 support is added to the stack
# if isinstance(filename, six.string_types):
if isinstance(filename, basestring):
if isinstance(filename, str):
if os.access(filename, os.R_OK):
self.filename = filename
with open(filename, 'r') as f:
Expand Down Expand Up @@ -1023,7 +1019,7 @@ def append(self, datatable):
#

def _parse(self):
"""Converts text into tables that users can use.
r"""Converts text into tables that users can use.
This method is for use internally by the yanny object. It is not
meant to be called by users.
Expand Down
7 changes: 2 additions & 5 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
[flake8]
max-line-length = 110
ignore = E133, E226, E228, N802, N803, N806
ignore = E133, E226, E228, N802, N803, N806, W504
exclude =
__init__.py,
config/*,
description/camera/camera.py

[tool:pytest]
addopts = --flake8
flake8-ignore = E133 E226 E228 N802 N803 N806
__init__.py
config/*
description/camera/camera.py
flake8-ignore = E133 E226 E228 N802 N803 N806 W504
1 change: 0 additions & 1 deletion tests/test_sdss.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
# the GNU General Public License along with this program. If not,
# see <http://www.lsstcorp.org/LegalNotices/>.
#
from __future__ import absolute_import, division, print_function
import os
import unittest

Expand Down

0 comments on commit 2881fbd

Please sign in to comment.