You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
UnitCell.GetLatticePar() without index fails on nanobind_migration_test #127
frompyobjcryst.crystalimportCrystalc=Crystal(4.76, 4.76, 12.99, "R-3c")
print(c.GetLatticePar(0)) # 4.76print(c.GetLatticePar()) # main: array of 6 values; nanobind branch: TypeError# TypeError: Unable to convert function return value to a Python type!# GetLatticePar(self) -> CrystVector<double>
On main, GetLatticePar() returns numpy array of 6 lattice params through the globally used CrystVector_REAL_to_ndarray converter.
On the nanobind branch, nb_unitcell.cpp:95 binds the overload directly, and since there's no converter for CrystVector<double>, the conversion fails. Claude suggests wrapping it in crystvec_to_array to fix it.
All existing tests call GetLatticePar(index) so didn't catch this regression. Other methods returning CrystVector might have the same problem.
I'm happy to, but I didn't so far because tbh my knowledge of nanobind is limited to what Claude tells me, so I was waiting for your opinion on it 😬 I'll propose a PR and we can discuss there
Activity
sbillinge commentedon Nov 12, 2026
thanks @clemisch
vincefn commentedon Nov 13, 2026
@clemisch can you propose a PR for this ?
clemisch commentedon Nov 13, 2026
I'm happy to, but I didn't so far because tbh my knowledge of nanobind is limited to what Claude tells me, so I was waiting for your opinion on it 😬 I'll propose a PR and we can discuss there
*see #128