make array name platform independent

This commit is contained in:
Christopher Lackner 2019-09-11 08:27:04 +02:00
parent 5288af641c
commit 59087f5c2c
2 changed files with 4 additions and 2 deletions

View File

@ -50,7 +50,9 @@ namespace ngcore
{
using TFlat = FlatArray<T, TIND>;
using TArray = Array<T, TIND>;
std::string suffix = std::string(typeid(T).name()) + "_" + typeid(TIND).name();
std::string suffix = std::string(Demangle(typeid(T).name())) + "_" + Demangle(typeid(TIND).name());
std::replace(suffix.begin(), suffix.end(), ':', '_');
std::replace(suffix.begin(), suffix.end(), ' ', '_');
std::string fname = std::string("FlatArray_") + suffix;
auto flatarray_class = py::class_<TFlat>(m, fname.c_str(),
py::buffer_protocol())

View File

@ -2,7 +2,7 @@ from pyngcore import *
from numpy import sort, array
def test_array_numpy():
a = Array_i_m(5)
a = Array_int_unsigned_long(5)
a[:] = 0
a[3:] = 2
assert(sum(a) == 4)