Make behaviour of `DigraphRemoveEdge{s}` consistent when removing no edges
Added an additional method to preserve properties in the case of empty removals.
This addresses issue #260. (Note from Wilf: currently only partially.)
Oh wait, what is the relationship between this PR and #338?
Oh wait, what is the relationship between this PR and #338?
this request should have been an update to #338 but as it hasn't updated it and comments have been left here I have closed #338.
@Peter-Ing I agree with @wilfwilson. I think the intended changes would be the following:
if digraph is immutable:
-
DigraphRemoveEdges(digraph, [ ])returnsdigraph -
DigraphRemoveEdge(digraph, [ ])gives the current error (the argument is not valid) -
DigraphRemoveEdges(digraph, [[src, ran]])returns an immutable copy ofdigraphonly when[src, ran]is valid. If[src, ran]is not valid, then the function could either give an error, or just returndigraph(i.e. not a copy) -
DigraphRemoveEdge(digraph, [src, ran])returns an immutable copy ofdigraphonly when[src, ran]is valid. If[src, ran]is not valid, then the function could either give an error, or just returndigraph(i.e. not a copy)
I'm not sure which is preferable: giving an error or just returning digraph and doing nothing. The latter would be more consistent with the current behaviour, but the former would probably be more helpful. Any thoughts?
I tend to prefer the former kind of behaviour, I think it is what most people (or at least I) would expect. The latter kind of behaviour seems like it's done for optimisation, letting you reduce code (not having a separate existence check first, in some cases) and save time (by not twice checking whether an edge exists ). Unless users ask for that kind of behaviour, I don't think we should proactively offer it.
Codecov Report
Merging #340 (3b09b45) into master (514f5c3) will decrease coverage by
1.67%. The diff coverage is100.00%.
@@ Coverage Diff @@
## master #340 +/- ##
==========================================
- Coverage 96.98% 95.31% -1.68%
==========================================
Files 45 50 +5
Lines 12635 13038 +403
==========================================
+ Hits 12254 12427 +173
- Misses 381 611 +230
| Impacted Files | Coverage Δ | |
|---|---|---|
| gap/oper.gi | 98.37% <100.00%> (+<0.01%) |
:arrow_up: |
| src/bitarray.c | 93.33% <0.00%> (-1.91%) |
:arrow_down: |
| gap/attr.gi | 99.31% <0.00%> (-0.69%) |
:arrow_down: |
| src/planar.c | 93.75% <0.00%> (-0.37%) |
:arrow_down: |
| src/perms.c | 77.77% <0.00%> (-0.35%) |
:arrow_down: |
| src/homos-graphs.c | 98.66% <0.00%> (-0.27%) |
:arrow_down: |
| src/homos.c | 99.08% <0.00%> (-0.07%) |
:arrow_down: |
| src/cliques.c | 99.26% <0.00%> (-0.04%) |
:arrow_down: |
| gap/attr.gd | 100.00% <0.00%> (ø) |
|
| src/perms.h | 100.00% <0.00%> (ø) |
|
| ... and 11 more |
Stale pull request message