Skip to content
Snippets Groups Projects
Commit f36cd9ed authored by Boman Romain's avatar Boman Romain
Browse files

fix py3 compatibility

parent 67aa67bb
No related branches found
No related tags found
2 merge requests!49Add CI with python 3 including trilinos,!48Futurize for python2/3
Pipeline #522 passed
......@@ -229,10 +229,11 @@ def main():
slv.start()
from fwk.testing import *
tests = CTests()
tests.add(CTest('faked measure', 0, 0))
tests.run()
# [RB] this code is useless
#import fwk.testing as tst
#tests = tst.CTests()
#tests.add(tst.CTest('faked measure', 0, 0))
#tests.run()
if __name__ == "__main__":
main()
......@@ -142,17 +142,22 @@ def extract(msh, tag_name, DOFperNode, which_pos, which_dof, ensemble_size, name
i = 1
while i < len(nodes):
if nodes[i] == nodes[i-1]:
nodes = np.delete(nodes, i)
nodes = np.delete(nodes, i) # [RB] converts nodes(int) to nodes(numpyint64)!
else:
i = i + 1
#print nodes
# [RB] sorting nodes and/or removing duplicates can be performed
# in python with a line such as "nodes = list(set(nodes))"
# By doing it this way, numpy is avoided (and the introduction
# of numpy 64bits integers which should be casted back to int later)
x = np.empty(np.shape(nodes))
x_sorted = np.empty(np.shape(nodes))
nodes_sorted = np.empty(np.shape(nodes))
sol = np.empty([len(nodes), ensemble_size])
for i in range(0,len(x)):
pos = msh.nodes[nodes[i]-1].pos
pos = msh.nodes[int(nodes[i])-1].pos
x[i] = pos.x[which_pos]
#print x
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment