Proxy python classes should be removed

Bug #400987 reported by Václav Šmilauer
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Yade
Fix Released
Wishlist
Václav Šmilauer

Bug Description

Since r1875, python no longer depends on serialization, therefore doesn't have to instantiate Archive for every class. This makes py* classes (pyBody, pyInteraction, ...) redundant, as we can wrap directly Body, Interaction etc using boost::python. This will give additional advantage of automatic conversions from shared_ptr<Body> to python's Body class, probably also increasing performance. Python interface will not change.

Currently, doing

 s=utils.sphere([0,0,0],1)
 s['interactingGeometry']

 TypeError: No to_python (by-value) converter found for C++ type: boost::shared_ptr<InteractingGeometry>

and the b.mold shorthand (which wraps shared_ptr<InteractingGeometry> within pyInteractingGeometry) must be called, which can be confusing, since the attribute is accessible. Calling s.dict() results in the same problem. That should be fixed.

Changed in yade:
assignee: nobody → Václav Šmilauer (eudoxos)
importance: Undecided → Wishlist
status: New → Confirmed
Revision history for this message
Václav Šmilauer (eudoxos) wrote :

All special methods can be wrapped using pointers to non-member functions (defined separately) taking the class instance as the first argument, instead of using pointers to member functions of the wrapper classes which don't directly wrap a proxee method.

Revision history for this message
Václav Šmilauer (eudoxos) wrote :

Done in r1888 and later. Only classes that need wrapper have it (BodyContainer, InteractionContainer, BexContainer and a few other). This simplified the code a lot.

Changed in yade:
milestone: none → 0.20-0
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.