Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add UserWarning when assign fails to assign #35

Open
InnovativeInventor opened this issue Jun 23, 2021 · 1 comment
Open

Add UserWarning when assign fails to assign #35

InnovativeInventor opened this issue Jun 23, 2021 · 1 comment

Comments

@InnovativeInventor
Copy link
Member

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

@InnovativeInventor
Copy link
Member Author

InnovativeInventor commented Jun 23, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant