diff --git a/wafo/demos.py b/wafo/demos.py index 417dbdb..14ad6dd 100644 --- a/wafo/demos.py +++ b/wafo/demos.py @@ -101,9 +101,9 @@ def peaks(x=None, y=None, n=51): [x1, y1] = meshgrid(x, y) - z = (3 * (1 - x1) ** 2 * exp(-(x1 ** 2) - (y1 + 1) ** 2) - - 10 * (x1 / 5 - x1 ** 3 - y1 ** 5) * exp(-x1 ** 2 - y1 ** 2) - - 1. / 3 * exp(-(x1 + 1) ** 2 - y1 ** 2)) + z = (3 * (1 - x1) ** 2 * exp(-(x1 ** 2) - (y1 + 1) ** 2) - + 10 * (x1 / 5 - x1 ** 3 - y1 ** 5) * exp(-x1 ** 2 - y1 ** 2) - + 1. / 3 * exp(-(x1 + 1) ** 2 - y1 ** 2)) return x1, y1, z diff --git a/wafo/magic.py b/wafo/magic.py deleted file mode 100644 index 0ee6c87..0000000 --- a/wafo/magic.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -""" -Created on Tue Apr 17 13:59:12 2012 - -@author: pab -""" -import numpy as np - - -def magic(n): - ix = np.arange(n) + 1 - J, I = np.meshgrid(ix, ix) - A = np.mod(I + J - (n + 3) / 2, n) - B = np.mod(I + 2 * J - 2, n) - M = n * A + B + 1 - return M diff --git a/wafo/spectrum/core.py b/wafo/spectrum/core.py index 119f9e9..dac4170 100644 --- a/wafo/spectrum/core.py +++ b/wafo/spectrum/core.py @@ -1,4 +1,4 @@ -from __future__ import division +from __future__ import absolute_import, division from wafo.misc import meshgrid, gravity, cart2polar, polar2cart from wafo.objects import TimeSeries, mat2timeseries import warnings @@ -15,35 +15,35 @@ from scipy.integrate import simps, trapz from scipy.special import erf from scipy.linalg import toeplitz import scipy.interpolate as interpolate -from wafo.interpolate import stineman_interp +from ..interpolate import stineman_interp -from wafo.wave_theory.dispersion_relation import w2k # , k2w -from wafo.containers import PlotData, now +from ..wave_theory.dispersion_relation import w2k # , k2w +from ..containers import PlotData, now # , tranproc -from wafo.misc import sub_dict_select, nextpow2, discretize, JITImport +from ..misc import sub_dict_select, nextpow2, discretize, JITImport # from wafo.graphutil import cltext -from wafo.kdetools import qlevels +from ..kdetools import qlevels from scipy.interpolate.interpolate import interp1d try: - from wafo.gaussian import Rind + from ..gaussian import Rind except ImportError: Rind = None try: - from wafo import c_library + from .. import c_library except ImportError: warnings.warn('Compile the c_library.pyd again!') c_library = None try: - from wafo import cov2mod + from .. import cov2mod except ImportError: warnings.warn('Compile the cov2mod.pyd again!') cov2mod = None # from wafo.transform import TrData -from wafo.transform.models import TrLinear -from wafo.plotbackend import plotbackend +from ..transform.models import TrLinear +from ..plotbackend import plotbackend # Trick to avoid error due to circular import