Giter VIP home page Giter VIP logo

Comments (2)

ResidentMario avatar ResidentMario commented on June 12, 2024

The following minimal hypothesis test can be used to check these cases:

import sys; sys.path.insert(0, '../')
import geoplot as gplt
import geoplot.crs as gcrs
import unittest
from hypothesis import given
import hypothesis.strategies as hyp
import geopandas as gpd
import matplotlib.pyplot as plt
import shapely

# (Valid) polygons.
polygonal_coordinate_lists = hyp.lists(hyp.tuples(x_point, y_point), min_size=3, unique=True)
polygon = hyp.builds(shapely.geometry.Polygon, polygonal_coordinate_lists)\
            .map(lambda poly: poly.buffer(0))\
            .filter(lambda poly: not poly.is_empty)\
            .map(lambda poly: poly.buffer(0))
polygon_lists = hyp.lists(polygon, min_size=1)
polygon_geoseries_many = hyp.builds(gpd.GeoSeries, polygon_lists)

# Projections
projections = hyp.sampled_from((None, gcrs.AlbersEqualArea()))


class TestPolyPlot(unittest.TestCase):

    @given(polygon_geoseries_many, projections)
    def test_point_plot(self, polygon_geoseries, projection):
        try:
            gplt.polyplot(polygon_geoseries, projection=projection)
        except:
            import pdb; pdb.set_trace()
            gplt.polyplot(polygon_geoseries, projection=projection)
        plt.close()

from geoplot.

ResidentMario avatar ResidentMario commented on June 12, 2024

Fixed the major extent issues. Remaining nuisance cases should be their own issue.

from geoplot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.