Skip to content

Commit 996a349

Browse files
authored
Merge pull request #2771 from cvvergara/issue-2770-improve-internal-functions
Issue 2770 improve internal functions
2 parents 49bf02b + 8f010b2 commit 996a349

File tree

16 files changed

+266
-174
lines changed

16 files changed

+266
-174
lines changed

NEWS.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,19 @@
88

99
### pgRouting 3.8.0 Release Notes
1010

11-
No Changes Yet
11+
**Changes on proposed functions**
12+
13+
* pgr_extractVertices
14+
15+
* Error messages adjustment.
16+
17+
* pgr_findCloseEdges
18+
19+
* Error messages adjustment.
20+
21+
* pgr_degree
22+
23+
* Error messages adjustment.
1224

1325
## pgRouting 3.7
1426

doc/src/release_notes.rst

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,25 @@ pgRouting 3.8
3939
pgRouting 3.8.0 Release Notes
4040
-------------------------------------------------------------------------------
4141

42-
No Changes Yet
42+
.. rubric:: Changes on proposed functions
43+
44+
* pgr_extractVertices
45+
46+
.. include:: pgr_extractVertices.rst
47+
:start-after: Version 3.8.0
48+
:end-before: .. rubric
49+
50+
* pgr_findCloseEdges
51+
52+
.. include:: pgr_findCloseEdges.rst
53+
:start-after: Version 3.8.0
54+
:end-before: .. rubric
55+
56+
* pgr_degree
57+
58+
.. include:: pgr_degree.rst
59+
:start-after: Version 3.8.0
60+
:end-before: .. rubric
4361

4462
pgRouting 3.7
4563
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

doc/topology/pgr_degree.rst

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,13 @@
2525

2626
.. rubric:: Availability
2727

28-
* Version 3.4.0
28+
.. rubric:: Version 3.8.0
2929

30-
* New proposed function.
30+
* Error messages adjustment.
31+
32+
.. rubric:: Version 3.4.0
33+
34+
* New proposed function.
3135

3236

3337
Description

doc/topology/pgr_extractVertices.rst

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,17 @@
2525

2626
.. rubric:: Availability
2727

28-
* Version 3.3.0
28+
.. rubric:: Version 3.8.0
2929

30-
* Classified as **proposed** function
30+
* Error messages adjustment.
3131

32-
* Version 3.0.0
32+
.. rubric:: Version 3.3.0
3333

34-
* New experimental function.
34+
* Function promoted to proposed.
35+
36+
.. rubric:: Version 3.0.0
37+
38+
* New experimental function.
3539

3640

3741
Description

doc/utilities/pgr_findCloseEdges.rst

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,13 @@
2020

2121
.. rubric:: Availability
2222

23-
* Version 3.4.0
23+
.. rubric:: Version 3.8.0
2424

25-
* New proposed function.
25+
* Error messages adjustment.
26+
27+
.. rubric:: Version 3.4.0
28+
29+
* New proposed function.
2630

2731
Description
2832
-------------------------------------------------------------------------------

locale/en/LC_MESSAGES/pgrouting_doc_strings.po

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgid ""
88
msgstr ""
99
"Project-Id-Version: pgRouting v3.8\n"
1010
"Report-Msgid-Bugs-To: \n"
11-
"POT-Creation-Date: 2025-02-27 18:35+0000\n"
11+
"POT-Creation-Date: 2025-02-27 23:12+0000\n"
1212
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1313
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1414
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -4404,7 +4404,19 @@ msgstr ""
44044404
msgid "pgRouting 3.8.0 Release Notes"
44054405
msgstr ""
44064406

4407-
msgid "No Changes Yet"
4407+
msgid "Changes on proposed functions"
4408+
msgstr ""
4409+
4410+
msgid "pgr_extractVertices"
4411+
msgstr ""
4412+
4413+
msgid "Error messages adjustment."
4414+
msgstr ""
4415+
4416+
msgid "pgr_findCloseEdges"
4417+
msgstr ""
4418+
4419+
msgid "pgr_degree"
44084420
msgstr ""
44094421

44104422
msgid "All releases"
@@ -10200,6 +10212,9 @@ msgid ""
1020010212
" of edges incident to the vertex."
1020110213
msgstr ""
1020210214

10215+
msgid "Version 3.8.0"
10216+
msgstr ""
10217+
1020310218
msgid "Calculates the degree of the vertices of an **undirected** graph"
1020410219
msgstr ""
1020510220

@@ -11451,9 +11466,6 @@ msgstr ""
1145111466
msgid "``pgr_extractVertices`` — Extracts the vertices information"
1145211467
msgstr ""
1145311468

11454-
msgid "Classified as **proposed** function"
11455-
msgstr ""
11456-
1145711469
msgid ""
1145811470
"This is an auxiliary function for extracting the vertex information of "
1145911471
"the set of edges of a graph."
@@ -15761,9 +15773,6 @@ msgstr ""
1576115773
msgid "Changes on the documentation to the following:"
1576215774
msgstr ""
1576315775

15764-
msgid "pgr_degree"
15765-
msgstr ""
15766-
1576715776
msgid "pgr_dijkstra"
1576815777
msgstr ""
1576915778

@@ -16155,9 +16164,6 @@ msgstr ""
1615516164
msgid "pgr_sequentialVertexColoring"
1615616165
msgstr ""
1615716166

16158-
msgid "pgr_extractVertices"
16159-
msgstr ""
16160-
1616116167
msgid "Traversal"
1616216168
msgstr ""
1616316169

locale/pot/pgrouting_doc_strings.pot

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgid ""
88
msgstr ""
99
"Project-Id-Version: pgRouting v3.8\n"
1010
"Report-Msgid-Bugs-To: \n"
11-
"POT-Creation-Date: 2025-02-27 18:35+0000\n"
11+
"POT-Creation-Date: 2025-02-27 23:12+0000\n"
1212
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1313
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1414
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -3928,7 +3928,19 @@ msgstr ""
39283928
msgid "pgRouting 3.8.0 Release Notes"
39293929
msgstr ""
39303930

3931-
msgid "No Changes Yet"
3931+
msgid "Changes on proposed functions"
3932+
msgstr ""
3933+
3934+
msgid "pgr_extractVertices"
3935+
msgstr ""
3936+
3937+
msgid "Error messages adjustment."
3938+
msgstr ""
3939+
3940+
msgid "pgr_findCloseEdges"
3941+
msgstr ""
3942+
3943+
msgid "pgr_degree"
39323944
msgstr ""
39333945

39343946
msgid "All releases"
@@ -8713,6 +8725,9 @@ msgstr ""
87138725
msgid "``pgr_degree`` — For each vertex in an undirected graph, return the count of edges incident to the vertex."
87148726
msgstr ""
87158727

8728+
msgid "Version 3.8.0"
8729+
msgstr ""
8730+
87168731
msgid "Calculates the degree of the vertices of an **undirected** graph"
87178732
msgstr ""
87188733

@@ -9745,9 +9760,6 @@ msgstr ""
97459760
msgid "``pgr_extractVertices`` — Extracts the vertices information"
97469761
msgstr ""
97479762

9748-
msgid "Classified as **proposed** function"
9749-
msgstr ""
9750-
97519763
msgid "This is an auxiliary function for extracting the vertex information of the set of edges of a graph."
97529764
msgstr ""
97539765

@@ -13201,9 +13213,6 @@ msgstr ""
1320113213
msgid "Changes on the documentation to the following:"
1320213214
msgstr ""
1320313215

13204-
msgid "pgr_degree"
13205-
msgstr ""
13206-
1320713216
msgid "pgr_dijkstra"
1320813217
msgstr ""
1320913218

@@ -13516,9 +13525,6 @@ msgstr ""
1351613525
msgid "pgr_sequentialVertexColoring"
1351713526
msgstr ""
1351813527

13519-
msgid "pgr_extractVertices"
13520-
msgstr ""
13521-
1352213528
msgid "Traversal"
1352313529
msgstr ""
1352413530

pgtap/topology/degree/edge_cases.pg

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
2020
BEGIN;
2121

2222
UPDATE edges SET cost = sign(cost), reverse_cost = sign(reverse_cost);
23-
SELECT CASE WHEN min_version('3.4.0') THEN plan(12) ELSE plan(1) END;
23+
SELECT CASE WHEN min_version('3.4.0') THEN plan(16) ELSE plan(1) END;
2424

2525

2626
CREATE OR REPLACE FUNCTION edge_cases()
@@ -59,11 +59,13 @@ BEGIN
5959
SELECT * FROM pgr_degree('edges','SELECT id, out_edges FROM vertices');
6060

6161
RETURN QUERY SELECT lives_ok('query_1', 'Good execution');
62-
RETURN QUERY SELECT throws_ok('query_2', 'P0001', 'Missing column', 'Incomlete data -> throws');
63-
RETURN QUERY SELECT throws_ok('query_3', 'P0001', 'Missing column', 'Incomlete data -> throws');
64-
RETURN QUERY SELECT throws_ok('query_4', 'P0001', 'Missing column', 'Incomlete data -> throws');
62+
RETURN QUERY SELECT column_missing('query_2', 'id');
63+
RETURN QUERY SELECT column_missing('query_3', 'in_edges');
64+
RETURN QUERY SELECT column_missing('query_4', 'id');
6565
RETURN QUERY SELECT lives_ok('query_5', 'Missing column out_edges but usable');
6666
RETURN QUERY SELECT lives_ok('query_5', 'Missing column in_edges but usable');
67+
RETURN QUERY SELECT wrong_relation($$SELECT * FROM pgr_degree('SELECT id FROM foo', 'SELECT * FROM vertices')$$, 'foo');
68+
RETURN QUERY SELECT wrong_relation($$SELECT * FROM pgr_degree('SELECT id FROM edges', 'SELECT * FROM bar')$$, 'bar');
6769

6870
PREPARE subedges AS
6971
SELECT id FROM edges WHERE id < 17;
@@ -90,12 +92,29 @@ BEGIN
9092
SELECT * FROM pgr_degree('subedges','SELECT id, out_edges FROM vertices');
9193

9294
RETURN QUERY SELECT lives_ok('query_7', 'Good execution');
93-
RETURN QUERY SELECT throws_ok('query_8', 'P0001', 'Missing column', 'Incomlete data -> throws');
94-
RETURN QUERY SELECT throws_ok('query_9', 'P0001', 'Missing column', 'Incomlete data -> throws');
95-
RETURN QUERY SELECT throws_ok('query_10', 'P0001', 'Missing column', 'Incomlete data -> throws');
95+
RETURN QUERY SELECT column_missing('query_8', 'id');
96+
RETURN QUERY SELECT column_missing('query_9', 'in_edges');
97+
RETURN QUERY SELECT column_missing('query_10', 'id');
9698
RETURN QUERY SELECT lives_ok('query_11', 'Missing column out_edges but usable');
9799
RETURN QUERY SELECT lives_ok('query_12', 'Missing column in_edges but usable');
98100

101+
PREPARE empty_vertices AS
102+
SELECT * FROM pgr_degree('SELECT id FROM edges', 'SELECT * FROM vertices WHERE id > 20');
103+
RETURN QUERY SELECT is_empty('empty_vertices', 'Empty vertices give empty result');
104+
105+
PREPARE empty_graph AS
106+
SELECT * FROM pgr_degree('SELECT id FROM edges WHERE id > 20', 'SELECT * FROM vertices') ORDER BY node;
107+
RETURN QUERY
108+
SELECT CASE WHEN min_version('3.8.0') THEN
109+
collect_tap(
110+
is_empty('empty_graph', 'is empty: Empty edges give 0 count on all vertices so none is in result')
111+
)
112+
ELSE
113+
collect_tap(
114+
results_eq('empty_graph', 'SELECT generate_series (1,17)::BIGINT, 0::BIGINT', 'Empty edges give 0 count')
115+
)
116+
END;
117+
99118
END;
100119
$BODY$
101120
LANGUAGE plpgsql;

0 commit comments

Comments
 (0)