Skip to content

Invalid geometry handling - #5

Merged
wrignj08 merged 3 commits into
mainfrom
invalid-geometry-handling
Jun 2, 2026
Merged

Invalid geometry handling#5
wrignj08 merged 3 commits into
mainfrom
invalid-geometry-handling

Conversation

@wrignj08

@wrignj08 wrignj08 commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

No description provided.

wrignj08 and others added 3 commits June 1, 2026 20:45
Invalid geometries (e.g. self-intersecting polygons) previously crashed
with a cryptic "got MultiPolygon" error or silently collapsed to an empty
geometry, and behaviour differed between the single / list / GeoDataFrame
paths. They are now screened out before any merge/dissolve step and
returned unchanged with a warning, consistently across all input types and
regardless of merge_collection. The warning is raised from the main process
so it survives parallel execution.

Also improves the internal error in _generate_starting_point_variants to
point at invalid input when a single Polygon unexpectedly becomes
multi-part, backfills the missing 0.2.2 changelog entry from git history,
and bumps to 0.2.3 with docstring/README notes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Mirror S2Mosaic's tooling onto Smoothify:

- .pre-commit-config.yaml: ruff-check + ruff-format + mypy on commit,
  pytest (skipping slow tests) on pre-push.
- GitHub Actions: ci.yml (ruff/mypy/pytest + notebook smoke test, Python
  3.10-3.14) and publish.yml (tag-triggered PyPI trusted publishing).
- Switch versioning to setuptools-scm (version from git tags); drop the
  static smoothify/__version__.py and ship a py.typed marker so the
  inline type hints are exposed to downstream type checkers.
- Make the package pass strict mypy and ruff: add missing annotations,
  reorder the smoothify() overloads (the Any-tainted GeoDataFrame overload
  must come last), narrow MultiPolygon/MultiLineString construction with a
  comprehension so both mypy and pyright accept it, trim long lines.
- Mark the real-world-data tests `slow`; the pre-push hook deselects them.
- Stop tracking uv.lock; add PyPI classifiers, project URLs and license
  metadata; document the release flow in RELEASING.md.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- README: add a "Running the Tests" section (uv sync / pytest / coverage).
- Expand and refactor tests for geometry-type handling, auto segment-length
  detection, the smoothify API, core helpers, and invalid-polygon handling.
- Refresh visual_tests.ipynb outputs.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@wrignj08
wrignj08 merged commit c8b20d5 into main Jun 2, 2026
10 checks passed
@wrignj08
wrignj08 deleted the invalid-geometry-handling branch June 12, 2026 02:55
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.

1 participant