From 4a81710749ac9cd03506cc68c253a3c1e0d51e97 Mon Sep 17 00:00:00 2001 From: Rafa de la Torre Date: Thu, 22 Feb 2018 16:00:41 +0100 Subject: [PATCH] Upgrade pysal to version 1.14.3 This solves a problem with the Markov analysis. Otherwise, with some inputs it gives the following error: ``` Analysis A2 failed: ValueError: operands could not be broadcast together with shapes (5) (3) ``` The stack trace is the following: ``` ERROR: ValueError: operands could not be broadcast together with shapes (5) (2) CONTEXT: Traceback (most recent call last): PL/Python function "cdb_spatialmarkovtrend", line 7, in return markov.spatial_trend(subquery, time_cols, num_classes, w_type, num_ngbrs, permutations, geom_col, id_col) PL/Python function "cdb_spatialmarkovtrend", line 76, in spatial_trend PL/Python function "cdb_spatialmarkovtrend", line 416, in __init__ PL/Python function "cdb_spatialmarkovtrend", line 498, in _mn_test PL/Python function "cdb_spatialmarkovtrend", line 526, in _ssmnp_test PL/Python function "cdb_spatialmarkovtrend" ``` and here is the line where it actually fails: https://github.com/pysal/pysal/blob/v1.11.2/pysal/spatial_dynamics/markov.py#L526 In v1.14.3, the `shtest` is opt-in. So this gives us a chance to curate data if we wanted to apply that test, optionally, instead of crashing: https://github.com/pysal/pysal/blob/v1.14.3/pysal/spatial_dynamics/markov.py#L490 --- src/py/crankshaft/requirements.txt | 2 +- src/py/crankshaft/setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/py/crankshaft/requirements.txt b/src/py/crankshaft/requirements.txt index 3f50cd7..88c0a9e 100644 --- a/src/py/crankshaft/requirements.txt +++ b/src/py/crankshaft/requirements.txt @@ -1,5 +1,5 @@ joblib==0.8.3 numpy==1.6.1 scipy==0.14.0 -pysal==1.11.2 +pysal==1.14.3 scikit-learn==0.14.1 diff --git a/src/py/crankshaft/setup.py b/src/py/crankshaft/setup.py index cd8ad99..ffbdc19 100644 --- a/src/py/crankshaft/setup.py +++ b/src/py/crankshaft/setup.py @@ -41,7 +41,7 @@ setup( # The choice of component versions is dictated by what's # provisioned in the production servers. # IMPORTANT NOTE: please don't change this line. Instead issue a ticket to systems for evaluation. - install_requires=['joblib==0.8.3', 'numpy==1.6.1', 'scipy==0.14.0', 'pysal==1.11.2', 'scikit-learn==0.14.1'], + install_requires=['joblib==0.8.3', 'numpy==1.6.1', 'scipy==0.14.0', 'pysal==1.14.3', 'scikit-learn==0.14.1'], requires=['pysal', 'numpy', 'sklearn'],