Opened 4 years ago

Closed 4 years ago

# clean hyperbolicity.pyx

Reported by: Owned by: dcoudert major sage-8.5 graph theory py3, graph tscrim, chapoton David Coudert Travis Scrimshaw N/A 2366c76 2366c76b7e8b37c172b8cd32fb1157c5d0d1625c

### Description

Various PEP8 corrections and fix `sorted` statements.

### comment:1 Changed 4 years ago by dcoudert

• Branch set to public/26448_hyperbolicity_pyx
• Commit set to be463bd62a1d7d1f7b835fbb729a3bca7e3acfc8
• Status changed from new to needs_review

There a decision to take: method `hyperbolicity` sorts the vertices of the output. As this method is not yet exposed in `Graph` and that the sorted list of vertices has only 4 vertices, we can just remove this sorting. Do you agree ?

New commits:

 ​be463bd `trac #26448: cleaning`

### comment:2 Changed 4 years ago by tscrim

• Reviewers set to Travis Scrimshaw

LGTM modulo

```@@ -361,10 +361,18 @@ cdef tuple hyperbolicity_basic_algorithm(int N,
def _greedy_dominating_set(H, verbose=False):
r"""
Returns a greedy approximation of a dominating set
+
+    EXAMPLES:
+
+        sage: from sage.graphs.hyperbolicity import _greedy_dominating_set
+        sage: G = graphs.PetersenGraph()
+        sage: _greedy_dominating_set(G)
+        [0, 2, 6]
"""
```

should be `EXAMPLES::`

```-    if len(certificate) == 0:
+    if not len(certificate):
```

could be simply `if not certificate` and

```-raise ValueError("algorithm '%s' not yet implemented. Please contribute" %(algorithm))
+raise ValueError("algorithm '%s' not yet implemented, please contribute" %(algorithm))
```

for sentence syntax.

Once changed, you can set a positive review on my behalf.

### comment:3 Changed 4 years ago by git

• Commit changed from be463bd62a1d7d1f7b835fbb729a3bca7e3acfc8 to 2366c76b7e8b37c172b8cd32fb1157c5d0d1625c

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

 ​2366c76 `trac #26448: review comments`

### comment:4 Changed 4 years ago by dcoudert

• Status changed from needs_review to positive_review

Thank you.

### comment:5 Changed 4 years ago by vbraun

• Branch changed from public/26448_hyperbolicity_pyx to 2366c76b7e8b37c172b8cd32fb1157c5d0d1625c
• Resolution set to fixed
• Status changed from positive_review to closed

### comment:6 Changed 4 years ago by embray

• Milestone changed from sage-8.4 to sage-8.5

This should be re-targeted for 8.5.

Note: See TracTickets for help on using tickets.