From 714afa860fea7ad268605239f9a38ccaff04752c Mon Sep 17 00:00:00 2001 From: wassname Date: Thu, 21 Jul 2016 14:20:37 +0800 Subject: [PATCH] misc fixes - 2to3 on setup.py to allow python 3 import - removed uneeded circular import in Maps.py - added missing old_div o mathutils --- SimPEG/Maps.py | 7 ------- SimPEG/Utils/matutils.py | 3 +-- setup.py | 4 ++-- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/SimPEG/Maps.py b/SimPEG/Maps.py index eeb00b21..01af7ca2 100644 --- a/SimPEG/Maps.py +++ b/SimPEG/Maps.py @@ -11,7 +11,6 @@ from . import Utils import numpy as np, scipy.sparse as sp from scipy.sparse.linalg import LinearOperator from .Tests import checkDerivative -from .PropMaps import PropMap, Property from numpy.polynomial import polynomial from scipy.interpolate import UnivariateSpline import warnings @@ -985,9 +984,3 @@ class SplineMap(IdentityMap): else : raise Exception return sp.csr_matrix(np.c_[g1,g2,g3]) - - - - - - diff --git a/SimPEG/Utils/matutils.py b/SimPEG/Utils/matutils.py index ca048b03..734c870e 100644 --- a/SimPEG/Utils/matutils.py +++ b/SimPEG/Utils/matutils.py @@ -9,6 +9,7 @@ from builtins import object import numpy as np import scipy.sparse as sp from .codeutils import isScalar +from past.utils import old_div def mkvc(x, numDims=1): """Creates a vector with the number of dimension specified @@ -472,5 +473,3 @@ class Identity(object): def __ne__(self, v):return (not (1 == v))if self._positive else (not (-1 == v)) def __ge__(self, v):return 1 >= v if self._positive else -1 >= v def __gt__(self, v):return 1 > v if self._positive else -1 > v - - diff --git a/setup.py b/setup.py index b181c40b..77b1fa6f 100644 --- a/setup.py +++ b/setup.py @@ -36,7 +36,7 @@ args = sys.argv[1:] # Make a `cleanall` rule to get rid of intermediate and library files if "cleanall" in args: - print "Deleting cython files..." + print("Deleting cython files...") # Just in case the build directory was created by accident, # note that shell=True should be OK here because the command is constant. subprocess.Popen("rm -rf build", shell=True, executable="/bin/bash") @@ -53,7 +53,7 @@ try: from Cython.Build import cythonize from Cython.Distutils import build_ext USE_CYTHON = True -except Exception, e: +except Exception as e: USE_CYTHON = False class NumpyBuild(build_ext):