custom conversion in ri2py no longer used implicitly

Issue #263 resolved
Laurent Gautier created an issue

I have been looking (again) at the conversion system, and I am thinking that the implicit implementation of ri2py (from rinterface-level to python-non-rpy2) should just be a composition of ri2ro and ro2py.

This would mean that ri2py can no longer be customized that only ri2ro and ro2py remain: rinterface <-> robjects <-> python (non-rpy2)

A possible issue with that is the computing cost, particularly in the direction py -> ri, but that could be solved by keeping the direct conversion ri2py currently implemented available for explicit use. For example:

# pythonobject will be converted first to the robject level, then to the rinterface level
result = myrpackage.somefunction(pythonobject)

# convert directly to py2ri if such a conversion is defined
result = myrpackage.somefunction(conversion.py2ri(pythonobject))

What is annoying me with that is the fact py2ro(ro2ri)(x) and py2ri(x) are then not guaranteed to be equal. This problem would also be present if a conversion system involving several possible conversion paths was going to be used.

Comments (3)

  1. Log in to comment