LutzGross / esys-escript.github.io

Other
29 stars 13 forks source link

Warning: Casting complex values to real discards the imaginary part #64

Closed LutzGross closed 2 years ago

LutzGross commented 2 years ago

this message is issued in some cases when Data objects with complex values are created. it is due to an boost::python::extract on a complex numpy object. The value are still processed properly. A similar problem occurs when in the setTaggedValue method.

LutzGross commented 2 years ago

The problem was in checkForComplex in escriptcore/src/WrappedArray.cpp when accessing the float attribute of a complex numpy value. This has been fixed using the dtype.kind attribute in https://github.com/esys-escript/esys-escript.github.io/commit/8278bb39f38b8f0411afde4e0e3aec12e6fce992