~daniele-bigoni/spectraltoolbox/hotfixes

« back to all changes in this revision

Viewing changes to SpectralToolbox/SpectralND.py

  • Committer: Daniele Bigoni
  • Date: 2016-03-01 14:09:59 UTC
  • mfrom: (34.2.12 spectraltoolbox)
  • Revision ID: dabi@limitcycle.it-20160301140959-tqwcxvmda5auij5i
merged from trunk. v0.2.13

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
import numpy as np
36
36
from scipy.misc import comb
37
37
 
38
 
import Spectral1D
 
38
import SpectralToolbox.Spectral1D
39
39
 
40
40
def MultiIndex(d,N):
41
41
    """
141
141
        warningMem = 100.0
142
142
        
143
143
        if self.DIM != len(Ns) :
144
 
            print "The number of elements in Ns is not consistent"
 
144
            print("The number of elements in Ns is not consistent")
145
145
            return
146
146
 
147
147
        if quadTypes == None:
148
148
            quadTypes = [Spectral1D.GAUSS for i in range(self.DIM)]
149
149
 
150
150
        if self.DIM != len(quadTypes):
151
 
            print "The number of elements in quadTypes is not consistent"
 
151
            print("The number of elements in quadTypes is not consistent")
152
152
            return
153
153
        
154
154
        #######################
213
213
        warningMem = 100.0
214
214
        
215
215
        if self.DIM != len(Ns) :
216
 
            print "The number of elements in Ns is not consistent"
 
216
            print("The number of elements in Ns is not consistent")
217
217
            return
218
218
 
219
219
        #######################
278
278
        warningMem = 100.0
279
279
        
280
280
        if self.DIM != len(Ns) :
281
 
            print "The number of elements in Ns is not consistent"
 
281
            print("The number of elements in Ns is not consistent")
282
282
            return
283
283
        
284
284
        #######################
352
352
        
353
353
        if usekron:
354
354
            if (self.DIM != len(rs) or self.DIM != len(Ns) or self.DIM != len(ks) or self.DIM != len(norms)) :
355
 
                print "The number of elements in rs, Ns, ks and norms is not consistent"
 
355
                print("The number of elements in rs, Ns, ks and norms is not consistent")
356
356
                return
357
357
        else:
358
358
            if ( not (type(rs) == np.ndarray and rs.shape[1] == self.DIM) or self.DIM != len(Ns) or self.DIM != len(ks) or self.DIM != len(norms)) :
359
 
                print "The number of elements in rs, Ns, ks and norms is not consistent"
 
359
                print("The number of elements in rs, Ns, ks and norms is not consistent")
360
360
                return
361
361
                
362
362
        #######################
440
440
        
441
441
        if usekron:
442
442
            if (self.DIM != len(rs) or self.DIM != len(ks) or self.DIM != len(norms)) :
443
 
                print "The number of elements in rs, ks and norms is not consistent"
 
443
                print("The number of elements in rs, ks and norms is not consistent")
444
444
                return
445
445
        else:
446
446
            if ( not (type(rs) == np.ndarray and rs.shape[1] == self.DIM) or self.DIM != len(ks) or self.DIM != len(norms)) :
447
 
                print "The number of elements in rs, ks and norms is not consistent"
 
447
                print("The number of elements in rs, ks and norms is not consistent")
448
448
                return
449
449
        
450
450
        #######################