From 2f8533e0530186bc8f3a1ed37c12c627fded5210 Mon Sep 17 00:00:00 2001 From: James Gaboardi Date: Mon, 13 Sep 2021 21:16:36 -0400 Subject: [PATCH 1/3] depwarning for libpysal geometries --- spaghetti/network.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/spaghetti/network.py b/spaghetti/network.py index 1d69de14..fdb88ff7 100644 --- a/spaghetti/network.py +++ b/spaghetti/network.py @@ -23,6 +23,11 @@ SAME_SEGMENT = (-0.1, -0.1) +dep_msg = "The next major release of pysal/spaghetti (2.0.0) will drop support for all ``libpysal.cg`` geometries." +warnings.simplefilter("always", DeprecationWarning) +warnings.warn(f"{dep_msg}", DeprecationWarning) + + class Network: """Spatially-constrained network representation and analytical functionality. Naming conventions are as follows, (1) arcs and From a051c7288c1067f3f570be3096b4900a1ab9d9bb Mon Sep 17 00:00:00 2001 From: James Gaboardi Date: Thu, 16 Sep 2021 21:25:49 -0400 Subject: [PATCH 2/3] more descriptive FutureWarning --- spaghetti/network.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/spaghetti/network.py b/spaghetti/network.py index fdb88ff7..a9b5d91e 100644 --- a/spaghetti/network.py +++ b/spaghetti/network.py @@ -23,9 +23,17 @@ SAME_SEGMENT = (-0.1, -0.1) -dep_msg = "The next major release of pysal/spaghetti (2.0.0) will drop support for all ``libpysal.cg`` geometries." -warnings.simplefilter("always", DeprecationWarning) -warnings.warn(f"{dep_msg}", DeprecationWarning) +dep_msg = "The next major release of pysal/spaghetti (2.0.0) will " +dep_msg += "drop support for all ``libpysal.cg`` geometries, which " +dep_msg += "includes using ``libpysal.cg`` geometries for network " +dep_msg += "instantiation and all internal computation. This change " +dep_msg += "is a first step in refactoring ``spaghetti`` that is " +dep_msg += "expected to result in dramatically reduced runtimes for " +dep_msg += "network instantiation and operations. Users currently " +dep_msg += "requiring network and point pattern input as ``libpysal.cg`` " +dep_msg += "geometries should prepare for this simply by converting " +dep_msg += "to ``shapely`` geometries." +warnings.warn(f"{dep_msg}", FutureWarning) class Network: From 3bc0e4e298b77a46225d662576f6a3e26aa931ef Mon Sep 17 00:00:00 2001 From: James Gaboardi Date: Sun, 19 Sep 2021 11:11:59 -0400 Subject: [PATCH 3/3] Update spaghetti/network.py Co-authored-by: Martin Fleischmann --- spaghetti/network.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/spaghetti/network.py b/spaghetti/network.py index a9b5d91e..4d098b2b 100644 --- a/spaghetti/network.py +++ b/spaghetti/network.py @@ -23,16 +23,16 @@ SAME_SEGMENT = (-0.1, -0.1) -dep_msg = "The next major release of pysal/spaghetti (2.0.0) will " -dep_msg += "drop support for all ``libpysal.cg`` geometries, which " -dep_msg += "includes using ``libpysal.cg`` geometries for network " -dep_msg += "instantiation and all internal computation. This change " -dep_msg += "is a first step in refactoring ``spaghetti`` that is " -dep_msg += "expected to result in dramatically reduced runtimes for " -dep_msg += "network instantiation and operations. Users currently " -dep_msg += "requiring network and point pattern input as ``libpysal.cg`` " -dep_msg += "geometries should prepare for this simply by converting " -dep_msg += "to ``shapely`` geometries." +dep_msg = ( + "The next major release of pysal/spaghetti (2.0.0) will " + "drop support for all ``libpysal.cg`` geometries. This change " + "is a first step in refactoring ``spaghetti`` that is " + "expected to result in dramatically reduced runtimes for " + "network instantiation and operations. Users currently " + "requiring network and point pattern input as ``libpysal.cg`` " + "geometries should prepare for this simply by converting " + "to ``shapely`` geometries." + ) warnings.warn(f"{dep_msg}", FutureWarning)