Added absolute_import

pep c_functions.c
master
Per A Brodtkorb 9 years ago
parent 0fd326937f
commit cd7b75b184

@ -1,7 +1,6 @@
""" """
Covariance package in WAFO Toolbox. Covariance package in WAFO Toolbox.
""" """
from __future__ import absolute_import
from core import * # CovData1D from .core import * # CovData1D
#import models from . import estimation
import estimation

@ -1,3 +1,3 @@
from __future__ import absolute_import
from info import __doc__ from .info import __doc__
from info import * from .info import *

@ -15,7 +15,7 @@
void findrfc(double *y1,double hmin, int *ind, int n,int *info) { void findrfc(double *y1,double hmin, int *ind, int n,int *info) {
double xminus,xplus,Tpl,Tmi,*y,Tstart; double xminus,xplus,Tpl,Tmi,*y,Tstart;
int i,j,ix=0,NC,iy; int i,j,ix=0,NC;
info[0] = 0; info[0] = 0;
if (*(y1+0)> *(y1+1)){ if (*(y1+0)> *(y1+1)){
/* if first is a max , ignore the first max*/ /* if first is a max , ignore the first max*/
@ -87,7 +87,6 @@ void findrfc(double *y1,double hmin, int *ind, int n,int *info) {
ix++; ix++;
*(ind+ix)=(Tstart+2*i+1); *(ind+ix)=(Tstart+2*i+1);
ix++; ix++;
} /*if*/ } /*if*/
goto L180; goto L180;
L170: L170:
@ -109,7 +108,6 @@ void findrfc(double *y1,double hmin, int *ind, int n,int *info) {
} /*if*/ } /*if*/
} /*elseif*/ } /*elseif*/
L180: L180:
iy=i;
} /* for i */ } /* for i */
info[0] = ix; info[0] = ix;
return ; return ;

@ -4,8 +4,7 @@ Spectrum package in WAFO Toolbox.
Readme - Readme file for module SPEC in WAFO Toolbox Readme - Readme file for module SPEC in WAFO Toolbox
""" """
from __future__ import absolute_import
from core import * from .core import *
#SpecData1D, SpecData2D, cltext from . import models
import models
from wafo.wave_theory import dispersion_relation from wafo.wave_theory import dispersion_relation

@ -2,6 +2,7 @@
Transform package in WAFO Toolbox. Transform package in WAFO Toolbox.
""" """
from __future__ import absolute_import
from .core import * from .core import *
from . import models from . import models
from . import estimation from . import estimation

@ -6,13 +6,13 @@ TrOchi
TrLinear TrLinear
''' '''
# !/usr/bin/env python # !/usr/bin/env python
from __future__ import division from __future__ import division, absolute_import
from scipy.optimize import brentq # @UnresolvedImport from scipy.optimize import brentq # @UnresolvedImport
from numpy import (sqrt, atleast_1d, abs, imag, sign, where, cos, arccos, ceil, from numpy import (sqrt, atleast_1d, abs, imag, sign, where, cos, arccos, ceil,
expm1, log1p, pi) expm1, log1p, pi)
import numpy as np import numpy as np
import warnings import warnings
from core import TrCommon, TrData from .core import TrCommon, TrData
__all__ = ['TrHermite', 'TrLinear', 'TrOchi'] __all__ = ['TrHermite', 'TrLinear', 'TrOchi']
_example = ''' _example = '''
@ -453,10 +453,11 @@ class TrOchi(TrCommon2):
# g1='[x(2)-2.*x(1).^2.*x(2).^2-P1, # g1='[x(2)-2.*x(1).^2.*x(2).^2-P1,
# 2.*x(1).*x(2).^2.*(3-8.*x(1).^2.*x(2))-P2 ]' # 2.*x(1).*x(2).^2.*(3-8.*x(1).^2.*x(2))-P2 ]'
# Or solve the following 1D non-linear equation for sig2^2: # Or solve the following 1D non-linear equation for sig2^2:
g2 = lambda x: -sqrt(abs(x - 1) * 2) * \ def g2(x):
(3. * x - 4 * abs(x - 1)) + abs(skew) return (-sqrt(abs(x - 1) * 2) * (3. * x - 4 * abs(x - 1)) +
abs(skew))
a1 = 1. # % Start interval where sig2^2 is located. a1 = 1. # Start interval where sig2^2 is located.
a2 = 2. a2 = 2.
sig22 = brentq(g2, a1, a2) # % smallest solution for sig22 sig22 = brentq(g2, a1, a2) # % smallest solution for sig22

Loading…
Cancel
Save