Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__pycache__
9 changes: 3 additions & 6 deletions src/bdump.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,9 @@
# atoms[i][j] = 2d array of floats, i = 0 to natoms-1, j = 0 to ncols-1

try:
import numpy as np
oldnumeric = False
import numpy as np
except:
import Numeric as np
oldnumeric = True
raise Exception("no numpy Python module available")

try: from DEFAULTS import PIZZA_GUNZIP
except: PIZZA_GUNZIP = "gunzip"
Expand Down Expand Up @@ -188,8 +186,7 @@ def read_snapshot(self,f):
for i in range(1,snap.natoms):
words += f.readline().split()
floats = list(map(float,words))
if oldnumeric: atoms = np.zeros((snap.natoms,ncol),np.Float)
else: atoms = np.zeros((snap.natoms,ncol),np.float)
atoms = np.zeros((snap.natoms,ncol),float)
start = 0
stop = ncol
for i in range(snap.natoms):
Expand Down
10 changes: 3 additions & 7 deletions src/dump.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,8 @@

try:
import numpy as np
oldnumeric = False
except:
import Numeric as np
oldnumeric = True
raise Exception("no numpy Python module available")

try: from DEFAULTS import PIZZA_GUNZIP
except: PIZZA_GUNZIP = "gunzip"
Expand Down Expand Up @@ -418,8 +416,7 @@ def read_snapshot(self,f):
for i in range(1,snap.natoms):
words += f.readline().split()
floats = list(map(float,words))
if oldnumeric: atoms = np.zeros((snap.natoms,ncol),np.Float)
else: atoms = np.zeros((snap.natoms,ncol),np.float)
atoms = np.zeros((snap.natoms,ncol),float)
start = 0
stop = ncol
for i in range(snap.natoms):
Expand Down Expand Up @@ -887,8 +884,7 @@ def newcolumn(self,str):
self.map(ncol+1,str)
for snap in self.snaps:
atoms = snap.atoms
if oldnumeric: newatoms = np.zeros((snap.natoms,ncol+1),np.Float)
else: newatoms = np.zeros((snap.natoms,ncol+1),np.float)
newatoms = np.zeros((snap.natoms,ncol+1),float)
newatoms[:,0:ncol] = snap.atoms
snap.atoms = newatoms

Expand Down
9 changes: 3 additions & 6 deletions src/ldump.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,9 @@
# atoms[i][j] = 2d array of floats, i = 0 to natoms-1, j = 0 to ncols-1

try:
import numpy as np
oldnumeric = False
import numpy as np
except:
import Numeric as np
oldnumeric = True
raise Exception("no numpy Python module available")

try: from DEFAULTS import PIZZA_GUNZIP
except: PIZZA_GUNZIP = "gunzip"
Expand Down Expand Up @@ -202,8 +200,7 @@ def read_snapshot(self,f):
for i in range(1,snap.natoms):
words += f.readline().split()
floats = list(map(float,words))
if oldnumeric: atoms = np.zeros((snap.natoms,ncol),np.Float)
else: atoms = np.zeros((snap.natoms,ncol),np.float)
atoms = np.zeros((snap.natoms,ncol),float)
start = 0
stop = ncol
for i in range(snap.natoms):
Expand Down
9 changes: 3 additions & 6 deletions src/mdump.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,9 @@
# evalues[i][j] = 2d array of floats, i = 0 to Nel-1, j = 0 to Ncol

try:
import numpy as np
oldnumeric = False
import numpy as np
except:
import Numeric as np
oldnumeric = True
raise Exception("no numpy Python module available")

try: from DEFAULTS import PIZZA_GUNZIP
except: PIZZA_GUNZIP = "gunzip"
Expand Down Expand Up @@ -318,8 +316,7 @@ def read_snapshot(self,f):
for i in range(1,n):
words += f.readline().split()
floats = list(map(float,words))
if oldnumeric: values = np.zeros((n,ncol),np.Float)
else: values = np.zeros((n,ncol),np.float)
values = np.zeros((n,ncol),float)
start = 0
stop = ncol
for i in range(n):
Expand Down
9 changes: 3 additions & 6 deletions src/tdump.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,9 @@
# atoms[i][j] = 2d array of floats, i = 0 to natoms-1, j = 0 to ncols-1

try:
import numpy as np
oldnumeric = False
import numpy as np
except:
import Numeric as np
oldnumeric = True
raise Exception("no numpy Python module available")

try: from DEFAULTS import PIZZA_GUNZIP
except: PIZZA_GUNZIP = "gunzip"
Expand Down Expand Up @@ -203,8 +201,7 @@ def read_snapshot(self,f):
for i in range(1,snap.natoms):
words += f.readline().split()
floats = list(map(float,words))
if oldnumeric: atoms = np.zeros((snap.natoms,ncol),np.Float)
else: atoms = np.zeros((snap.natoms,ncol),np.float)
atoms = np.zeros((snap.natoms,ncol),float)
start = 0
stop = ncol
for i in range(snap.natoms):
Expand Down
6 changes: 4 additions & 2 deletions src/vtk.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,8 @@ def particleGran(file,atoms,names,n_values):
continue

vectortype = 'float'
if atoms != []:
#if atoms != []:
if atoms.size > 0:
vectortype = typestr(atoms[0][vectors[key]])
if 'float' in vectortype: vectortype = 'float'
elif 'int' in vectortype: vectortype = 'int'
Expand All @@ -361,7 +362,8 @@ def particleGran(file,atoms,names,n_values):
# print SCALARS
for key in scalars.keys():
scalartype =''
if atoms != []:
#if atoms != []:
if atoms.size > 0:
scalartype = typestr(atoms[0][scalars[key]])
if 'float' in scalartype: scalartype = 'float'
elif 'int' in scalartype: scalartype = 'int'
Expand Down