Fix some weird newly appearing errors.

module_devel/scatsystem.ipynb however still crashes


Former-commit-id: b5385a90a9a94d21e07a46eed4f5386cb5fef12f
This commit is contained in:
Marek Nečada 2019-07-15 18:11:50 +03:00
parent ee86a20fd2
commit 110723d4b1
1 changed files with 2 additions and 1 deletions

View File

@ -1,4 +1,5 @@
"""@package qpms_c
self.s.norm = <qpms_normalisation_t>(QPMS_NORMALISATION_NORM_POWER | QPMS_NORMALISATION_CSPHASE)
Cythonized parts of QPMS; mostly wrappers over the C data structures
to make them available in Python.
"""
@ -1184,7 +1185,7 @@ cdef class CTMatrix: # N.B. there is another type called TMatrix in tmatrices.py
def __cinit__(CTMatrix self, BaseSpec spec, matrix):
self.spec = spec
self.t.spec = self.spec.rawpointer();
if matrix is None or matrix == 0:
if (matrix is None) or not np.any(matrix):
self.m = np.zeros((len(spec),len(spec)), dtype=complex, order='C')
else:
# The following will raise an exception if shape is wrong