Skip to content

Add fast tests for UTM conversions - #537

Merged
giswqs merged 1 commit into
opengeos:mainfrom
wgu9:add-utmconv-fast-tests
Jun 17, 2026
Merged

giswqs merged 1 commit into
opengeos:mainfrom
wgu9:add-utmconv-fast-tests

Conversation

@wgu9

@wgu9 wgu9 commented Jun 17, 2026 •

Copy link
Copy Markdown
Contributor

Hi, this adds a small dependency-free test file for samgeo/utmconv.py and wires it into the Linux CI as a fast unit-test step.

What changed:

  • added unittest coverage for degree/radian conversion, UTM central meridians, known UTM outputs, northern/southern hemisphere round trips, and southern-hemisphere false northing
  • added a focused CI step that only runs tests.test_utmconv, so it does not depend on model downloads, network data, QGIS, or GPU setup

I kept this intentionally narrow because the full test suite includes heavier integration-style tests. This gives the CI one quick deterministic guard for the pure coordinate-conversion helpers without changing runtime behavior.

Tested locally:

  • python -m unittest tests.test_utmconv -v
  • git diff --cached --check

Summary by CodeRabbit

  • Tests

    • Added comprehensive unit tests for UTM conversion functionality, including degree/radian conversions, zone edge cases, and bidirectional coordinate transformations.
  • Chores

    • Enhanced continuous integration pipeline with additional automated testing step.

@coderabbitai

coderabbitai Bot commented Jun 17, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: bea9f586-1687-4b23-8f7b-27a338e94778

📥 Commits

Reviewing files that changed from the base of the PR and between 01f9668 and 46c4f71.

📒 Files selected for processing (2)
  • .github/workflows/ubuntu.yml
  • tests/test_utmconv.py

📝 Walkthrough

Walkthrough

A new dependency-free test module tests/test_utmconv.py is added, dynamically loading samgeo/utmconv.py via importlib.util and defining six unit tests for UTM conversion helpers. The Ubuntu CI workflow gains a "Fast unit tests" step that runs this suite.

Changes

UTM Conversion Tests and CI Integration

Layer / File(s) Summary
TestUtmconv module: loader, harness, and all test methods
tests/test_utmconv.py
Dynamically loads samgeo/utmconv.py using importlib.util and the file's relative path. Defines assert_close helper and six test methods: degree↔radian round-trips, utm_central_meridian boundary-zone values, known equator-point UTM output, known central-meridian-aligned UTM output, multi-case lat/lon↔UTM round-trips via subTest, and southern-hemisphere false-northing reversibility. Includes __main__ entry point.
CI workflow: Fast unit tests step
.github/workflows/ubuntu.yml
Adds a "Fast unit tests" step running python -m unittest tests.test_utmconv after the existing "Test import" step.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐇 Hopping through the meridians with glee,
Converting degrees to radians, one, two, three!
North and south, the zones align just right,
UTM round-trips checked morning to night.
The CI pipeline twitches its nose—
Fast unit tests, off the workflow goes! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add fast tests for UTM conversions' directly and clearly describes the main change: adding new unit tests for UTM conversion functionality.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@giswqs
giswqs merged commit f4f297f into opengeos:main Jun 17, 2026
9 checks passed
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