Skip to content

Commit cc4dd4c

Browse files
committed
Use proper relative imports
1 parent c239a95 commit cc4dd4c

File tree

5 files changed

+18
-25
lines changed

5 files changed

+18
-25
lines changed

eqtools/__init__.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@
2222
__version__ = '1.4.0'
2323

2424
from .core import *
25-
from .EFIT import *
26-
from .CModEFIT import *
27-
from .AUGData import *
28-
from .NSTXEFIT import *
29-
from .D3DEFIT import *
30-
from .eqdskreader import *
31-
from .pfilereader import *
32-
from .FromArrays import *
33-
from .TCVLIUQE import *
25+
# from .EFIT import *
26+
# from .CModEFIT import *
27+
# from .AUGData import *
28+
# from .NSTXEFIT import *
29+
# from .D3DEFIT import *
30+
# from .eqdskreader import *
31+
# from .pfilereader import *
32+
# from .FromArrays import *
33+
# from .TCVLIUQE import *

eqtools/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class ModuleWarning(Warning):
4242

4343

4444
try:
45-
import trispline
45+
from . import trispline
4646
_has_trispline = True
4747
except ImportError:
4848
warnings.warn("trispline module could not be loaded -- tricubic spline "

eqtools/filewriter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
import core
2424
import matplotlib.pyplot as plt
2525
try:
26-
import trispline
26+
from . import trispline
2727
_has_trispline = True
2828
except ImportError:
2929
warnings.warn("trispline module could not be loaded -- tricubic spline "

eqtools/trispline.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
import scipy
2626
import scipy.interpolate
2727
try:
28-
import _tricub
28+
from . import _tricub
2929
except Exception:
3030
# Won't be able to use actual trispline, but still can use other routines.
3131
pass

setup.py

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,19 @@
1-
try:
2-
from numpy.distutils.core import setup, Extension
3-
except ImportError:
4-
import warnings
5-
warnings.warn("numpy not installed, defaulting to setuptools.")
6-
try:
7-
from setuptools import setup, Extension
8-
except ImportError:
9-
warnings.warn("setuptools not installed, defaulting to distutils.")
10-
from distutils.core import setup, Extension
1+
from numpy.distutils.core import setup, Extension
112

12-
tricub = Extension('eqtools._tricub',['eqtools/_tricub.pyf','eqtools/_tricub.c'])
3+
tricub = Extension(
4+
'eqtools._tricub', ['eqtools/_tricub.pyf', 'eqtools/_tricub.c']
5+
)
136

147
setup(
158
name='eqtools',
169
version='1.4.0',
17-
packages=['eqtools',],
10+
packages=['eqtools'],
1811
install_requires=['scipy', 'numpy', 'matplotlib'],
1912
author=['Mark Chilenski', 'Ian Faust', 'John Walk'],
2013
author_email='psfcplasmatools@mit.edu',
2114
url='https://github.com/PSFCPlasmaTools/eqtools/',
2215
description='Python tools for magnetic equilibria in tokamak plasmas',
2316
long_description=open('README.md', 'r').read(),
24-
ext_modules=[tricub,],
17+
ext_modules=[tricub],
2518
license='GPL'
2619
)

0 commit comments

Comments
 (0)