Opened 5 months ago

Closed 5 months ago

#27647 closed enhancement (fixed)

adding parameter 'closed' to graph neighborhood

Reported by: gh-jfraymond Owned by:
Priority: minor Milestone: sage-8.8
Component: graph theory Keywords: closed neighborhood
Cc: Merged in:
Authors: Jean-Florent Raymond Reviewers: David Coudert
Report Upstream: N/A Work issues:
Branch: ffc05cb (Commits) Commit: ffc05cb104ab53edebd6c42b8d2a869995a0a572
Dependencies: Stopgaps:

Description

This is a small patch to add a parameter closed to the .neighborhood_iterator method of graphs, in order to generate the closed neighborhood of a vertex (i.e. the vertex + its neighborhood).

It was part of #27424; as suggested in a comment I made a separate ticket for it.

Change History (15)

comment:1 Changed 5 months ago by gh-jfraymond

  • Branch set to u/gh-jfraymond/adding_parameter__closed__to_graph_neighborhood

comment:2 Changed 5 months ago by gh-jfraymond

  • Authors set to Jean-Florent Raymond
  • Commit set to 32b6b4f2a13ea617935fa22f3b3bfc7060b5e989

New commits:

32b6b4fadded the parameter to neighbor_iterator -- not completely tested yet...

comment:3 Changed 5 months ago by gh-jfraymond

  • Keywords closed neighborhood added

comment:4 Changed 5 months ago by dcoudert

can you:

  • add an INPUT block
  • add parameter closed to method neighbors

comment:5 Changed 5 months ago by git

  • Commit changed from 32b6b4f2a13ea617935fa22f3b3bfc7060b5e989 to 9aa119a22277320a3053b99cadbb8ea76d94991a

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

9aa119aAdded the parameter `closed` to `.neighbors` as well and added an INPU block in the docstrings.

comment:6 Changed 5 months ago by gh-jfraymond

  • Status changed from new to needs_review

comment:7 Changed 5 months ago by dcoudert

You must let an empty line between the description of input parameters.

Also, you could do

-        - ``closed`` -- a boolean (default: ``False``)
+        - ``closed`` -- a boolean (default: ``False``); whether to return the
+          closed neighborhood of ``vertex``, i.e., including ``vertex``, or the
+          open neighborhood in which ``vertex`` is included only if there is a
+          loop on that vertex.

comment:8 Changed 5 months ago by git

  • Commit changed from 9aa119a22277320a3053b99cadbb8ea76d94991a to 1d69b620bb8d327c76fb9a3a388d404ed0b474cf

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

1d69b62doctring polishing

comment:9 Changed 5 months ago by gh-jfraymond

Done!


New commits:

1d69b62doctring polishing

comment:10 Changed 5 months ago by dcoudert

in list of bullets, when a bullet has several lines, the second line must be shifted by 2 spaces. Otherwise, the documentation will not build properly.

-        - ``closed`` -- a boolean (default: ``False``); whether to
-        return the closed neighborhood of ``vertex``, i.e., including
-        ``vertex``, or the open neighborhood in which ``vertex``
-        is included only if there is a loop on that vertex.
+        - ``closed`` -- a boolean (default: ``False``); whether to
+          return the closed neighborhood of ``vertex``, i.e., including
+          ``vertex``, or the open neighborhood in which ``vertex``
+          is included only if there is a loop on that vertex.

you can do ./sage -docbuild reference/graphs html to rebuild only the documentation of the graph module, and then look at the produced html page in your web browser. If it's not looking good, then you must improve something.

comment:11 Changed 5 months ago by git

  • Commit changed from 1d69b620bb8d327c76fb9a3a388d404ed0b474cf to ffc05cb104ab53edebd6c42b8d2a869995a0a572

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

ffc05cbdocstring

comment:12 Changed 5 months ago by gh-jfraymond

Indeed, thanks for noticing that. I fixed it.

comment:13 Changed 5 months ago by dcoudert

  • Reviewers set to David Coudert
  • Status changed from needs_review to positive_review

LGTM.

comment:14 Changed 5 months ago by gh-jfraymond

Thanks for the fast review!

comment:15 Changed 5 months ago by vbraun

  • Branch changed from u/gh-jfraymond/adding_parameter__closed__to_graph_neighborhood to ffc05cb104ab53edebd6c42b8d2a869995a0a572
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.