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

Dispatch binary predicate tests according to predicate and cases. #1046

Closed
1 of 2 tasks
thomcom opened this issue Apr 7, 2023 · 0 comments · Fixed by #1064 or #1085
Closed
1 of 2 tasks

Dispatch binary predicate tests according to predicate and cases. #1046

thomcom opened this issue Apr 7, 2023 · 0 comments · Fixed by #1064 or #1085
Assignees
Labels
2 - In Progress Currenty a work in progress improvement Improvement / enhancement to an existing function non-breaking Non-breaking change

Comments

@thomcom
Copy link
Contributor

thomcom commented Apr 7, 2023

This is a task list.

Is this a new feature, an improvement, or a change to existing functionality?

Improvement

How would you describe the priority of this feature request

Critical (currently preventing usage)

Please provide a clear description of problem you would like to solve.

Tests for binpreds will be dispatched in the following structure:

Contains

    "point-point-disjoint",
    "point-point-equal",
    "point-linestring-disjoint",
    "point-linestring-point",
    "point-linestring-edge",
    "point-polygon-disjoint",
    "point-polygon-point",
    "point-polygon-edge",
    "point-polygon-in",
    "linestring-linestring-disjoint",
    "linestring-linestring-same",
    "linestring-linestring-touches",
    "linestring-linestring-crosses",
    "linestring-polygon-disjoint",
    "linestring-polygon-touch-point",
    "linestring-polygon-touch-edge",
    "linestring-polygon-overlap-edge",
    "linestring-polygon-intersect-edge",
    "linestring-polygon-intersect-inner-edge",
    "linestring-polygon-point-interior",
    "linestring-polygon-edge-interior",
    "linestring-polygon-in",
    "polygon-polygon-disjoint",
    "polygon-polygon-touch-point",
    "polygon-polygon-touch-edge",
    "polygon-polygon-overlap-edge",
    "polygon-polygon-point-inside",
    "polygon-polygon-point-outside",
    "polygon-polygon-in-out-point",
    "polygon-polygon-in-point-point",
    "polygon-polygon-contained",

ContainsProperly
    (repeat)
Covers
    (repeat)
Crosses
    (repeat)
Disjoint
    (repeat)
Equals
    (repeat)
Intersects
    (repeat)
Overlaps
    (repeat)
Touches
    (repeat)
Within
    (repeat)

This is 300 tests that cover the range of feature positions that exist for simple features. The geometric arrangement of each test is available in binpred_test_dispatch.py.

Describe any alternatives you have considered

No response

Additional context

No response

Tasks

Preview Give feedback
  1. 2 - In Progress feature request improvement non-breaking
    thomcom
  2. 0 - Backlog feature request improvement non-breaking
    thomcom
@thomcom thomcom added feature request New feature or request Needs Triage Need team to review and classify labels Apr 7, 2023
@github-project-automation github-project-automation bot moved this to Todo in cuSpatial Apr 7, 2023
@thomcom thomcom self-assigned this Apr 7, 2023
@thomcom thomcom added 2 - In Progress Currenty a work in progress improvement Improvement / enhancement to an existing function non-breaking Non-breaking change and removed feature request New feature or request Needs Triage Need team to review and classify labels Apr 7, 2023
@thomcom thomcom moved this from Todo to In Progress in cuSpatial Apr 7, 2023
@thomcom thomcom moved this from In Progress to Review in cuSpatial Apr 7, 2023
@thomcom thomcom moved this from Review to In Progress in cuSpatial Apr 7, 2023
@thomcom thomcom moved this from In Progress to Review in cuSpatial Apr 7, 2023
@thomcom thomcom moved this from Review to In Progress in cuSpatial Apr 11, 2023
@thomcom thomcom moved this from In Progress to Review in cuSpatial Apr 14, 2023
@thomcom thomcom moved this from Review to In Progress in cuSpatial Apr 14, 2023
@thomcom thomcom moved this from In Progress to Review in cuSpatial Apr 14, 2023
rapids-bot bot pushed a commit that referenced this issue Apr 26, 2023
Closes #1046
Closes #1036

This PR adds a new binary predicate test dispatch test system. The test dispatcher creates one test for each ordered pair of features from the set (point, linestring, polygon) and each predicate that feature tuple can be applied to:

- contains
- covers
- crosses
- disjoint
- geom_equals
- intersects
- overlaps
- touches
- within

The combination of 9 predicates and 33 tests creates 297 tests that cover all possible combinations of simple features and their predicates.

While development is underway, the test dispatcher automatically `xfails` any test that fails or hasn't been implemented yet in order to pass CI.

The test dispatcher outputs diagnostic results during each test run. An output file `test_binpred_test_dispatch.log` is created containing all of the failing tests, including their name, a visual description of the feature tuple and relationship, the shapely objects used to create the test, and the runtime name of the test so it is easy for a developer (myself) to identify which test failed and rerun it. It also creates four .csv files during runtime that collect the results of each test pass or fail relative to which predicate is being run and which pair of features are being tested. These .csv files can be displayed using `tests/binpred/summarize_binpred_test_dispatch_results.py`, which will output a dataframe of each CSV file thusly:

```
(rapids) coder ➜ ~/cuspatial/python/cuspatial/cuspatial $ python tests/binpreds/summarize_binpred_test_dispatch_results.py 
     predicate  predicate_passes
0  geom_equals                20
1   intersects                11
2       covers                17
3      crosses                 6
4     disjoint                 9
5     overlaps                20
6       within                14
     predicate  predicate_fails
0     contains               33
1  geom_equals               13
2   intersects               22
3       covers               16
4      crosses               27
5     disjoint               24
6     overlaps               13
7      touches               33
8       within               19
                                             feature  feature_passes
0     (<ColumnType.POINT: 1>, <ColumnType.POINT: 1>)              14
1   (<ColumnType.POINT: 1>, <ColumnType.POLYGON: 4>)              22
2  (<ColumnType.LINESTRING: 3>, <ColumnType.LINES...              16
3  (<ColumnType.LINESTRING: 3>, <ColumnType.POLYG...              38
4  (<ColumnType.POINT: 1>, <ColumnType.LINESTRING...               7
                                             feature  feature_fails
0     (<ColumnType.POINT: 1>, <ColumnType.POINT: 1>)              4
1  (<ColumnType.POINT: 1>, <ColumnType.LINESTRING...             20
2   (<ColumnType.POINT: 1>, <ColumnType.POLYGON: 4>)             14
3  (<ColumnType.LINESTRING: 3>, <ColumnType.LINES...             20
4  (<ColumnType.LINESTRING: 3>, <ColumnType.POLYG...             52
5  (<ColumnType.POLYGON: 4>, <ColumnType.POLYGON:...             90
```
Without additional modifications, the test dispatcher produces 97 passing results and 200 xfailing results. In a shortly upcoming PR, updates to the basic predicates and binpred test architecture increase the number of passing results to 274, with 25 xfails. These PRs are separated for ease of review.

Authors:
  - H. Thomson Comer (https://github.com/thomcom)

Approvers:
  - Mark Harris (https://github.com/harrism)
  - Michael Wang (https://github.com/isVoid)

URL: #1085
@github-project-automation github-project-automation bot moved this from Review to Done in cuSpatial Apr 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2 - In Progress Currenty a work in progress improvement Improvement / enhancement to an existing function non-breaking Non-breaking change
Projects
Status: Done
1 participant