Skip to content

Commit

Permalink
update extension location
Browse files Browse the repository at this point in the history
  • Loading branch information
sosey committed Mar 30, 2020
1 parent 5e76b31 commit 13a67ff
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 23 deletions.
2 changes: 1 addition & 1 deletion imexam/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@


try:
from .xpa_wrap import XPA
from . import imexamxpa
_have_xpa = True
except ImportError:
_have_xpa = False
Expand Down
2 changes: 1 addition & 1 deletion imexam/connect.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
have_ginga = False

try:
import imexamxpa
from . import imexamxpa
have_xpa = True
from .ds9_viewer import ds9
except ImportError:
Expand Down
2 changes: 1 addition & 1 deletion imexam/ds9_viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

# The XPA class controls interaction with DS9
from .xpa_wrap import XPA
from imexamxpa import XpaException
from .imexamxpa import XpaException

from . import util
from astropy.io import fits
Expand Down
2 changes: 1 addition & 1 deletion imexam/imexam_defpars.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

com_center_pars = {"function": ["com_center",],
"delta": [10, "bounding box size"],
"oversample": [1., "oversample pixels by"],
"oversampling": [1., "oversample pixels by"],
}

# box statistics
Expand Down
8 changes: 4 additions & 4 deletions imexam/imexamine.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def __init__(self):
# save the backend that is in use for plotting reference
self._mpl_backend = get_backend().lower()

def setlog(self, filename=None, on=True, level=logging.WARNING):
def setlog(self, filename=None, on=True, level=logging.INFO):
"""Turn on and off logging to a logfile or the screen.
Parameters
Expand Down Expand Up @@ -920,7 +920,7 @@ def column_fit(self, x, y, data=None, form=None, genplot=True, fig=None):
if not genplot:
return result

def com_center(self, x, y, data=None, delta=None, oversample=1.):
def com_center(self, x, y, data=None, delta=None, oversampling=1.):
""" Return the center of mass of the object at x,y
Parameters
Expand All @@ -934,7 +934,7 @@ def com_center(self, x, y, data=None, delta=None, oversample=1.):
delta: int
The range of data values (bounding box) to use around the x,y
location for calculating the center
oversample: int
oversampling: int
Oversampling factors of pixel indices. If oversampling
is a scalar this is treated as both x and y directions
having the same oversampling factor; otherwise it is
Expand All @@ -961,7 +961,7 @@ def com_center(self, x, y, data=None, delta=None, oversample=1.):
chunk = data[yy - delta:yy + delta, xx - delta:xx + delta]

try:
xcenter, ycenter = centroid_com(chunk, oversample=oversample)
xcenter, ycenter = centroid_com(chunk, oversampling=oversampling)

pstr = f"xc={(xcenter + xx - delta):.4f}\tyc={(ycenter + yy - delta):.4f}"
except AttributeError:
Expand Down
2 changes: 0 additions & 2 deletions imexam/tests/test_imexamine.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
Make sure that the basic plots in imexamine are working as expected.
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import pytest
import numpy as np
from numpy.testing import assert_allclose, assert_equal, assert_array_equal
Expand Down
2 changes: 1 addition & 1 deletion imexam/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def display_xpa_help():

# Set up logging ability for the user
# consider making a private logging level for data retension
def set_logging(filename=None, on=True, level=logging.WARNING):
def set_logging(filename=None, on=True, level=logging.INFO):
"""Turn on or off logging to file or stdout.
Parameters
Expand Down
2 changes: 1 addition & 1 deletion imexam/xpa_wrap.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Licensed under a 3-clause BSD style license - see LICENSE.rst."""

from imexamxpa import xpa
from .imexamxpa import xpa


class XPA(xpa):
Expand Down
14 changes: 3 additions & 11 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,13 @@ def run(self):

package_data[PACKAGENAME].extend(XPA_FILES)
suffix_lib = importlib.machinery.EXTENSION_SUFFIXES[0]
package_data[PACKAGENAME].extend(XPA_LIBNAME+suffix_lib)
package_data[PACKAGENAME].append(XPA_LIBNAME+suffix_lib)

XPA_SOURCES = [os.path.join(XPALIB_DIR, c) for c in XPA_FILES]
XPALIB_DEFINES = [("HAVE_CONFIG_H", "1")]
XPA_SOURCES.append(CYTHON_SOURCE)

xpa_module = Extension(XPA_LIBNAME,
xpa_module = Extension("imexam."+XPA_LIBNAME,
sources=XPA_SOURCES,
include_dirs=[XPALIB_DIR],
define_macros=XPALIB_DEFINES,
Expand Down Expand Up @@ -254,13 +254,6 @@ def run(self):
exit(1)
install.run(self)

class MyBuildPy(build_py):
def finalize_options(self):
super().finalize_options()
self.package_data = package_data
def run(self):
build_py.run(self)


class BuildExtWithConfigure(build_ext):
"""Configure, build, and install the aXe C code."""
Expand All @@ -285,7 +278,6 @@ def run(self):

cmdclass.update({'install' : InstallWithRemake,
'clean' : my_clean,
'build_py': MyBuildPy,
'build_ext' : BuildExtWithConfigure,
})

Expand All @@ -307,6 +299,6 @@ def run(self):
zip_safe=False,
cmdclass=cmdclass,
package_data=package_data,
package_dir={'': '.'},
package_dir={'imexam': 'imexam'},
ext_modules=ext,
)

0 comments on commit 13a67ff

Please sign in to comment.