from simphony.cuds.particles import Particles
from simphony.testing.utils import create_particles
from simphony.core.cuba import CUBA
from simphony.visualisation import mayavi_tools
particles = create_particles() # restrict=[CUBA.LATTICE_VECTORS])
cuds = Particles("test")
cuds.add_particles(particles)
mayavi_tools.show(cuds)
That is because in cuba_data_accumulator.load_onto_vtk:
default = dummy_cuba_value(cuba) # cuba = CUBA.LATTICE_VECTORS for this bug
...
elif isinstance(default, numpy.ndarray) and len(default) == 3:
# do stuff for vector values
shape of LATTICE_VECTORS is [3, 3], default is a 3x3 array and so len(default) == 3 and it is mistaken as a vector.
This will give AssertionError in tvtk
That is because in
cuba_data_accumulator.load_onto_vtk
:shape of LATTICE_VECTORS is [3, 3],
default
is a 3x3 array and solen(default) == 3
and it is mistaken as a vector.