mggg / maup

The geospatial toolkit for redistricting data.
https://maup.readthedocs.io/en/latest/
MIT License
65 stars 23 forks source link

Commutitivity checks and inverse checks #37

Closed InnovativeInventor closed 3 years ago

InnovativeInventor commented 3 years ago

We should add tests to verify that indeed:

maup.assign(source, target)

is the inverse of

maup.assign(target, source)

That is, maup.assign is invertible and bijective by swapping the inputs when source and target geometries at least overlap with each other.

maup.intersections(source, target)

produces the same list of geometries as

maup.intersections(target, source)

That is, maup.intersections is commutative.

This the expected behavior for maup, but may not necessarily be true on all geometries.

InnovativeInventor commented 3 years ago

Closing because this is done. Fuzzing tests are implemented here: https://github.com/mggg/maup-fuzz.