remove references to Numeric module. we only support numpy.
This commit is contained in:
@ -189,12 +189,7 @@ import sys, re, glob, types
|
|||||||
from os import popen
|
from os import popen
|
||||||
from math import * # any function could be used by set()
|
from math import * # any function could be used by set()
|
||||||
|
|
||||||
try:
|
import numpy as np
|
||||||
import numpy as np
|
|
||||||
oldnumeric = False
|
|
||||||
except:
|
|
||||||
import Numeric as np
|
|
||||||
oldnumeric = True
|
|
||||||
|
|
||||||
try: from DEFAULTS import PIZZA_GUNZIP
|
try: from DEFAULTS import PIZZA_GUNZIP
|
||||||
except: PIZZA_GUNZIP = "gunzip"
|
except: PIZZA_GUNZIP = "gunzip"
|
||||||
@ -379,9 +374,6 @@ class dump:
|
|||||||
for i in range(1,snap.natoms):
|
for i in range(1,snap.natoms):
|
||||||
words += f.readline().decode().split()
|
words += f.readline().decode().split()
|
||||||
floats = map(float,words)
|
floats = map(float,words)
|
||||||
if oldnumeric:
|
|
||||||
atom_data = np.array(list(floats),np.Float)
|
|
||||||
else:
|
|
||||||
atom_data = np.array(list(floats),np.float)
|
atom_data = np.array(list(floats),np.float)
|
||||||
|
|
||||||
snap.atoms = atom_data.reshape((snap.natoms, ncol))
|
snap.atoms = atom_data.reshape((snap.natoms, ncol))
|
||||||
@ -858,8 +850,7 @@ class dump:
|
|||||||
self.map(ncol+1,str)
|
self.map(ncol+1,str)
|
||||||
for snap in self.snaps:
|
for snap in self.snaps:
|
||||||
atoms = snap.atoms
|
atoms = snap.atoms
|
||||||
if oldnumeric: newatoms = np.zeros((snap.natoms,ncol+1),np.Float)
|
newatoms = np.zeros((snap.natoms,ncol+1),np.float)
|
||||||
else: newatoms = np.zeros((snap.natoms,ncol+1),np.float)
|
|
||||||
newatoms[:,0:ncol] = snap.atoms
|
newatoms[:,0:ncol] = snap.atoms
|
||||||
snap.atoms = newatoms
|
snap.atoms = newatoms
|
||||||
|
|
||||||
@ -1018,8 +1009,7 @@ class dump:
|
|||||||
|
|
||||||
# convert values to int and absolute value since can be negative types
|
# convert values to int and absolute value since can be negative types
|
||||||
|
|
||||||
if oldnumeric: bondlist = np.zeros((nbonds,4),np.Int)
|
bondlist = np.zeros((nbonds,4),np.int)
|
||||||
else: bondlist = np.zeros((nbonds,4),np.int)
|
|
||||||
ints = [abs(int(value)) for value in words]
|
ints = [abs(int(value)) for value in words]
|
||||||
start = 0
|
start = 0
|
||||||
stop = 4
|
stop = 4
|
||||||
|
|||||||
Reference in New Issue
Block a user