Skip to content

Commit

Permalink
Fix NLTE InputDeparture Coefficients
Browse files Browse the repository at this point in the history
  • Loading branch information
AWehrhahn committed Apr 19, 2022
1 parent 3f6c4a5 commit 0a6badd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/pysme/nlte.py
Original file line number Diff line number Diff line change
Expand Up @@ -1065,7 +1065,7 @@ def update_coefficients(self, sme, dll, lfs_nlte):
# loop through the list of relevant _lines_, substitute both their levels into the main b matrix
# Make sure both levels have corrections available
if lr[0] != -1 and lr[1] != -1:
dll.InputDepartureCoefficients(bmat[:, lr].T, li)
dll.InputDepartureCoefficients(bmat[:, lr], li)

for elem in marked_for_removal:
self.remove_nlte(elem)
Expand Down
8 changes: 4 additions & 4 deletions src/pysme/smelib/_smelib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -637,16 +637,16 @@ static PyObject *smelib_InputDepartureCoefficients(PyObject *self, PyObject *arg
PyErr_SetString(PyExc_ValueError, "Expected bmatrix with ndim == 2");
return NULL;
}
if (PyArray_DIM(bmatrix_arr, 0) != 2)
if (PyArray_DIM(bmatrix_arr, 1) != 2)
{
Py_XDECREF(bmatrix_arr);
PyErr_SetString(PyExc_ValueError, "Expected bmatrix with shape (2, nrhox)");
PyErr_SetString(PyExc_ValueError, "Expected bmatrix with shape (nrhox, 2)");
return NULL;
}
if (PyArray_DIM(bmatrix_arr, 1) != nrhox)
if (PyArray_DIM(bmatrix_arr, 0) != nrhox)
{
Py_XDECREF(bmatrix_arr);
PyErr_SetString(PyExc_ValueError, "Expected bmatrix with shape (2, nrhox)");
PyErr_SetString(PyExc_ValueError, "Expected bmatrix with shape (nrhox, 2)");
return NULL;
}

Expand Down

0 comments on commit 0a6badd

Please sign in to comment.