From f7c53dbff31bc22e766c4a80baa403d8b2b5cea2 Mon Sep 17 00:00:00 2001 From: JasonSteelmanCoder <132779005+JasonSteelmanCoder@users.noreply.github.com> Date: Sat, 18 Jan 2025 16:38:21 -0500 Subject: [PATCH] Correct documentation regarding possible transformations (#352) * 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. * clarify when 'O' is permissible Co-authored-by: Martin Fleischmann * clarify when 'O' is permissible --------- Co-authored-by: Martin Fleischmann --- esda/moran.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/esda/moran.py b/esda/moran.py index c1f3e2ed..ca357e9d 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, "U": untransformed + 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 @@ -422,7 +423,7 @@ class Moran_BV: # noqa: N801 Other options include "B": binary, "D": doubly-standardized, - "U": untransformed (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 @@ -806,7 +807,7 @@ class Moran_Rate(Moran): # noqa: N801 Other options include "B": binary, "D": doubly-standardized, - "U": untransformed (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 @@ -1042,7 +1043,7 @@ class Moran_Local: # noqa: N801 Other options include "B": binary, "D": doubly-standardized, - "U": untransformed (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 @@ -1473,7 +1474,7 @@ class Moran_Local_BV: # noqa: N801 Other options include "B": binary, "D": doubly-standardized, - "U": untransformed (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 @@ -1778,7 +1779,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 (applicable only if ``w`` is passed as ``W``), "V": variance-stabilizing. permutations : int number of random permutations for calculation of pseudo