geopandas: TST: maplassify test broken
I suppose the recent mapclassify release now produces different output for some of the classifications, which broke our tests because we are checking the exact legend content (which is based on the mapclassify result).
See eg https://travis-ci.org/geopandas/geopandas/jobs/551597804, which gives:
_________________ TestMapclassifyPlotting.test_negative_legend _________________
self = <geopandas.tests.test_plotting.TestMapclassifyPlotting object at 0x7f30544255c0>
def test_negative_legend(self):
ax = self.df.plot(column='NEGATIVES', scheme='FISHER_JENKS', k=3,
cmap='OrRd', legend=True)
labels = [t.get_text() for t in ax.get_legend().get_texts()]
expected = [u'-10.00 - -3.41', u'-3.41 - 3.30', u'3.30 - 10.00']
> assert labels == expected
E AssertionError: assert ['-10.00 - -6...6.02 - 10.00'] == ['-10.00 - -3....3.30 - 10.00']
E At index 0 diff: '-10.00 - -6.02' != '-10.00 - -3.41'
E Left contains 2 more items, first extra item: '2.05 - 6.02'
E Full diff:
E + ['-10.00 - -3.41', '-3.41 - 3.30', '3.30 - 10.00']
E - ['-10.00 - -6.02',
E - '-6.02 - -1.93',
E - '-1.93 - 2.05',
E - '2.05 - 6.02',
E - '6.02 - 10.00']
geopandas/tests/test_plotting.py:425: AssertionError
cc @ljwolf
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 19 (19 by maintainers)
I did run it locally with mapclassify 2.1.1 and all the tests in geopandas pass. Because of the rewrite,
getspec(schemes[scheme].__init__)
should no longer returnmapclassify.classifiers.DeprecationHelper
.Thanks for this work. This fixes our tests and import of classifiers, but we will not be able to provide any deprecation period. It just cutoff all renamed classifiers, because we are checking the validity of passed
scheme
argument againstmapclassify.classifiers.CLASSIFIERS
. I would rather do some additional work on our side to keep deprecation warning for some time (in line with mapclassify). Like transform inputs likeFisher_Jenks
toFisherJenks
while raising deprecation warning. That seems to be the cleanest solution for now. @jorisvandenbossche what do you think?