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

Implement star and stellar subdivision of a face of simplicial complex #22466

Closed
jplab opened this issue Feb 27, 2017 · 33 comments
Closed

Implement star and stellar subdivision of a face of simplicial complex #22466

jplab opened this issue Feb 27, 2017 · 33 comments

Comments

@jplab
Copy link

jplab commented Feb 27, 2017

This ticket provides the star and the stellar subdivision of a face of a simplicial complex.

The star of a face is the union of the faces that contains that face. The star of the empty face is the whole complex.

Given a simplicial complex C, the stellar subdivision of a face f of C is a new simplicial complex obtained as the barycentric subdivision of the face with respect to its star.

CC: @mo271 @videlec

Component: algebraic topology

Keywords: days84, simplicial complex, star, stellar subdivision

Author: Jean-Philippe Labbé

Branch/Commit: 1b54fba

Reviewer: Thierry Monteil, Frédéric Chapoton

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

@jplab jplab added this to the sage-7.6 milestone Feb 27, 2017
@jplab
Copy link
Author

jplab commented Feb 27, 2017

Branch: u/jipilab/22466

@jplab

This comment has been minimized.

@jplab
Copy link
Author

jplab commented Feb 28, 2017

Commit: 2dfd035

@jplab
Copy link
Author

jplab commented Feb 28, 2017

New commits:

2dfd035First implementation of star

@jplab
Copy link
Author

jplab commented Feb 28, 2017

Changed keywords from days84, simplicial complex, star, stellar subdivision, deletion to days84, simplicial complex, star, stellar subdivision

@jplab jplab changed the title Implement deletion, star and stellar subdivision of a face of simplicial complex Implement star and stellar subdivision of a face of simplicial complex Feb 28, 2017
@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Feb 28, 2017

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

04bcbefAdded first implementation of stellar subdivision

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Feb 28, 2017

Changed commit from 2dfd035 to 04bcbef

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Feb 28, 2017

Changed commit from 04bcbef to e948253

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Feb 28, 2017

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

c6b3853Corrected indentation
e948253pep8 conventions

@jplab
Copy link
Author

jplab commented Feb 28, 2017

Author: Jean-Philippe Labbé

@sagetrac-tmonteil
Copy link
Mannequin

sagetrac-tmonteil mannequin commented Feb 28, 2017

Reviewer: Thierry Monteil

@sagetrac-tmonteil
Copy link
Mannequin

sagetrac-tmonteil mannequin commented Feb 28, 2017

comment:7

First few comments/questions:

  • would it be pertinent to check that the provided simplex is actually a simplex in the considered simplicial complex ?
  • You could provide non-working examples/tests to check such inconsistent user inputs.
  • in stellar_subdivision, the mutable option is not taken into account (does not appear in the code).
  • what is the difference between is_mutable and mutable option ?
  • you should add an INPUT section in stellar_subdivision.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Feb 28, 2017

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

fae5016Review and made tests pass

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Feb 28, 2017

Changed commit from e948253 to fae5016

@fchapoton
Copy link
Contributor

comment:9

missing empty line here:

+        EXAMPLES::
+            sage: SC = SimplicialComplex([[0,1,2],[1,2,3]])

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 2, 2017

Changed commit from fae5016 to eb4dfac

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 2, 2017

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

eb4dfacpep8 conventions

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 2, 2017

Changed commit from eb4dfac to 9ed5260

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 2, 2017

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

9ed5260Corrected a silly typo

@jhpalmieri
Copy link
Member

comment:12

You should avoid lines longer than 80 characters. I see one here:

- `is_mutable` -- (optional) boolean, determines if the output is mutable, default ``True``

In a line like

def stellar_subdivision(self,simplex,inplace=False,is_mutable=True):

the style is to put a space after each comma.

In docstrings, use single backquotes or dollar signs – `F`, $F$ – for math, but use double backquotes – ``simplex``, ``is_mutable`` – for code.

In doctests, you need to put a double colon :: before each indented line, not just a single colon. For example, you need two colons at the end of this line

The simplex to subdivide should be a face of self::

I'm assuming that you haven't actually looked at the built documentation or you would have realized that there were problems. It's good practice to look at the html documentation to make sure it is okay.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 2, 2017

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

2c1c6a8pep8 conventions and fixed doc

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 2, 2017

Changed commit from 9ed5260 to 2c1c6a8

@jplab
Copy link
Author

jplab commented Mar 2, 2017

comment:14

Dear jhpalmieri,

Thank you for the comments. Indeed, the double ticks slipped out of my mind for the code part.

I fixed the documentation, hopefully it should be okay now.

@jhpalmieri
Copy link
Member

comment:16

Okay, better, but now the indentation doesn't match in the input and output blocks. You need to make changes like

diff --git a/src/sage/homology/simplicial_complex.py b/src/sage/homology/simplicial_complex.py
index 2f2e997..0c77839 100644
--- a/src/sage/homology/simplicial_complex.py
+++ b/src/sage/homology/simplicial_complex.py
@@ -2776,7 +2776,7 @@ class SimplicialComplex(Parent, GenericCellComplex):
 
         - ``simplex`` -- a simplex in this simplicial complex
         - ``is_mutable`` -- (default: ``True``) boolean; determines if the output
-            is mutable
+          is mutable
 
         EXAMPLES::
 

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 3, 2017

Changed commit from 2c1c6a8 to d68a1a2

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 3, 2017

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

d68a1a2Corrected indentation of input blocks

@jplab
Copy link
Author

jplab commented Mar 3, 2017

comment:18

Oh! Okay, my bad! Should be okay now.

Thanks a lot for the help.

@fchapoton
Copy link
Contributor

comment:19
  1. The first line of the 2 new methods should rather be
+        """
+        Return the star of a simplex in this simplicial complex.

and

+        """
+        Return the stellar subdivision of a simplex in this simplicial complex.
  1. in the raise statements the convention is not to start with a capital and not to end with a dot, so something like
+            raise ValueError("this simplicial complex is not mutable")

and

+            raise ValueError("the face to subdivide is not a face of self")

and then change the doctests accordingly.

  1. I would add "or on a copy" here:
+        - ``inplace`` -- (default: ``False``) boolean; determines if the
+          operation is done on ``self`` or on a copy

Otherwise, this looks good.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 3, 2017

Changed commit from d68a1a2 to 1b54fba

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 3, 2017

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

1b54fbacorrected conventions

@fchapoton
Copy link
Contributor

comment:21

ok, let it be

@fchapoton
Copy link
Contributor

Changed reviewer from Thierry Monteil to Thierry Monteil, Frédéric Chapoton

@vbraun
Copy link
Member

vbraun commented Mar 10, 2017

Changed branch from u/jipilab/22466 to 1b54fba

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