Sage: Ticket #20479: Correct error in vertex_boundary
https://trac.sagemath.org/ticket/20479
<p>
The documentation of <code>vertex_boundary</code> says that <em>If vertices2 is None, then vertices2 is the complement of vertices1</em>. However this is not the case, as shown in this example.
</p>
<pre class="wiki">sage: G = graphs.PathGraph(3)
sage: G.vertex_boundary([0,1], vertices2=None)
[0, 1, 2]
sage: G.vertex_boundary([0,1], vertices2=set(G.vertices()).difference([0,1]))
[2]
sage: D = DiGraph(G)
sage: D.vertex_boundary([0,1])
[0, 1, 2]
sage: D.vertex_boundary([0,1], vertices2=set(D.vertices()).difference([0,1]))
[2]
</pre><p>
This patch solves this issue.
</p>
en-usSagehttps://trac.sagemath.org/chrome/site/logo_sagemath_trac.png
https://trac.sagemath.org/ticket/20479
Trac 1.1.6dcoudertThu, 21 Apr 2016 09:56:50 GMTstatus changed; commit, branch set
https://trac.sagemath.org/ticket/20479#comment:1
https://trac.sagemath.org/ticket/20479#comment:1
<ul>
<li><strong>status</strong>
changed from <em>new</em> to <em>needs_review</em>
</li>
<li><strong>commit</strong>
set to <em>fb0deec2f4556c1d2c63f872f4390db5ba678e8a</em>
</li>
<li><strong>branch</strong>
set to <em>u/dcoudert/20479</em>
</li>
</ul>
<p>
New commits:
</p>
<table class="wiki">
<tr><td><a class="ext-link" href="http://git.sagemath.org/sage.git/commit/?id=fb0deec2f4556c1d2c63f872f4390db5ba678e8a"><span class="icon"></span>fb0deec</a></td><td><code>trac #20479: correct behavior of vertex_boundary</code>
</td></tr></table>
TicketdcoudertMon, 25 Apr 2016 09:45:14 GMTcc set
https://trac.sagemath.org/ticket/20479#comment:2
https://trac.sagemath.org/ticket/20479#comment:2
<ul>
<li><strong>cc</strong>
<em>jmantysalo</em> <em>vdelecroix</em> added
</li>
</ul>
<p>
Simple patch that should be easy to review. Thanks.
</p>
TicketjmantysaloMon, 25 Apr 2016 13:01:00 GMT
https://trac.sagemath.org/ticket/20479#comment:3
https://trac.sagemath.org/ticket/20479#comment:3
<p>
References to corrected bugss should be in <code>TESTS</code> section.
</p>
<p>
But more importantly, how this <em>should</em> work? If I understood correctly (have not compiled yet), then this will change current behaviour when <code>vertices2=None</code>. This can surprise users.
</p>
TicketgitMon, 25 Apr 2016 13:21:04 GMTcommit changed
https://trac.sagemath.org/ticket/20479#comment:4
https://trac.sagemath.org/ticket/20479#comment:4
<ul>
<li><strong>commit</strong>
changed from <em>fb0deec2f4556c1d2c63f872f4390db5ba678e8a</em> to <em>d35ce496637639f29294fa6c369f78caad401b46</em>
</li>
</ul>
<p>
Branch pushed to git repo; I updated commit sha1. New commits:
</p>
<table class="wiki">
<tr><td><a class="ext-link" href="http://git.sagemath.org/sage.git/commit/?id=d35ce496637639f29294fa6c369f78caad401b46"><span class="icon"></span>d35ce49</a></td><td><code>trac #20479: add tests section</code>
</td></tr></table>
TicketdcoudertMon, 25 Apr 2016 13:26:21 GMT
https://trac.sagemath.org/ticket/20479#comment:5
https://trac.sagemath.org/ticket/20479#comment:5
<p>
Replying to <a class="ticket" href="https://trac.sagemath.org/ticket/20479#comment:3" title="Comment 3">jmantysalo</a>:
</p>
<blockquote class="citation">
<p>
References to corrected bugss should be in <code>TESTS</code> section.
</p>
</blockquote>
<p>
done
</p>
<blockquote class="citation">
<p>
But more importantly, how this <em>should</em> work? If I understood correctly (have not compiled yet), then this will change current behaviour when <code>vertices2=None</code>. This can surprise users.
</p>
</blockquote>
<p>
This is correct. Actually I did this patch because one of my colleague was surprized that the behavior of the method is different than what it claims to be.
Since it has not been reported before, I suspect that very few people are using this method.
I don't know if we have to follow a particular (and long) procedure for such case.
</p>
TicketjmantysaloMon, 25 Apr 2016 13:54:26 GMT
https://trac.sagemath.org/ticket/20479#comment:6
https://trac.sagemath.org/ticket/20479#comment:6
<p>
Replying to <a class="ticket" href="https://trac.sagemath.org/ticket/20479#comment:5" title="Comment 5">dcoudert</a>:
</p>
<blockquote class="citation">
<p>
Since it has not been reported before, I suspect that very few people are using this method.
I don't know if we have to follow a particular (and long) procedure for such case.
</p>
</blockquote>
<p>
We have deprecation policy, but it is hard to use in this case. Should we add a note-block? Maybe not.
</p>
<p>
Thinking more about this... If I ask neighboring states of Finland and Sweden (they are neighbors), I expect the answer to be Norway, Denmark and Russia only. Using that as analogy, I think that this can go on.
</p>
<p>
I will compile and test this later today.
</p>
TicketjmantysaloMon, 25 Apr 2016 15:58:19 GMTstatus changed; reviewer set
https://trac.sagemath.org/ticket/20479#comment:7
https://trac.sagemath.org/ticket/20479#comment:7
<ul>
<li><strong>status</strong>
changed from <em>needs_review</em> to <em>positive_review</em>
</li>
<li><strong>reviewer</strong>
set to <em>Jori Mäntysalo</em>
</li>
</ul>
<p>
Tests passed, documentation builds and is OK.
</p>
TicketdcoudertMon, 25 Apr 2016 17:04:38 GMT
https://trac.sagemath.org/ticket/20479#comment:8
https://trac.sagemath.org/ticket/20479#comment:8
<p>
Thank you for the review.
David.
</p>
TicketvbraunTue, 26 Apr 2016 12:58:37 GMTstatus, branch changed; resolution set
https://trac.sagemath.org/ticket/20479#comment:9
https://trac.sagemath.org/ticket/20479#comment:9
<ul>
<li><strong>status</strong>
changed from <em>positive_review</em> to <em>closed</em>
</li>
<li><strong>resolution</strong>
set to <em>fixed</em>
</li>
<li><strong>branch</strong>
changed from <em>u/dcoudert/20479</em> to <em>d35ce496637639f29294fa6c369f78caad401b46</em>
</li>
</ul>
Ticket