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

[FEA]: Write tests for multipolygon_{range/ref}, polygon_{range/ref}, linestring_{range/ref}, etc. #991

Closed
thomcom opened this issue Mar 13, 2023 · 1 comment · Fixed by #1197
Assignees
Labels
feature request New feature or request tech debt Related to improving software quality

Comments

@thomcom
Copy link
Contributor

thomcom commented Mar 13, 2023

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

Improvement

How would you describe the priority of this feature request

Medium

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

I love the new C++ object references you've designed to be used with thrust @isVoid, they seem like they'll really improve development of libcuspatial.

Because they are such fundamental elements of the libcuspatial API, I think that you should write unit tests for them that exercise the functionalities they are expected to have.

Describe any alternatives you have considered

No response

Additional context

No response

@thomcom thomcom added feature request New feature or request Needs Triage Need team to review and classify labels Mar 13, 2023
@thomcom thomcom changed the title [FEA]: Write tests for multipolygon_ref, polygon_ref, linestring_ref, etc. [FEA]: Write tests for multipolygon_{range/ref}, polygon_{range/ref}, linestring_{range/ref}, etc. Mar 13, 2023
@isVoid
Copy link
Contributor

isVoid commented Mar 14, 2023

100%. Because the infrastructure used in all st_distance APIs, they are "semi-tested" in the integration tests with distance tests. But unit testing would definitely make developer's life easier.

rapids-bot bot pushed a commit that referenced this issue Apr 5, 2023
…tor additions (#1026)

closes #1025

This PR adds RAI segment iterators to `multilinestring_range` and `multipolygon_range`. 

**Caveats: this iterator currently will fail if the range contains empty geometries (such as an empty linestring or an empty polygon)**.

Usage example:
```
multilinestring_range:
geometry: {0, 1, 2}
part: {0, 3, 6}
coordinates: {{0, 0}, {1, 1}, {2, 2}, {10, 10}, {11, 11}, {12, 12}}

range.segment_begin()[0] == {0, 0}, {1, 1}
range.segment_begin()[1] == {1, 1}, {2, 2}
range.segment_begin()[2] == {10, 10}, {11, 11}
range.segment_begin()[3] == {11, 11}, {12, 12}

range.num_segments() == 4
```

This PR also adds a few helper methods that will be used in `pairwise_linestring_polygon_distance` API. All of them are tested. Contributes to #991

Authors:
  - Michael Wang (https://github.com/isVoid)

Approvers:
  - Paul Taylor (https://github.com/trxcllnt)
  - Mark Harris (https://github.com/harrism)

URL: #1026
@jarmak-nv jarmak-nv removed the Needs Triage Need team to review and classify label Apr 27, 2023
@harrism harrism moved this from Todo to In Progress in cuSpatial May 22, 2023
@jarmak-nv jarmak-nv added the tech debt Related to improving software quality label Jun 5, 2023
@harrism harrism moved this from In Progress to Review in cuSpatial Jul 26, 2023
rapids-bot bot pushed a commit that referenced this issue Jul 31, 2023
closes #991

This PR adds comprehensive tests for `multi*_range` class. The basic goal is to make sure every API in service is at least covered by 3 tests: a range with 0, 1 and 1000 elements. The tests are structured as below: for each range, a base fixture class is created. The base class defines virtual functions that its subclass should implement. These virtual functions include a `make_test_multi*` function that constructs the geometry array of that specific test case, as well as each sub test function that defines the expected value of that test case. The base class defines a `SetUp` function that calls the `make_test_multi*` to generate the array at test start up time. Then, a `run_test` function is defined to subsequently call every sub routine that test every API of that geometry range.

In addition, this PR fixes several small bug in `point_begin` accessor in `linestring_ref` and `multipolygon_ref` class. Also, a few unused functions in `multipolygon_range` have been removed.

Authors:
  - Michael Wang (https://github.com/isVoid)

Approvers:
  - Robert Maynard (https://github.com/robertmaynard)
  - Mark Harris (https://github.com/harrism)
  - H. Thomson Comer (https://github.com/thomcom)

URL: #1197
@github-project-automation github-project-automation bot moved this from Review to Done in cuSpatial Jul 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request tech debt Related to improving software quality
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants