Opened 11 months ago
Closed 11 months ago
#27647 closed enhancement (fixed)
adding parameter 'closed' to graph neighborhood
Reported by:  ghjfraymond  Owned by:  

Priority:  minor  Milestone:  sage8.8 
Component:  graph theory  Keywords:  closed neighborhood 
Cc:  Merged in:  
Authors:  JeanFlorent 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 11 months ago by
 Branch set to u/ghjfraymond/adding_parameter__closed__to_graph_neighborhood
comment:2 Changed 11 months ago by
 Commit set to 32b6b4f2a13ea617935fa22f3b3bfc7060b5e989
comment:3 Changed 11 months ago by
 Keywords closed neighborhood added
comment:4 Changed 11 months ago by
can you:
 add an
INPUT
block
 add parameter
closed
to methodneighbors
comment:5 Changed 11 months ago by
 Commit changed from 32b6b4f2a13ea617935fa22f3b3bfc7060b5e989 to 9aa119a22277320a3053b99cadbb8ea76d94991a
Branch pushed to git repo; I updated commit sha1. New commits:
9aa119a  Added the parameter `closed` to `.neighbors` as well and added an INPU block in the docstrings.

comment:6 Changed 11 months ago by
 Status changed from new to needs_review
comment:7 Changed 11 months ago by
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 11 months ago by
 Commit changed from 9aa119a22277320a3053b99cadbb8ea76d94991a to 1d69b620bb8d327c76fb9a3a388d404ed0b474cf
Branch pushed to git repo; I updated commit sha1. New commits:
1d69b62  doctring polishing

comment:9 Changed 11 months ago by
comment:10 Changed 11 months ago by
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 11 months ago by
 Commit changed from 1d69b620bb8d327c76fb9a3a388d404ed0b474cf to ffc05cb104ab53edebd6c42b8d2a869995a0a572
Branch pushed to git repo; I updated commit sha1. New commits:
ffc05cb  docstring

comment:12 Changed 11 months ago by
Indeed, thanks for noticing that. I fixed it.
comment:13 Changed 11 months ago by
 Reviewers set to David Coudert
 Status changed from needs_review to positive_review
LGTM.
comment:14 Changed 11 months ago by
Thanks for the fast review!
comment:15 Changed 11 months ago by
 Branch changed from u/ghjfraymond/adding_parameter__closed__to_graph_neighborhood to ffc05cb104ab53edebd6c42b8d2a869995a0a572
 Resolution set to fixed
 Status changed from positive_review to closed
New commits:
added the parameter to neighbor_iterator  not completely tested yet...