question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TST: maplassify test broken

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:19 (19 by maintainers)

github_iconTop GitHub Comments

1reaction
sjsreycommented, Jun 28, 2019

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 return mapclassify.classifiers.DeprecationHelper.

1reaction
martinfleiscommented, Jun 28, 2019

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 against mapclassify.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 like Fisher_Jenks to FisherJenks while raising deprecation warning. That seems to be the cleanest solution for now. @jorisvandenbossche what do you think?

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found