[PATCH NNGT v2] Geometry: support Shapely 1.8+
Export this patch
From: Tanguy Fardet <tanguyfardet@protonmail.com>
---
nngt/geometry | 2 +-
nngt/plot/plt_networks.py | 9 ++++-----
testing/test_io.py | 5 +++--
3 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/nngt/geometry b/nngt/geometry
index 4c0bedd..9d0c4da 160000
--- a/nngt/geometry
+++ b/nngt/geometry
@@ -1 +1 @@
-Subproject commit 4c0bedd21a4af0c1f80aae58a7ef16b1ebd7d54f
+Subproject commit 9d0c4da96b184c36f8b4fbdccc84ac4dafa2285f
diff --git a/nngt/plot/plt_networks.py b/nngt/plot/plt_networks.py
index 9b8915e..669c995 100755
--- a/nngt/plot/plt_networks.py
+++ b/nngt/plot/plt_networks.py
@@ -1502,12 +1502,11 @@ def library_draw(network, nsize="total-degree", ncolor=None, nshape="o",
eids = [network.edge_id(e) for e in restrict_edges]
graph = network.graph.subgraph_edges(eids, delete_vertices=False)
- if igv > '0.9.6':
- igraph.plot(graph, target=axis, **visual_style)
- else:
- graph_artist = GraphArtist(graph, axis, **visual_style)
+ # matplotlib interface is not working as of November 2021
+ # igraph.plot(graph, target=axis, **visual_style)
- axis.artists.append(graph_artist)
+ graph_artist = GraphArtist(graph, axis, **visual_style)
+ axis.artists.append(graph_artist)
if "title" in kwargs:
axis.set_title(kwargs["title"])
diff --git a/testing/test_io.py b/testing/test_io.py
index c5bc047..c751d81 100644
--- a/testing/test_io.py
+++ b/testing/test_io.py
@@ -278,10 +278,11 @@ def test_spatial():
h = nngt.load_from_file(gfilename, fmt=fmt)
assert np.all(np.isclose(g.get_positions(), h.get_positions()))
- assert g.shape.almost_equals(h.shape)
+ assert g.shape.normalize().almost_equals(h.shape.normalize(), 1e-5)
for name, area in g.shape.areas.items():
- assert area.almost_equals(h.shape.areas[name])
+ assert area.normalize().almost_equals(
+ h.shape.areas[name].normalize(), 1e-5)
assert area.properties == h.shape.areas[name].properties
--
2.32.0
NNGT/patches/.build.yml: SUCCESS in 28m30s
[Geometry: support Shapely 1.8+][0] v2 from [~tfardet][1]
[0]: https://lists.sr.ht/~tfardet/nngt-developers/patches/26534
[1]: mailto:tanguyfardet@protonmail.com
✓ #628251 SUCCESS NNGT/patches/.build.yml https://builds.sr.ht/~tfardet/job/628251