Aquaveo / xmsextractor

BSD 2-Clause "Simplified" License
0 stars 0 forks source link

Wrapping on set_grid_cell_scalars should check if `activity` arg is mutable #6

Closed Tsubashi closed 6 years ago

Tsubashi commented 6 years ago

Currently, the python bindings only check for an iterable, but the activity argument requires mutability as well. If you pass a non-mutable (such as tuple) it leads to bad_alloc's and segfaults.

Example:

points = ((0, 0, 0), (1, 0, 0), (1, 1, 0), (0, 1, 0));
cells = (XmUGrid.XMU_TRIANGLE, 3, 0, 1, 2, XmUGrid.XMU_TRIANGLE, 3, 2, 3, 0);
my_ugrid = XmUGrid(points, cells)
my_extractor = extractor.XmUGrid2dDataExtractor(my_ugrid)
cellScalars = [1, 2]
activity = (True, True)
my_extractor.set_grid_cell_scalars(cellScalars, activity, extractor.data_location_enum.LOC_CELLS)
Tsubashi commented 6 years ago

Just kidding. This error was actually caused by a missing xmscore package.

The conda recipe for this package should include xmscore in it's runtime dependencies.

gagelarsen commented 6 years ago

This was overlooked due to the way it was being tested. I have commited a fix and should be good now. I fixed all our packages. (xmscore, xmsinterp, xmsgrid, xmsmesh, xmsgridtrace, xmsextractor, xmsgeom) in our conda-recipe repo

Tsubashi commented 6 years ago

I think this is fixed now? Re-open if it is not.