xarray-contrib / xvec

Vector data cubes for Xarray
https://xvec.readthedocs.io
MIT License
101 stars 9 forks source link

ENH: implement __repr__ for the index #65

Closed martinfleis closed 6 months ago

martinfleis commented 6 months ago

It now shows a nice repr like this instead of a memory location

In [7]: pop1960.xindexes["county"]
Out[7]: 
GeometryIndex(
    [<POLYGON ((-95.343 48.547, -95.341 48.715, -95.094 48.717, -95.095 48.912, -...>
     <POLYGON ((-118.851 47.95, -118.847 48.478, -118.869 48.479, -118.87 48.647,...>
     <POLYGON ((-117.438 48.044, -117.541 48.043, -117.536 47.79, -117.607 47.798...>
     <POLYGON ((-118.971 47.939, -118.973 47.96, -118.953 47.989, -118.953 48.02,...>
     ...
     <POLYGON ((-107.195 34.584, -107.718 34.584, -108.227 34.583, -109.048 34.59...>
     <POLYGON ((-76.396 37.108, -76.403 37.091, -76.434 37.089, -76.464 37.103, -...>
     <POLYGON ((-77.532 38.565, -77.721 38.84, -77.707 38.877, -77.678 38.885, -7...>
     <POLYGON ((-111.372 44.745, -111.368 45.35, -111.349 45.349, -111.349 45.635...>],
    crs=EPSG:4326)