maup icon indicating copy to clipboard operation
maup copied to clipboard

Add UserWarning when assign fails to assign

Open InnovativeInventor opened this issue 4 years ago • 1 comments
trafficstars

TODO: checkup on the behavior of assign when a geometry in the source is completely untouched by any target geometry

InnovativeInventor avatar Jun 23 '21 14:06 InnovativeInventor

Update: maup will be NaN/undefined when this occurs. E.g.:

import geopandas as gpd
from shapely.geometry import Polygon
source = gpd.GeoSeries([
    Polygon([(0,0), (1,0), (1,1), (0,1)]),
    Polygon([(1,0), (2,0), (2,1), (1,1)])
])
target = gpd.GeoSeries([
    Polygon([(0,0), (1,0), (1,1), (0,1)]),
])
>>> maup.assign(source, target)
0    0.0
1    NaN
dtype: float64
>>> maup.assign(target, source)
0    0
dtype: int64

​I am going to make maup throw a user warning when either of these two ^ things occur.

InnovativeInventor avatar Jun 23 '21 14:06 InnovativeInventor