Opened 4 years ago

Closed 17 months ago

#26368 closed enhancement (fixed)

Setting up a Polyhedron from both Vrep and Hrep - for backend='polymake'

Reported by: Matthias Köppe Owned by:
Priority: major Milestone: sage-9.4
Component: geometry Keywords:
Cc: Jean-Philippe Labbé, Simon King, gh-kliem, Vincent Delecroix Merged in:
Authors: Jonathan Kliem Reviewers: Matthias Koeppe
Report Upstream: N/A Work issues:
Branch: 82020ef (Commits, GitHub, GitLab) Commit: 82020efc61c10fbd585d09a75e0febb6c9be5b17
Dependencies: #27745, #31864 Stopgaps:

Status badges

Description (last modified by gh-kliem)

Follow-up from #22701, where this was implemented for 'field'.

Before (with #31864):

sage: %time P = polytopes.hypercube(12, backend='polymake')                                                                                                                                                                                                                                                                                                                
CPU times: user 1.87 s, sys: 51.3 ms, total: 1.93 s
Wall time: 1.92 s
sage: %time P = polytopes.hypercube(12, backend='polymake')                                                                                                                                                                                                                                                                                                                
CPU times: user 463 ms, sys: 0 ns, total: 463 ms
Wall time: 462 ms
sage: %time P = polytopes.permutahedron(8, backend='polymake')                                                                                                                                                                                                                                                                                                             
CPU times: user 1min 33s, sys: 79.8 ms, total: 1min 33s
Wall time: 1min 33s
sage: P = polytopes.hypercube(5, backend='polymake')                                                                                                                                                                                                                                                                                                                       
sage: Q = polytopes.cross_polytope(5, backend='polymake')                                                                                                                                                                                                                                                                                                                   
sage: %time _ = P*Q                                                                                                                                                                                                                                                                                                                                                        
CPU times: user 21.8 s, sys: 15.1 ms, total: 21.8 s
Wall time: 21.8 s

After:

sage: %time P = polytopes.hypercube(12, backend='polymake')                                                                                                                                                                                                                                                                                                                
CPU times: user 1.56 s, sys: 48.1 ms, total: 1.61 s
Wall time: 1.61 s
sage: %time P = polytopes.hypercube(12, backend='polymake')                                                                                                                                                                                                                                                                                                                
CPU times: user 120 ms, sys: 3.8 ms, total: 124 ms
Wall time: 123 ms
sage: %time P = polytopes.permutahedron(8, backend='polymake')                                                                                                                                                                                                                                                                                                             
CPU times: user 986 ms, sys: 27.8 ms, total: 1.01 s
Wall time: 1.01 s
sage: P = polytopes.hypercube(6, backend='polymake')                                                                                                                                                                                                                                                                                                                       
sage: Q = polytopes.cross_polytope(6, backend='polymake')                                                                                                                                                                                                                                                                                                                  
sage: %time _ = P*Q                                                                                                                                                                                                                                                                                                                                                        
CPU times: user 29.1 ms, sys: 0 ns, total: 29.1 ms
Wall time: 28.7 ms

Also you can now change backends to polymake quickly:

sage: %time P = polytopes.associahedron(['A', 8], backend='polymake')                                                                                                                                                                                                                                                                                                      
CPU times: user 920 ms, sys: 4.01 ms, total: 924 ms
Wall time: 923 ms
sage: %time P._polymake_polytope.F_VECTOR                                                                                                                                                                                                                                                                                                                                  
CPU times: user 2.77 s, sys: 78 µs, total: 2.77 s
Wall time: 2.77 s
4862 19448 32032 28028 14014 4004 616 44
sage: %time P = polytopes.associahedron(['A', 8], backend='normaliz')                                                                                                                                                                                                                                                                                                      
CPU times: user 324 ms, sys: 0 ns, total: 324 ms
Wall time: 86.4 ms
sage: %time Q = P.base_extend(P.base_ring(), backend='polymake')                                                                                                                                                                                                                                                                                                           
CPU times: user 159 ms, sys: 3.97 ms, total: 162 ms
Wall time: 162 ms
sage: %time Q._polymake_polytope.F_VECTOR                                                                                                                                                                                                                                                                                                                                  
CPU times: user 3.09 s, sys: 99 µs, total: 3.09 s
Wall time: 3.08 s
4862 19448 32032 28028 14014 4004 616 44

Change History (29)

comment:1 Changed 3 years ago by gh-kliem

Dependencies: #28880

comment:2 Changed 19 months ago by Matthias Köppe

Cc: gh-kliem added
Dependencies: #28880#27745
Milestone: sage-8.4sage-duplicate/invalid/wontfix
Status: newneeds_review

#27745 has implemented this.

comment:3 Changed 19 months ago by gh-kliem

Status: needs_reviewneeds_info

While #27745 has illustrated how to implement this, it does not implement a method _init_from_Vrepresentation_and_Hrepresentation.

This method is utilized when changing backends or when doing fully characterized constructions.

comment:4 Changed 19 months ago by Matthias Köppe

Milestone: sage-duplicate/invalid/wontfixsage-9.4
Status: needs_infoneeds_work

Good point.

comment:5 Changed 19 months ago by gh-kliem

Branch: public/26368
Commit: 1d5da2cd562396661ca43b066d68a4d94973befb

Last 10 new commits:

b4366f1PolymakeElement._sage_, Polyhedron_polymake._from_polymake_polytope: Determine the base ring
3cb6888PolymakeElement: Adjust doctest
89614bbbuild/pkgs/polymake/SPKG.rst: Recommend installing jupymake
9b3e7bdsrc/sage/interfaces/polymake.py: Deprecate PolymakeExpect
1f79230src/sage/geometry/polyhedron/backend_polymake.py: Skip the failing TestSuite test _test_lawrence
609e08dmore meaningful error message when pexpect-base interface fails to start
e664be4recreate the polymake polytope unconditionally
310b700more tests for pickling and some fixes
f58a267fix the far facet issue
1d5da2cinitialize polymake from both Vrep and Hrep

comment:6 Changed 19 months ago by gh-kliem

Before doing this, we should really optimize sage to polymake input/output, this is really awful:

sage: P = polytopes.hypercube(8, backend='polymake')                                                                                                                                                                                                                                                                                                                       
sage: %time a = P._polymake_polytope.VERTICES                                                                                                                                                                                                                                                                                                                              
CPU times: user 457 µs, sys: 30 µs, total: 487 µs
Wall time: 489 µs
sage: %time b = [vector(QQ(x) for x in c._repr_().split(' ')) for c in a]                                                                                                                                                                                                                                                                                                  
CPU times: user 218 ms, sys: 15.9 ms, total: 234 ms
Wall time: 233 ms
sage: %time b = [c.sage() for c in a]                                                                                                                                                                                                                                                                                                                                      
CPU times: user 2.78 s, sys: 172 ms, total: 2.95 s
Wall time: 2.95 s

Polymake vector to sage vector should be much much better.

comment:7 Changed 19 months ago by Matthias Köppe

Is it possible to see with a profiler where the time is spent?

comment:8 Changed 19 months ago by gh-kliem

Did this. Not much can be done about input. However output can really be accelerated. Everything is slow: Iterating, item fetching etc. However, just taking the representation and string operations seems to work well.

I have a branch I can push in an hour or so.

comment:9 Changed 19 months ago by Matthias Köppe

Is it easy to see how much time is spent on the polymake side (in Perl and compiled polymake code) vs. on the Python side?

comment:10 Changed 19 months ago by gh-kliem

sage: import pstats, cProfile                                                                                                                                                                                                                                                                                                                                              
sage: cProfile.runctx("polytopes.hypercube(8, backend='polymake')", globals(), locals(), "/tmp/Profile.prof")                                                                                                                                                                                                                                                              
sage: s = pstats.Stats("/tmp/Profile.prof")                                                                                                                                                                                                                                                                                                                                
sage: s.strip_dirs().sort_stats("time").print_stats()                                                                                                                                                                                                                                                                                                                      
Wed May 26 18:02:00 2021    /tmp/Profile.prof

         230319 function calls (214830 primitive calls) in 2.368 seconds

   Ordered by: internal time

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
        1    1.433    1.433    1.433    1.433 {built-in method JuPyMake.InitializePolymake}
     5463    0.733    0.000    0.733    0.000 {built-in method JuPyMake.ExecuteCommand}
     2451    0.028    0.000    2.173    0.001 {method '_polymake_' of 'sage.structure.sage_object.SageObject' objects}
5463/5458    0.018    0.000    2.195    0.000 polymake.py:2523(eval)
   7903/8    0.015    0.000    2.303    0.288 interface.py:250(__call__)
   2725/5    0.013    0.000    0.854    0.171 interface.py:334(_coerce_impl)
     5176    0.012    0.000    2.186    0.000 interface.py:317(_coerce_from_special_method)
      316    0.009    0.000    0.009    0.000 {built-in method builtins.compile}
     2727    0.008    0.000    2.219    0.001 polymake.py:471(_create)
8784/8779    0.006    0.000    0.007    0.000 {method 'format' of 'str' objects}
       94    0.006    0.000    0.006    0.000 {built-in method marshal.loads}
    10259    0.006    0.000    0.006    0.000 {built-in method builtins.hasattr}
     2727    0.005    0.000    1.842    0.001 polymake.py:518(set)
    35060    0.005    0.000    0.005    0.000 {built-in method builtins.isinstance}
     2727    0.004    0.000    2.224    0.001 interface.py:705(__init__)
   2725/5    0.004    0.000    0.854    0.171 polymake.py:303(_coerce_impl)
     2727    0.004    0.000    0.006    0.000 polymake.py:431(_next_var_name)
       17    0.003    0.000    0.003    0.000 {built-in method _imp.create_dynamic}
     2725    0.002    0.000    0.006    0.000 interface.py:982(__del__)
6266/5639    0.002    0.000    0.051    0.000 <frozen importlib._bootstrap>:1009(_handle_fromlist)
  162/161    0.002    0.000    0.003    0.000 {built-in method builtins.__build_class__}
     5465    0.002    0.000    0.002    0.000 polymake.py:2481(is_running)
     7626    0.002    0.000    0.002    0.000 interface.py:95(name)
     5463    0.001    0.000    0.001    0.000 verbose.py:251(get_verbose)
      375    0.001    0.000    0.001    0.000 {built-in method posix.stat}
     8477    0.001    0.000    0.001    0.000 {method 'strip' of 'str' objects}
...
sage: P = polytopes.hypercube(8, backend='polymake')                                                                                                                                                                                                                                                                                                                       
sage: import pstats, cProfile                                                                                                                                                                                                                                                                                                                                              
sage: cProfile.runctx("Polyhedron(ieqs=P.inequalities(), backend='polymake')", globals(), locals(), "/tmp/Profile.prof")                                                                                                                                                                                                                                                   
sage: s = pstats.Stats("/tmp/Profile.prof")                                                                                                                                                                                                                                                                                                                                
sage: s.strip_dirs().sort_stats("time").print_stats()                                                                                                                                                                                                                                                                                                                      
Wed May 26 18:05:43 2021    /tmp/Profile.prof

         566981 function calls (561525 primitive calls) in 3.534 seconds

   Ordered by: internal time

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
    22084    3.020    0.000    3.020    0.000 {built-in method JuPyMake.ExecuteCommand}
    22084    0.078    0.000    3.140    0.000 polymake.py:2523(eval)
 2720/272    0.037    0.000    3.259    0.012 polymake.py:1460(_sage_)
     2448    0.033    0.000    0.036    0.000 {built-in method builtins.eval}
    27987    0.026    0.000    0.026    0.000 {built-in method builtins.hasattr}
     2448    0.021    0.000    0.028    0.000 preparse.py:1143(preparse_numeric_literals)
27098/27095    0.018    0.000    0.019    0.000 {method 'format' of 'str' objects}
     2448    0.016    0.000    0.102    0.000 preparse.py:1693(preparse)
     4896    0.015    0.000    0.019    0.000 {method 'sub' of 're.Pattern' objects}
     2449    0.013    0.000    1.052    0.000 polymake.py:873(_repr_)
    29664    0.012    0.000    0.014    0.000 interface.py:967(_check_valid)
     2450    0.010    0.000    0.014    0.000 {built-in method builtins.getattr}
     3089    0.009    0.000    0.954    0.000 polymake.py:471(_create)
     2448    0.009    0.000    1.087    0.000 interface.py:992(_sage_repr)
     2448    0.009    0.000    0.149    0.000 sage_eval.py:16(sage_eval)
    24654    0.009    0.000    0.034    0.000 <frozen importlib._bootstrap>:1009(_handle_fromlist)
7904/7902    0.009    0.000    0.045    0.000 polymake.py:1205(__getattr__)
2864/2736    0.008    0.000    0.884    0.000 polymake.py:1346(__getitem__)
     2724    0.008    0.000    0.771    0.000 polymake.py:1426(typeof)
     5168    0.008    0.000    0.734    0.000 polymake.py:1121(typename)
     2448    0.008    0.000    0.013    0.000 preparse.py:549(strip_string_literals)
    36357    0.007    0.000    0.007    0.000 {built-in method builtins.isinstance}
3325/2931    0.007    0.000    0.972    0.000 interface.py:250(__call__)
     3089    0.006    0.000    0.514    0.000 polymake.py:518(set)
     9792    0.006    0.000    0.008    0.000 re.py:271(_compile)
    22089    0.006    0.000    0.006    0.000 polymake.py:2481(is_running)
     3089    0.006    0.000    0.959    0.000 interface.py:705(__init__)
     4900    0.005    0.000    0.688    0.000 polymake.py:600(get)
    22084    0.005    0.000    0.005    0.000 verbose.py:251(get_verbose)
     2449    0.004    0.000    1.073    0.000 interface.py:1094(__repr__)
     4896    0.004    0.000    0.004    0.000 re.py:307(_subx)
     7344    0.004    0.000    0.004    0.000 {method 'finditer' of 're.Pattern' objects}
    26928    0.004    0.000    0.004    0.000 {method 'replace' of 'str' objects}
     2448    0.004    0.000    0.008    0.000 preparse.py:1524(preparse_generators)
    45197    0.004    0.000    0.004    0.000 {method 'parent' of 'sage.structure.element.Element' objects}
      272    0.004    0.000    0.017    0.000 {sage.modules.free_module_element.vector}
     2448    0.004    0.000    1.240    0.001 interface.py:1047(_sage_)
      272    0.003    0.000    3.124    0.011 polymake.py:1537(<listcomp>)
      832    0.003    0.000    0.006    0.000 free_module.py:1062(_element_constructor_)
     2448    0.003    0.000    0.006    0.000 preparse.py:1407(preparse_calculus)
...

That is the ticket as is.

I'm not exactly sure, why the method _sage_ is as slow as it is. However, I already have a branch where I'm doing better by a factor of 100 or so. Just by parsing _repr_ instead.

The input is slow as well, which does not suprise me, when forcing verbose things look like this:

## eval: print $SAGE0[0]->description;
## eval: print $SAGE0[0];
## eval: @SAGE23=(3);
## eval: print scalar @SAGE23;
## eval: @SAGE22=(1);
## eval: print scalar @SAGE22;
## eval: @SAGE21=(-1);
## eval: print scalar @SAGE21;
## eval: @SAGE20=(-1);
## eval: print scalar @SAGE20;
## eval: @SAGE19=([$SAGE22[0],$SAGE21[0],$SAGE20[0]]);
## eval: print scalar @SAGE19;
## eval: @SAGE18=(1);
## eval: print scalar @SAGE18;
## eval: @SAGE17=(-1);
## eval: print scalar @SAGE17;
## eval: @SAGE16=(1);
## eval: print scalar @SAGE16;
## eval: @SAGE15=([$SAGE18[0],$SAGE17[0],$SAGE16[0]]);
## eval: print scalar @SAGE15;
## eval: @SAGE14=(1);
## eval: print scalar @SAGE14;
## eval: @SAGE13=(1);
## eval: print scalar @SAGE13;
## eval: @SAGE12=(-1);
## eval: print scalar @SAGE12;
## eval: @SAGE11=([$SAGE14[0],$SAGE13[0],$SAGE12[0]]);
## eval: print scalar @SAGE11;
## eval: @SAGE10=(1);
## eval: print scalar @SAGE10;
## eval: @SAGE9=(1);
## eval: print scalar @SAGE9;
## eval: @SAGE8=(1);
## eval: print scalar @SAGE8;
## eval: @SAGE7=([$SAGE10[0],$SAGE9[0],$SAGE8[0]]);
## eval: print scalar @SAGE7;
## eval: @SAGE6=([$SAGE19[0],$SAGE15[0],$SAGE11[0],$SAGE7[0]]);
## eval: print scalar @SAGE6;
## eval: @SAGE5=([]);
## eval: print scalar @SAGE5;
## eval: @SAGE4=([]);
## eval: print scalar @SAGE4;
## eval: @SAGE3=(1);
## eval: print scalar @SAGE3;
## eval: @SAGE2=(-1);
## eval: print scalar @SAGE2;
## eval: @SAGE99=(0);
## eval: print scalar @SAGE99;
## eval: @SAGE100=([$SAGE3[0],$SAGE2[0],$SAGE99[0]]);
## eval: print scalar @SAGE100;
## eval: @SAGE149=(1);
## eval: print scalar @SAGE149;
## eval: @SAGE148=(0);
## eval: print scalar @SAGE148;
## eval: @SAGE147=(-1);
## eval: print scalar @SAGE147;
## eval: @SAGE146=([$SAGE149[0],$SAGE148[0],$SAGE147[0]]);
## eval: print scalar @SAGE146;
## eval: @SAGE145=(1);
## eval: print scalar @SAGE145;
## eval: @SAGE144=(1);
## eval: print scalar @SAGE144;
## eval: @SAGE143=(0);
## eval: print scalar @SAGE143;
## eval: @SAGE142=([$SAGE145[0],$SAGE144[0],$SAGE143[0]]);
## eval: print scalar @SAGE142;
## eval: @SAGE141=(1);
## eval: print scalar @SAGE141;
## eval: @SAGE140=(0);
## eval: print scalar @SAGE140;
## eval: @SAGE139=(1);
## eval: print scalar @SAGE139;
## eval: @SAGE138=([$SAGE141[0],$SAGE140[0],$SAGE139[0]]);
## eval: print scalar @SAGE138;
## eval: @SAGE137=([$SAGE100[0],$SAGE146[0],$SAGE142[0],$SAGE138[0]]);
## eval: print scalar @SAGE137;
## eval: @SAGE136=(new Polytope<Rational>(CONE_AMBIENT_DIM=>$SAGE23[0],VERTICES=>$SAGE6[0],LINEALITY_SPACE=>$SAGE5[0],AFFINE_HULL=>$SAGE4[0],FACETS=>$SAGE137[0]));
## eval: print scalar @SAGE136;
A 2-dimensional polyhedron in QQ^2 defined as the convex hull of 4 vertices

Polymake also accepts input files etc. in interactive mode. So maybe we could utilize this.

comment:11 Changed 19 months ago by Matthias Köppe

I'm puzzled about this line:

 1.052    0.000 polymake.py:873(_repr_)

comment:12 Changed 19 months ago by git

Commit: 1d5da2cd562396661ca43b066d68a4d94973befbed0105ae02866ea84c76a87b03f6bfc8e84962b3

Branch pushed to git repo; I updated commit sha1. New commits:

ba0a479src/sage/interfaces/polymake.py: Mark doctests specific to the deprecated pexpect-based interface as optional - polymake_expect
ba83771Merge branch 'u/mkoeppe/lrslib071a_polymake44_upgrade-27745' of git://trac.sagemath.org/sage into u/gh-kliem/lrslib071a_polymake44_upgrade-27745
02a6ef9faster sage eval of polymake
2ca121etry faster method directly in _sage_
4a66357improved polymake input
ed0105aMerge branch 'u/gh-kliem/polymake_input_output' of git://trac.sagemath.org/sage into public/26368

comment:13 Changed 19 months ago by gh-kliem

Dependencies: #27745#27745, #31864
Description: modified (diff)
Status: needs_workneeds_review

comment:14 Changed 19 months ago by gh-kliem

Description: modified (diff)

comment:15 Changed 19 months ago by git

Commit: ed0105ae02866ea84c76a87b03f6bfc8e84962b35162d39cd6ad38667060a5888e361e1b2c0c2450

Branch pushed to git repo; I updated commit sha1. New commits:

543d211fix number field input
5162d39Merge branch 'u/gh-kliem/polymake_input_output' of git://trac.sagemath.org/sage into public/26368

comment:16 Changed 19 months ago by git

Commit: 5162d39cd6ad38667060a5888e361e1b2c0c245095070b250713280eed27f765067072c7c9bf3928

Branch pushed to git repo; I updated commit sha1. New commits:

c0eb507use `_polymake_init_` for quadratic fields
e6fef55Merge branch 'develop' of git://trac.sagemath.org/sage into u/gh-kliem/polymake_input_output2
95070b2Merge branch 'u/gh-kliem/polymake_input_output2' of git://trac.sagemath.org/sage into public/26368

comment:17 Changed 19 months ago by Matthias Köppe

Authors: Jonathan Kliem
Cc: Vincent Delecroix added

comment:18 Changed 19 months ago by Matthias Köppe

Reviewers: Matthias Koeppe
Status: needs_reviewpositive_review

This seems to work well, thanks!

comment:19 Changed 19 months ago by gh-kliem

Thank you.

There is a problem with JuPyMake yet. It really doesn't play nicely with keyboard interrupts. Well polymake doesn't handle interrupts at all to start with, but killing sage the hard way at keyboard interrupt isn't really what you would expect.

comment:20 Changed 19 months ago by Matthias Köppe

Could you open a new ticket for this please?

comment:21 Changed 17 months ago by Volker Braun

Status: positive_reviewneeds_work
sage -t --long --warn-long 44.3 --random-seed=0 src/sage/geometry/polyhedron/backend_polymake.py
**********************************************************************
File "src/sage/geometry/polyhedron/backend_polymake.py", line 420, in sage.geometry.polyhedron.backend_polymake.Polyhedron_polymake._init_from_Vrepresentation_and_Hrep
resentation
Failed example:
    p = Polyhedron_polymake(parent, Vrep, Hrep,
                            Vrep_minimal=True, Hrep_minimal=True)  # indirect doctest  # optional - polymake
Exception raised:
    Traceback (most recent call last):
      File "/home/release/Sage/local/lib64/python3.9/site-packages/sage/interfaces/expect.py", line 516, in _start
        self._expect.expect(self._prompt)
      File "/home/release/Sage/local/lib64/python3.9/site-packages/pexpect/spawnbase.py", line 343, in expect
        return self.expect_list(compiled_pattern_list,
      File "/home/release/Sage/local/lib64/python3.9/site-packages/pexpect/spawnbase.py", line 372, in expect_list
        return exp.expect_loop(timeout)
      File "/home/release/Sage/local/lib64/python3.9/site-packages/pexpect/expect.py", line 179, in expect_loop
        return self.eof(e)
      File "/home/release/Sage/local/lib64/python3.9/site-packages/pexpect/expect.py", line 122, in eof
        raise exc
    pexpect.exceptions.EOF: End Of File (EOF). Exception style platform.
    Polymake finished running /usr/bin/env TERM=dumb polymake
    command: /usr/bin/env
    args: ['/usr/bin/env', 'TERM=dumb', 'polymake']
    buffer (last 100 chars): b''
    before (last 100 chars): b'/usr/bin/env: \xe2\x80\x98polymake\xe2\x80\x99: No such file or directory\r\n'
    after: <class 'pexpect.exceptions.EOF'>
    match: None
    match_index: None
    exitstatus: 127
    flag_eof: True
[...]

comment:22 Changed 17 months ago by git

Commit: 95070b250713280eed27f765067072c7c9bf3928cf3a7fac6622f2abf3d6d723b55b97b10a68a85c

Branch pushed to git repo; I updated commit sha1. New commits:

a01dcd2PolymakeExpect: If startup fails, only mention deprecation once. Update polymake install info, fix doctest
aa028b7src/sage/game_theory/parser.py: Relax lrslib output doctests
f6b4d50Merge tag '9.4.beta4' into t/27745/lrslib071a_polymake44_upgrade-27745
d77aceesage.game_theory: Switch to new lrsnash input format
794cf6abuild/pkgs/lrslib/spkg-configure.m4: Check for recent lrsnash
5f32d2ebuild/pkgs/lrslib/: Update to 071b+autotools-2021-07-13
53c7b65Rewriting doctests to test the new format.
95ce6dfAdding the game theory parser to the documentation.
ff69f28Some last little fixes.
cf3a7faMerge branch 'u/tscrim/upgrade_lrslib_polymake-27745' of git://trac.sagemath.org/sage into public/26368

comment:23 in reply to:  21 Changed 17 months ago by gh-kliem

Replying to vbraun:

sage -t --long --warn-long 44.3 --random-seed=0 src/sage/geometry/polyhedron/backend_polymake.py
**********************************************************************
File "src/sage/geometry/polyhedron/backend_polymake.py", line 420, in sage.geometry.polyhedron.backend_polymake.Polyhedron_polymake._init_from_Vrepresentation_and_Hrep
resentation
Failed example:
    p = Polyhedron_polymake(parent, Vrep, Hrep,
                            Vrep_minimal=True, Hrep_minimal=True)  # indirect doctest  # optional - polymake
Exception raised:
    Traceback (most recent call last):
      File "/home/release/Sage/local/lib64/python3.9/site-packages/sage/interfaces/expect.py", line 516, in _start
        self._expect.expect(self._prompt)
      File "/home/release/Sage/local/lib64/python3.9/site-packages/pexpect/spawnbase.py", line 343, in expect
        return self.expect_list(compiled_pattern_list,
      File "/home/release/Sage/local/lib64/python3.9/site-packages/pexpect/spawnbase.py", line 372, in expect_list
        return exp.expect_loop(timeout)
      File "/home/release/Sage/local/lib64/python3.9/site-packages/pexpect/expect.py", line 179, in expect_loop
        return self.eof(e)
      File "/home/release/Sage/local/lib64/python3.9/site-packages/pexpect/expect.py", line 122, in eof
        raise exc
    pexpect.exceptions.EOF: End Of File (EOF). Exception style platform.
    Polymake finished running /usr/bin/env TERM=dumb polymake
    command: /usr/bin/env
    args: ['/usr/bin/env', 'TERM=dumb', 'polymake']
    buffer (last 100 chars): b''
    before (last 100 chars): b'/usr/bin/env: \xe2\x80\x98polymake\xe2\x80\x99: No such file or directory\r\n'
    after: <class 'pexpect.exceptions.EOF'>
    match: None
    match_index: None
    exitstatus: 127
    flag_eof: True
[...]

Merging in the updates from #27745 should resolve this (or raise a proper deprecation warning or something).

In any case. pexpect is deprecated. I can't get it to work either. On some machines it still works, on some it doesn't. jupymake should work just fine.

comment:24 Changed 17 months ago by gh-kliem

Status: needs_workneeds_review

comment:25 Changed 17 months ago by Matthias Köppe

I think it's just that here

+            sage: p = Polyhedron_polymake(parent, Vrep, Hrep,
+            ....:                         Vrep_minimal=True, Hrep_minimal=True)  # indirect doctest  # optional - polymake
+            sage: p  # optional - polymake

the # optional - polymake should appear on the first line

comment:26 Changed 17 months ago by git

Commit: cf3a7fac6622f2abf3d6d723b55b97b10a68a85c82020efc61c10fbd585d09a75e0febb6c9be5b17

Branch pushed to git repo; I updated commit sha1. New commits:

82020efdoctest tag in the first line

comment:27 in reply to:  25 Changed 17 months ago by gh-kliem

Replying to mkoeppe:

I think it's just that here

+            sage: p = Polyhedron_polymake(parent, Vrep, Hrep,
+            ....:                         Vrep_minimal=True, Hrep_minimal=True)  # indirect doctest  # optional - polymake
+            sage: p  # optional - polymake

the # optional - polymake should appear on the first line

Right. I wonder, when I will stop making this mistake ...

comment:28 Changed 17 months ago by Matthias Köppe

Status: needs_reviewpositive_review

comment:29 Changed 17 months ago by Volker Braun

Branch: public/2636882020efc61c10fbd585d09a75e0febb6c9be5b17
Resolution: fixed
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.