libena 0.4.18-dev.9021
QE C++ library
Loading...
Searching...
No Matches
nanobind.hpp File Reference

Plain-data packers for libena results in nanobind (Python) bindings. More...

#include <libqe/bind/nanobind.hpp>
#include <libena/rotation.hpp>
#include <libena/positions.hpp>
#include <libena/ccd.hpp>

Go to the source code of this file.

Namespaces

namespace  qe
 
namespace  qe::bind
 
namespace  qe::bind::py
 

Functions

inline ::nanobind::dict qe::bind::py::to_dict (const qe::NodePositions &r)
 {nodes, centroids, weights, points}
 
inline ::nanobind::dict qe::bind::py::to_dict (const qe::MovedNodes &r)
 {nodes, centroids}
 
inline ::nanobind::dict qe::bind::py::to_dict (const qe::RotationResult &r)
 {rotation, eigenvalues, column_names (list of str)}
 
inline ::nanobind::dict qe::bind::py::to_dict (const qe::CCDResult &r)
 

Detailed Description

Plain-data packers for libena results in nanobind (Python) bindings.

Results cross the boundary as dicts of numpy arrays, not registered nanobind classes, so extension modules built by different products (qe-ena, a future qe-tma, ...) can be loaded together without type-registration clashes. Python-side result classes (ena.libena.NodePositions, MovedNodes, RotationResult) wrap the dicts to keep attribute access.

Requires nanobind; never included by libena.hpp. Array conversion comes from libqe/bind/nanobind.hpp.