Skip to content

feat(testing): add assert_geoseries_coordinates_equal#125

Merged
JuhoErvasti merged 1 commit into
mainfrom
less-precise-z-check
Jun 4, 2026
Merged

feat(testing): add assert_geoseries_coordinates_equal#125
JuhoErvasti merged 1 commit into
mainfrom
less-precise-z-check

Conversation

@JuhoErvasti

@JuhoErvasti JuhoErvasti commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator

Description

assert_geoseries_equal and assert_geodataframe_equal do not check if geometries have the same z coordinates. If you use the plain Pandas assert_series_equal it does check for z coordinates. This has been used so far, but this allows only exact checking so you can't enable check_less_precise.

This PR adds [assert_geoseries_coordinates_equal](https://github.com/nlsfi/geogen-algorithms/pull/125/commits/ca7d499125a179c91cd1b81009a6a97b9f3497af) which explicitly check that all coordinates including Z match in two GeoSeries.

This is required because in #124 we get an issue where it looks like for some reason depending on the OS (Windows/Linux) you get slightly different coordinates on some vertices (on the millimiter or less scale), leading tests to fail on one OS or the other. This change allows to use the check_less_precise parameter to ignore miniscule differences like this.

Type of change

  • Bug fix

  • New feature

  • Other

  • Non-breaking change

  • Breaking change

Developer checklist

  • A CHANGELOG entry has been included (only when change is visible to users)

@nlssakokorhonen nlssakokorhonen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a minor detail, imho the function name "assert_geoseries_z_values_match" is a bit misleading. I would expect the function to check only z coordinates instead of geometry type and all the coordinates. The code would be easier to read if you can come up with a better name for the function.

@JuhoErvasti JuhoErvasti force-pushed the less-precise-z-check branch from ccc03e8 to ca7d499 Compare June 4, 2026 07:21
@JuhoErvasti JuhoErvasti changed the title feat(testing): add assert_geoseries_z_values_match feat(testing): add assert_geoseries_coordinates_equal Jun 4, 2026
@JuhoErvasti

Copy link
Copy Markdown
Collaborator Author

Good point, I'll change the name.

@JuhoErvasti JuhoErvasti merged commit 741de6a into main Jun 4, 2026
3 checks passed
@JuhoErvasti JuhoErvasti deleted the less-precise-z-check branch June 4, 2026 07:36
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

Successfully merging this pull request may close these issues.

2 participants