pysal / mapclassify

Classification schemes for choropleth mapping.
https://pysal.org/mapclassify
BSD 3-Clause "New" or "Revised" License
139 stars 32 forks source link

doctest failures [2024-06-23] #217

Closed jGaboardi closed 3 months ago

jGaboardi commented 3 months ago

Seeing doctest failures on Windows CI. Seems to simply be numpy typing issue, similar to what we saw over in spaghetti. Here the differ is int vs. int23.

================================== FAILURES ===================================
____________________ [doctest] mapclassify.classifiers.bin ____________________
[gw2] win32 -- Python 3.11.9 C:\Users\runneradmin\micromamba\envs\test\python.exe
359     Examples
360     --------
361 
362     >>> import numpy
363     >>> import mapclassify
364     >>> numpy.random.seed(1)
365     >>> x = numpy.random.randint(2, 20, (10, 3))
366     >>> bins = [10, 15, 20]
367     >>> b = mapclassify.classifiers.bin(x, bins)
368     >>> x
Differences (unified diff with -expected +actual):
    @@ -8,3 +8,3 @@
            [19,  2, 15],
            [11, 11,  9],
    -       [ 3,  2, 19]])
    +       [ 3,  2, 19]], dtype=int32)

D:\a\mapclassify\mapclassify\mapclassify\classifiers.py:368: DocTestFailure
___________________ [doctest] mapclassify.classifiers.binC ____________________
[gw2] win32 -- Python 3.11.9 C:\Users\runneradmin\micromamba\envs\test\python.exe
283 
284     Examples
285     --------
286 
287     >>> import numpy
288     >>> import mapclassify
289     >>> numpy.random.seed(1)
290     >>> x = numpy.random.randint(2, 8, (10, 3))
291     >>> bins = list(range(2, 8))
292     >>> x
Differences (unified diff with -expected +actual):
    @@ -8,3 +8,3 @@
            [4, 6, 7],
            [4, 6, 3],
    -       [3, 2, 7]])
    +       [3, 2, 7]], dtype=int32)

D:\a\mapclassify\mapclassify\mapclassify\classifiers.py:292: DocTestFailure
jGaboardi commented 3 months ago

resolves via #219 , #220