Skip to content

Commit 185c4ac

Browse files
fix ordering (#25)
* fix ordering * ditch python 3.7 (not available on github actions macOS) --------- Co-authored-by: TANG ZHIXIONG <[email protected]>
1 parent 5a0f4a3 commit 185c4ac

File tree

5 files changed

+12
-6
lines changed

5 files changed

+12
-6
lines changed

.github/workflows/pip.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
fail-fast: false
1616
matrix:
1717
platform: [windows-latest, macos-latest, ubuntu-latest]
18-
python-version: ["3.7", "3.12", "pypy-3.9"]
18+
python-version: ["3.8", "3.12", "pypy-3.9"]
1919

2020
steps:
2121
- uses: actions/checkout@v4

docs/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@
5858
# built documents.
5959
#
6060
# The short X.Y version.
61-
version = '0.2.1'
61+
version = '0.2.2'
6262
# The full version, including alpha/beta/rc tags.
63-
release = '0.2.1'
63+
release = '0.2.2'
6464

6565
# The language for content autogenerated by Sphinx. Refer to documentation
6666
# for a list of supported languages.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ build-backend = "scikit_build_core.build"
55

66
[project]
77
name = "networkx_graph"
8-
version = "0.2.1"
8+
version = "0.2.2"
99
url = "https://github.com/cubao/networkx-graph"
1010
description = "Some customized graph algorithms"
1111
readme = "README.md"

src/main.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,11 @@ struct DiGraph
434434
for (auto &pair : bindings) {
435435
auto [itr, _] =
436436
ret.node2bindings.emplace(indexer_.id(pair.first), pair.second);
437-
std::sort(itr->second.begin(), itr->second.end());
437+
std::sort(itr->second.begin(), itr->second.end(),
438+
[](const auto &a, const auto &b) {
439+
return std::tie(std::get<0>(a), std::get<1>(a)) <
440+
std::tie(std::get<0>(b), std::get<1>(b));
441+
});
438442
}
439443
return ret;
440444
}

tests/test_basic.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def calculate_md5(filename, block_size=4096):
3232

3333

3434
def test_version():
35-
assert m.__version__ == "0.2.1"
35+
assert m.__version__ == "0.2.2"
3636

3737

3838
def test_add():
@@ -624,6 +624,8 @@ def test_routing():
624624
decoded["w2"][-1][-1]["num"] = 42
625625
assert obj["num"] == 42
626626

627+
G.encode_bindings({"road": [(1, 2, 5), (1, 2, "val2")]})
628+
627629
generator = G.shortest_paths_from("w1", cutoff=20.0)
628630
assert isinstance(generator, ShortestPathGenerator)
629631
dists = generator.destinations()

0 commit comments

Comments
 (0)