From c375d5d8f5704120d1b26d57b4cee47911400847 Mon Sep 17 00:00:00 2001 From: tsubramanian Date: Sat, 20 May 2023 20:55:57 +0530 Subject: [PATCH 1/6] Update util_grabdata.py --- utool/util_grabdata.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utool/util_grabdata.py b/utool/util_grabdata.py index 2d91fab9..2063b97a 100755 --- a/utool/util_grabdata.py +++ b/utool/util_grabdata.py @@ -618,7 +618,7 @@ def split_archive_ext(path): 'ada2.jpg': 'http://i.imgur.com/zHOpTCb.jpg', 'ada.jpg': 'http://i.imgur.com/iXNf4Me.jpg', 'lena.png': 'http://i.imgur.com/JGrqMnV.png', # depricate lena - 'astro.png': 'https://i.imgur.com/KXhKM72.png', # Use instead of lena + 'astro.png': 'http://i.imgur.com/KXhKM72.png', # Use instead of lena 'carl.jpg': 'http://i.imgur.com/flTHWFD.jpg', 'easy1.png': 'http://i.imgur.com/Qqd0VNq.png', 'easy2.png': 'http://i.imgur.com/BDP8MIu.png', From b7af6340df4dbb53203dd3c00073b053ca00549a Mon Sep 17 00:00:00 2001 From: tsubramanian Date: Sun, 21 May 2023 18:37:22 +0530 Subject: [PATCH 2/6] Update util_grabdata.py replaced the Cthulhu URL instead of Imgur --- utool/util_grabdata.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/utool/util_grabdata.py b/utool/util_grabdata.py index 2063b97a..41b2e98a 100755 --- a/utool/util_grabdata.py +++ b/utool/util_grabdata.py @@ -613,20 +613,20 @@ def split_archive_ext(path): TESTIMG_URL_DICT = { - 'grace.jpg': 'http://i.imgur.com/rgQyu7r.jpg', - 'jeff.png': 'http://i.imgur.com/l00rECD.png', - 'ada2.jpg': 'http://i.imgur.com/zHOpTCb.jpg', - 'ada.jpg': 'http://i.imgur.com/iXNf4Me.jpg', - 'lena.png': 'http://i.imgur.com/JGrqMnV.png', # depricate lena - 'astro.png': 'http://i.imgur.com/KXhKM72.png', # Use instead of lena - 'carl.jpg': 'http://i.imgur.com/flTHWFD.jpg', - 'easy1.png': 'http://i.imgur.com/Qqd0VNq.png', - 'easy2.png': 'http://i.imgur.com/BDP8MIu.png', - 'easy3.png': 'http://i.imgur.com/zBcm5mS.png', - 'hard3.png': 'http://i.imgur.com/ST91yBf.png', - 'zebra.png': 'http://i.imgur.com/58hbGcd.png', - 'star.png': 'http://i.imgur.com/d2FHuIU.png', - 'patsy.jpg': 'http://i.imgur.com/C1lNRfT.jpg', + 'grace.jpg': 'https://cthulhu.dyn.wildme.io/public/testimgs/rgQyu7r.jpg', + 'jeff.png': 'https://cthulhu.dyn.wildme.io/public/testimgs/l00rECD.png', + 'ada2.jpg': 'https://cthulhu.dyn.wildme.io/public/testimgs/zHOpTCb.jpg', + 'ada.jpg': 'https://cthulhu.dyn.wildme.io/public/testimgs/iXNf4Me.jpg', + 'lena.png': 'https://cthulhu.dyn.wildme.io/public/testimgs/JGrqMnV.png', # depricate lena + 'astro.png': 'https://cthulhu.dyn.wildme.io/public/testimgs/KXhKM72.png', # Use instead of lena + 'carl.jpg': 'https://cthulhu.dyn.wildme.io/public/testimgs/flTHWFD.jpg', + 'easy1.png': 'https://cthulhu.dyn.wildme.io/public/testimgs/Qqd0VNq.png', + 'easy2.png': 'https://cthulhu.dyn.wildme.io/public/testimgs/BDP8MIu.png', + 'easy3.png': 'https://cthulhu.dyn.wildme.io/public/testimgs/zBcm5mS.png', + 'hard3.png': 'https://cthulhu.dyn.wildme.io/public/testimgs/ST91yBf.png', + 'zebra.png': 'https://cthulhu.dyn.wildme.io/public/testimgs/58hbGcd.png', + 'star.png': 'https://cthulhu.dyn.wildme.io/public/testimgs/d2FHuIU.png', + 'patsy.jpg': 'https://cthulhu.dyn.wildme.io/public/testimgs/C1lNRfT.jpg', } From c9597215d1b7fc827212b376dddd305be87f5a39 Mon Sep 17 00:00:00 2001 From: tsubramanian Date: Sun, 21 May 2023 18:51:16 +0530 Subject: [PATCH 3/6] Update runtime.txt numpy==1.20 --- requirements/runtime.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/runtime.txt b/requirements/runtime.txt index 4d01686c..7b50bbff 100644 --- a/requirements/runtime.txt +++ b/requirements/runtime.txt @@ -2,7 +2,7 @@ delorean gitpython lockfile networkx -numpy +numpy==1.20 opencv-contrib-python-headless ordered-set pandas From 5b00211425583d011afced2ef1a70502cdeb9ff6 Mon Sep 17 00:00:00 2001 From: tsubramanian Date: Sun, 21 May 2023 18:58:32 +0530 Subject: [PATCH 4/6] Update runtime.txt networkx>=1.11,<2 --- requirements/runtime.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/runtime.txt b/requirements/runtime.txt index 7b50bbff..b9b570c8 100644 --- a/requirements/runtime.txt +++ b/requirements/runtime.txt @@ -1,7 +1,7 @@ delorean gitpython lockfile -networkx +networkx>=1.11,<2 numpy==1.20 opencv-contrib-python-headless ordered-set From 01ffcd10af1c299319eb1e103545b5164d713fc8 Mon Sep 17 00:00:00 2001 From: tsubramanian Date: Sun, 21 May 2023 19:29:10 +0530 Subject: [PATCH 5/6] Update util_graph.py fix the missing "import networkx as nx" import in testcases --- utool/util_graph.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/utool/util_graph.py b/utool/util_graph.py index 26282d1c..b444f4b1 100644 --- a/utool/util_graph.py +++ b/utool/util_graph.py @@ -91,6 +91,7 @@ def nx_transitive_reduction(G, mode=1): >>> # DISABLE_DOCTEST >>> from utool.util_graph import * # NOQA >>> import utool as ut + >>> import networkx as nx >>> G = nx.DiGraph([('a', 'b'), ('a', 'c'), ('a', 'e'), >>> ('a', 'd'), ('b', 'd'), ('c', 'e'), >>> ('d', 'e'), ('c', 'e'), ('c', 'd')]) @@ -265,6 +266,7 @@ def nx_dag_node_rank(graph, nodes=None): >>> # ENABLE_DOCTEST >>> from utool.util_graph import * # NOQA >>> import utool as ut + >>> import networkx as nx >>> adj_dict = {0: [5], 1: [5], 2: [1], 3: [4], 4: [0], 5: [], 6: [4], 7: [9], 8: [6], 9: [1]} >>> nodes = [2, 1, 5] >>> f_graph = ut.nx_from_adj_dict(adj_dict, nx.DiGraph) @@ -381,6 +383,7 @@ def nx_edges_between( >>> # ENABLE_DOCTEST >>> from utool.util_graph import * # NOQA >>> import utool as ut + >>> import networkx as nx >>> edges = [ >>> (1, 2), (2, 3), (3, 4), (4, 1), (4, 3), # cc 1234 >>> (1, 5), (7, 2), (5, 1), # cc 567 / 5678 @@ -574,6 +577,7 @@ def nx_delete_node_attr(graph, name, nodes=None): Example: >>> from utool.util_graph import * # NOQA >>> import utool as ut + >>> import networkx as nx >>> G = nx.karate_club_graph() >>> nx.set_node_attributes(G, name='foo', values='bar') >>> datas = nx.get_node_attributes(G, 'club') @@ -618,6 +622,7 @@ def nx_delete_edge_attr(graph, name, edges=None): Example: >>> from utool.util_graph import * # NOQA >>> import utool as ut + >>> import networkx as nx >>> G = nx.karate_club_graph() >>> nx.set_edge_attributes(G, name='spam', values='eggs') >>> nx.set_edge_attributes(G, name='foo', values='bar') @@ -633,6 +638,7 @@ def nx_delete_edge_attr(graph, name, edges=None): Example: >>> from utool.util_graph import * # NOQA >>> import utool as ut + >>> import networkx as nx >>> G = nx.MultiGraph() >>> G.add_edges_from([(1, 2), (2, 3), (3, 4), (4, 5), (4, 5), (1, 2)]) >>> nx.set_edge_attributes(G, name='spam', values='eggs') @@ -795,6 +801,7 @@ def nx_gen_node_attrs( >>> # ENABLE_DOCTEST >>> from utool.util_graph import * # NOQA >>> import utool as ut + >>> import networkx as nx >>> G = nx.Graph([(1, 2), (2, 3)]) >>> nx.set_node_attributes(G, name='part', values={1: 'bar', 3: 'baz'}) >>> nodes = [1, 2, 3, 4] @@ -816,6 +823,7 @@ def nx_gen_node_attrs( >>> # ALL CASES >>> from utool.util_graph import * # NOQA >>> import utool as ut + >>> import networkx as nx >>> G = nx.Graph([(1, 2), (2, 3)]) >>> nx.set_node_attributes(G, name='full', values={1: 'A', 2: 'B', 3: 'C'}) >>> nx.set_node_attributes(G, name='part', values={1: 'bar', 3: 'baz'}) @@ -968,6 +976,7 @@ def nx_gen_edge_attrs( >>> # ENABLE_DOCTEST >>> from utool.util_graph import * # NOQA >>> import utool as ut + >>> import networkx as nx >>> G = nx.Graph([(1, 2), (2, 3), (3, 4)]) >>> nx.set_edge_attributes(G, name='part', values={(1, 2): 'bar', (2, 3): 'baz'}) >>> edges = [(1, 2), (2, 3), (3, 4), (4, 5)] @@ -1186,6 +1195,7 @@ def testdata_graph(): >>> # DISABLE_DOCTEST >>> from utool.util_graph import * # NOQA >>> import utool as ut + >>> import networkx as nx >>> (graph, G) = testdata_graph() >>> import wbia.plottool as pt >>> ut.ensureqt() @@ -1290,6 +1300,7 @@ def paths_to_root(tablename, root, child_to_parents): >>> # ENABLE_DOCTEST >>> from utool.util_graph import * # NOQA >>> import utool as ut + >>> import networkx as nx >>> child_to_parents = { >>> 'chip': ['dummy_annot'], >>> 'chipmask': ['dummy_annot'], @@ -1594,6 +1605,7 @@ def simplify_graph(graph): >>> # ENABLE_DOCTEST >>> from utool.util_graph import * # NOQA >>> import utool as ut + >>> import networkx as nx >>> graph = nx.DiGraph([('a', 'b'), ('a', 'c'), ('a', 'e'), >>> ('a', 'd'), ('b', 'd'), ('c', 'e'), >>> ('d', 'e'), ('c', 'e'), ('c', 'd')]) @@ -2135,6 +2147,7 @@ def approx_min_num_components(nodes, negative_edges): >>> # ENABLE_DOCTEST >>> from utool.util_graph import * # NOQA >>> import utool as ut + >>> import networkx as nx >>> nodes = [1, 2, 3, 4, 5, 6, 7, 8, 9] >>> edges = [(1, 2), (2, 3), (3, 1), >>> (4, 5), (5, 6), (6, 4), @@ -2283,6 +2296,7 @@ def mincost_diameter_augment(graph, max_cost, candidates=None, weight=None, cost >>> # ENABLE_DOCTEST >>> from utool.util_graph import * # NOQA >>> import utool as ut + >>> import networkx as nx >>> graph = nx.Graph() >>> if nx.__version__.startswith('1'): >>> nx.add_path = nx.Graph.add_path From 43aa476ec42229c630feeeb23c18eb20e6a71505 Mon Sep 17 00:00:00 2001 From: tsubramanian Date: Sun, 21 May 2023 19:36:17 +0530 Subject: [PATCH 6/6] Update runtime.txt networkx version moved to 2.5.1 to avoid the gcd import errors --- requirements/runtime.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/runtime.txt b/requirements/runtime.txt index b9b570c8..b226bf00 100644 --- a/requirements/runtime.txt +++ b/requirements/runtime.txt @@ -1,7 +1,7 @@ delorean gitpython lockfile -networkx>=1.11,<2 +networkx==2.5.1 numpy==1.20 opencv-contrib-python-headless ordered-set