Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Three apparently useless polyhedron methods #18861

Closed
nathanncohen mannequin opened this issue Jul 7, 2015 · 20 comments
Closed

Three apparently useless polyhedron methods #18861

nathanncohen mannequin opened this issue Jul 7, 2015 · 20 comments

Comments

@nathanncohen
Copy link
Mannequin

nathanncohen mannequin commented Jul 7, 2015

It seems that the three following functions are not used anywhere

(polgraph|✚2…)~/sage/geometry$ grep _make_polyh . -R
./polyhedron/base.py:#    _make_polyhedron_face.
./polyhedron/base.py:    def _make_polyhedron_face(self, Vindices, Hindices):
./polyhedron/base.py:            sage: square._make_polyhedron_face((0,2), (1,))
./polyhedron/base.py:            return self._make_polyhedron_face(Vindices, Hindices)
(polgraph|✚2…)~/sage/geometry$ grep _init_fac . -R  
./polyhedron/base.py:#    _init_facet_adjacency_matrix, _init_vertex_adjacency_matrix, and
./polyhedron/backend_cdd.py:    def _init_facet_adjacency_matrix(self, verbose=False):
./polyhedron/backend_cdd.py:            sage: p._init_facet_adjacency_matrix()
(polgraph|✚2…)~/sage/geometry$ grep _init_vertex . -R
./polyhedron/base.py:#    _init_facet_adjacency_matrix, _init_vertex_adjacency_matrix, and
./polyhedron/backend_cdd.py:    def _init_vertex_adjacency_matrix(self, verbose=False):
./polyhedron/backend_cdd.py:            sage: p._init_vertex_adjacency_matrix()

Should they be removed, or used somewhere?

Nathann

CC: @dimpase @vbraun @videlec @fchapoton

Component: geometry

Author: Jean-Philippe Labbé

Branch/Commit: 9f7a12b

Reviewer: Frédéric Chapoton

Issue created by migration from https://trac.sagemath.org/ticket/18861

@nathanncohen nathanncohen mannequin added this to the sage-6.8 milestone Jul 7, 2015
@nathanncohen nathanncohen mannequin added c: geometry labels Jul 7, 2015
@mkoeppe
Copy link
Member

mkoeppe commented Mar 29, 2016

comment:1

_make_polyhedron_face is used in face_lattice.

@jplab
Copy link

jplab commented Oct 26, 2019

comment:2

With sage8.9:

sage/src/sage/geometry$ grep _make_polyh . -R
./polyhedron/base.py:#    _make_polyhedron_face.
./polyhedron/base.py:    def _make_polyhedron_face(self, Vindices, Hindices):
./polyhedron/base.py:            sage: square._make_polyhedron_face((0,2), (1,)).ambient_V_indices()
./polyhedron/base.py:            return self._make_polyhedron_face(Vindices, Hindices)
sage/src/sage/geometry$ grep _init_fac . -R
sage/src/sage/geometry$ grep _init_vertex . -R

This has been indirectly taken care of. The first function is used in face_lattice.

For this reason, I would set this as a "won't fix".

@jplab jplab removed this from the sage-6.8 milestone Oct 26, 2019
@fchapoton
Copy link
Contributor

comment:4

Maybe _make_polyhedron_face could just be inserted where it is called, as it is very short and called in just one place ?

@jplab
Copy link

jplab commented Oct 27, 2019

comment:5

Replying to @fchapoton:

Maybe _make_polyhedron_face could just be inserted where it is called, as it is very short and called in just one place ?

Good idea. I'll do that.

@jplab
Copy link

jplab commented Oct 27, 2019

comment:6

It turns out that it can simply be deleted and merged into the already present function.

... when face_lattice will be renovated through CombinatorialPolyhedron the face lattice function will change again, but it will make the transition a bit easier. So I would say it is a good first step.


New commits:

a7792faremoved _make_polyhedron_face

@jplab
Copy link

jplab commented Oct 27, 2019

Commit: a7792fa

@jplab
Copy link

jplab commented Oct 27, 2019

Author: Jean-Philippe Labbé

@jplab
Copy link

jplab commented Oct 27, 2019

Branch: u/jipilab/18861

@jplab jplab added this to the sage-9.0 milestone Oct 27, 2019
@fchapoton
Copy link
Contributor

comment:7
  • you forgot the first argument self in the function call.

  • I would put the import outside of the auxiliary function

  • One could replace
    if len(atoms) == 0:
    by
    if not atoms

@jplab
Copy link

jplab commented Oct 27, 2019

comment:8

Merde. I thought about it when I cut the function, and after I pasted, I forgot to change it's format.

Upcoming...

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Oct 27, 2019

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

dc629e0removed _make_polyhedron_face
542d772changed if in face_lattice

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Oct 27, 2019

Changed commit from a7792fa to 542d772

@jplab
Copy link

jplab commented Oct 27, 2019

comment:10

I looked at it and I think that the first two items are not correct:

what happened is

  • the method _make_polyhedron_face is removed.
  • the only place where it was used was related to an internally defined function face_constructor inside of the face_lattice method.

So, I believe that the import should be inside the internal function, right?

Thus, there is no need of the self argument.

I changed the if statement. Let's see what the bot says, just to make sure that the calls are correct. If I looked correctly, it should essentially be the same, but only function call less...

@fchapoton
Copy link
Contributor

comment:11

Still very very broken...

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Oct 28, 2019

Changed commit from 542d772 to 9f7a12b

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Oct 28, 2019

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

9f7a12badded missing argument

@jplab
Copy link

jplab commented Oct 28, 2019

comment:13

Wow, yes... I missed that self argument... Should be better now...

@fchapoton
Copy link
Contributor

Reviewer: Frédéric Chapoton

@fchapoton
Copy link
Contributor

comment:14

Merci, feu vert.

@vbraun
Copy link
Member

vbraun commented Oct 29, 2019

Changed branch from u/jipilab/18861 to 9f7a12b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants