From 049151640946ebdbb4307606b57746961e9f26f2 Mon Sep 17 00:00:00 2001 From: JasonSteelmanCoder <132779005+JasonSteelmanCoder@users.noreply.github.com> Date: Wed, 6 Nov 2024 09:47:27 -0500 Subject: [PATCH 1/3] Correct documentation Setting transformation to "U" causes an "unsupported weights transformation" exception because "U" is not an accepted parameter of the set_transform method of the libpysal.weights.W class. The correct argument is "O", which is described in the libpysal.weights.W documentation as "Restore original transformation (from instantiation)". I've updated the documentation to reflect that. --- esda/moran.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/esda/moran.py b/esda/moran.py index 86a3e11..a0e2012 100644 --- a/esda/moran.py +++ b/esda/moran.py @@ -67,7 +67,7 @@ class Moran: transformation : string weights transformation, default is row-standardized "r". Other options include "B": binary, "D": - doubly-standardized, "U": untransformed + doubly-standardized, "O": restore original transformation (general weights), "V": variance-stabilizing. permutations : int number of random permutations for calculation of @@ -337,7 +337,7 @@ class Moran_BV: # noqa: N801 Other options include "B": binary, "D": doubly-standardized, - "U": untransformed (general weights), + "O": restore original transformation (general weights), "V": variance-stabilizing. permutations : int number of random permutations for calculation of pseudo @@ -655,7 +655,7 @@ class Moran_Rate(Moran): # noqa: N801 Other options include "B": binary, "D": doubly-standardized, - "U": untransformed (general weights), + "O": restore original transformation (general weights), "V": variance-stabilizing. two_tailed : boolean If True (default), analytical p-values for Moran's I are @@ -889,7 +889,7 @@ class Moran_Local: # noqa: N801 Other options include "B": binary, "D": doubly-standardized, - "U": untransformed (general weights), + "O": restore original transformation (general weights), "V": variance-stabilizing. permutations : int number of random permutations for calculation of pseudo @@ -1263,7 +1263,7 @@ class Moran_Local_BV: # noqa: N801 Other options include "B": binary, "D": doubly-standardized, - "U": untransformed (general weights), + "O": restore original transformation (general weights), "V": variance-stabilizing. permutations : int number of random permutations for calculation of pseudo @@ -1533,7 +1533,7 @@ class Moran_Local_Rate(Moran_Local): # noqa: N801 Other options include "B": binary, "D": doubly-standardized, - "U": untransformed (general weights), + "O": restore original transformation (general weights), "V": variance-stabilizing. permutations : int number of random permutations for calculation of pseudo From 29da6a44607d2b9830a3b6a466264c3a957e0bc8 Mon Sep 17 00:00:00 2001 From: JasonSteelmanCoder <132779005+JasonSteelmanCoder@users.noreply.github.com> Date: Tue, 12 Nov 2024 08:30:44 -0500 Subject: [PATCH 2/3] clarify when 'O' is permissible Co-authored-by: Martin Fleischmann --- esda/moran.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/esda/moran.py b/esda/moran.py index a0e2012..3cabd57 100644 --- a/esda/moran.py +++ b/esda/moran.py @@ -67,7 +67,8 @@ class Moran: transformation : string weights transformation, default is row-standardized "r". Other options include "B": binary, "D": - doubly-standardized, "O": restore original transformation + doubly-standardized, "O": restore original transformation + (applicable only if ``w`` is passed as ``W``) (general weights), "V": variance-stabilizing. permutations : int number of random permutations for calculation of From c47fd36702f388b547d85792d869f0f2350cbffa Mon Sep 17 00:00:00 2001 From: JasonSteelmanCoder <132779005+JasonSteelmanCoder@users.noreply.github.com> Date: Tue, 12 Nov 2024 15:48:41 +0000 Subject: [PATCH 3/3] clarify when 'O' is permissible --- esda/moran.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/esda/moran.py b/esda/moran.py index 3cabd57..457cc36 100644 --- a/esda/moran.py +++ b/esda/moran.py @@ -338,7 +338,7 @@ class Moran_BV: # noqa: N801 Other options include "B": binary, "D": doubly-standardized, - "O": restore original transformation (general weights), + "O": restore original transformation (applicable only if ``w`` is passed as ``W``), "V": variance-stabilizing. permutations : int number of random permutations for calculation of pseudo @@ -656,7 +656,7 @@ class Moran_Rate(Moran): # noqa: N801 Other options include "B": binary, "D": doubly-standardized, - "O": restore original transformation (general weights), + "O": restore original transformation (applicable only if ``w`` is passed as ``W``), "V": variance-stabilizing. two_tailed : boolean If True (default), analytical p-values for Moran's I are @@ -890,7 +890,7 @@ class Moran_Local: # noqa: N801 Other options include "B": binary, "D": doubly-standardized, - "O": restore original transformation (general weights), + "O": restore original transformation (applicable only if ``w`` is passed as ``W``), "V": variance-stabilizing. permutations : int number of random permutations for calculation of pseudo @@ -1264,7 +1264,7 @@ class Moran_Local_BV: # noqa: N801 Other options include "B": binary, "D": doubly-standardized, - "O": restore original transformation (general weights), + "O": restore original transformation (applicable only if ``w`` is passed as ``W``), "V": variance-stabilizing. permutations : int number of random permutations for calculation of pseudo @@ -1534,7 +1534,7 @@ class Moran_Local_Rate(Moran_Local): # noqa: N801 Other options include "B": binary, "D": doubly-standardized, - "O": restore original transformation (general weights), + "O": restore original transformation (applicable only if ``w`` is passed as ``W``), "V": variance-stabilizing. permutations : int number of random permutations for calculation of pseudo