videlec / pypolymake

Python wrappers for polymake
https://pypi.python.org/pypi/pypolymake
3 stars 5 forks source link

some properties works in polymake but raise errors in pypolymake #14

Open videlec opened 7 years ago

videlec commented 7 years ago

In a polymake console

polytope > $p = cube(3)
polytope > print $p->CONNECTIVITY;
3
polytope > print $p->N_EDGES;
12

whereas in pypolymake

sage: import polymake
sage: p = polymake.cube(3)
sage: p.CONNECTIVITY
ValueError                                Traceback (most recent call last)
...
ValueError: unknown property Polytope<Rational>::CONNECTIVITY at /opt/sage/local/share/polymake/perllib/Polymake/Core/ObjectType.pm line 464.
Polymake::Core::ObjectType::encode_property_list(Polymake::Core::ObjectType=ARRAY(0x8a341c8), "CONNECTIVITY", Polymake::polytope::Polytope__Rational=ARRAY(0x987a858)) called at /opt/sage/local/share/polymake/perllib/Polymake/Core/ObjectType.pm line 476
        Polymake::Core::ObjectType::encode_read_request(Polymake::Core::ObjectType=ARRAY(0x8a341c8), "CONNECTIVITY", Polymake::polytope::Polytope__Rational=ARRAY(0x987a858)) called at /opt/sage/local/share/polymake/perllib/Polymake/Core/Object.pm line 1470
    Polymake::Core::Object::give_pv called at /opt/sage/local/share/polymake/perllib/Polymake/Core/Object.pm line 1492
    Polymake::Core::Object::give(Polymake::polytope::Polytope__Rational=ARRAY(0x987a858), "CONNECTIVITY") called at ../../../lib/callable/src/perl/Main.cc line 0
    eval {...} called at ../../../lib/callable/src/perl/Main.cc line 0
videlec commented 7 years ago

This is somehow fixed in the beta version

>>> import polymake
>>> p = polymake.cube(3)
>>> p._get_property(b"CONNECTIVITY", b"Int")
>>> 3