flatsurf / e-antic

Embedded algebraic number fields
https://flatsurf.github.io/e-antic/libeantic/
GNU Lesser General Public License v3.0
12 stars 11 forks source link

Make eantic::renf_elem_class work from Python #212

Open saraedum opened 2 years ago

saraedum commented 2 years ago

Currently, cppyy.gbl.eantic.renf_elem_class is not functional when called from Python. (See e.g. the special handling of e-antic in flatsurf's surfaces.py.)

At the moment, we work around this problem by exposing a factory function renf_elem that creates a renf_elem_class. However, this has limitations, e.g., when the type is coming from elsewhere say when it is flatsurf::Vector<eantic::renf_elem_class>::Coordinate.

It would be great if we could wrap the actual constructor of renf_elem_class instead so that the type can be used transparently.


Dependencies

saraedum commented 2 years ago

While the constructor can now be called without crashing, we are still seeing the wrong output sometimes; essentially due to https://github.com/wlav/cppyy/issues/92 when calling with SageMath objects such as Rational.