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
Simplicial complexes: keep the __enlarged cache in add_face #20758
Comments
Commit: |
Branch: u/jhpalmieri/simplicial-add-face |
comment:1
The New commits:
|
This comment has been minimized.
This comment has been minimized.
Changed keywords from none to days74 |
comment:3
If you're okay with my changes, then you can set a positive review. New commits:
|
Reviewer: Travis Scrimshaw |
Changed branch from u/jhpalmieri/simplicial-add-face to u/tscrim/simplicial_add_face-20758 |
Author: John Palmieri |
comment:4
Looks good. |
comment:5
|
comment:6
This is fallout from #20718: in that ticket, we changed from using diff --git a/src/sage/homology/simplicial_complex.py b/src/sage/homology/simplicial_complex.py
index fefc90e..1a6cca7 100644
--- a/src/sage/homology/simplicial_complex.py
+++ b/src/sage/homology/simplicial_complex.py
@@ -1199,7 +1199,7 @@ class SimplicialComplex(Parent, GenericCellComplex):
if not isinstance(x, Simplex):
return False
dim = x.dimension()
- return x in self.faces()[dim]
+ return dim in self.faces() and x in self.faces()[dim]
def __call__(self, simplex):
"""
@@ -1527,9 +1527,11 @@ class SimplicialComplex(Parent, GenericCellComplex):
...
ValueError: this simplex is not in this simplicial complex
"""
- if not simplex in self.faces()[simplex.dimension()]:
+ d = simplex.dimension()
+ if d in self.faces() and simplex in self.faces()[d]:
+ return simplex.face(i)
+ else:
raise ValueError('this simplex is not in this simplicial complex')
- return simplex.face(i)
def flip_graph(self):
"""
@@ -3220,7 +3222,11 @@ class SimplicialComplex(Parent, GenericCellComplex):
sage: X.set_immutable()
sage: X.n_skeleton(2)
Simplicial complex with vertex set (0, 1, 2, 3) and facets {(0, 2, 3), (1, 2, 3), (0, 1)}
+ sage: X.n_skeleton(4)
+ Simplicial complex with vertex set (0, 1, 2, 3) and facets {(0, 2, 3), (1, 2, 3), (0, 1)}
"""
+ if n >= self.dimension():
+ return self
# make sure it's a list (it will be a tuple if immutable)
facets = [f for f in self._facets if f.dimension() < n]
facets.extend(self.faces()[n]) |
comment:7
I would say let us use |
Changed branch from u/tscrim/simplicial_add_face-20758 to u/jhpalmieri/simplicial_add_face-20758 |
New commits:
|
comment:10
|
comment:11
I don't understand this error. With my branch, there is no line in the entire Sage source tree matching
so this error should not happen. All tests pass for me. I started over, checking out the branch all over again, and all tests still pass. |
comment:12
Well you wrote that in #20718 ;-) just wait for the next beta and merge it in, easy. |
comment:14
Which is why you shouldn't switch positively reviewed tickets back and forth... |
comment:15
I'm really confused now. You posted a doctest failure here, so I thought it was basically required to undo the positive review. Should I have left it as a positive review? |
comment:16
If its fixed then set it back to positive review. If you want to avoid the confusion then don't go back after positive review. If it doesn't work then I'll tell you. Now you merged in #20718 but there is no guarantee that that ticket will even be in the next beta. Its likely but it might still get unmerged. |
comment:17
Just to be clear: I tested the branch from back when it was "positive review". |
Changed branch from u/jhpalmieri/simplicial_add_face-20758 to |
The
add_face
method currently deletes the__enlarged
cache, but this is unnecessary.CC: @tscrim
Component: algebraic topology
Keywords: days74
Author: John Palmieri
Branch/Commit:
c7bdbcf
Reviewer: Travis Scrimshaw
Issue created by migration from https://trac.sagemath.org/ticket/20758
The text was updated successfully, but these errors were encountered: