Skip to content

Releases: DDonnyy/ObjectNat

v1.4.1

27 Nov 14:33

Choose a tag to compare

Changelog v1.4.1

  • Bumped version to 1.4.1.
  • Added geometry filtering for obstacles in get_visibility (allow only MultiPolygon, Polygon, LineString, MultiLineString).

Full Changelog: v1.4.0...v1.4.1

v1.4.0

26 Nov 15:39
f01e734

Choose a tag to compare

Changelog — v1.4.0

Highlights

  • New release workflow: automated build + publish to PyPI and GitHub Releases on v*.. tags.
  • Visibility API unified and refactored for single-entry usage and parallel computations.
  • Major refactor and performance improvements in simplified noise simulation (batch visibility, parallelism, better defaults).
  • Developer tooling: expanded Makefile, version sync script, and release helpers.
  • Version bumped to 1.4.0.

Added

  • .github/workflows/release.yml — GitHub Action to build the package, verify tag == pyproject version, publish to PyPI, and create a GitHub release.
  • scripts/sync_version.py — utility to sync pyproject.toml version into src/objectnat/_version.py.
  • Makefile improvements: PACKAGE variable, help target, many new phony targets (lint, format, test, docs, build, publish, release, version-patch/minor/major, tag, push-tag, sync-version-file).
  • New exports: dist_to_furthest_point available from the visibility package.
  • New parameters for simplified noise API: visibility_parallel and visibility_max_workers (to enable parallel visibility computation).

Changed

  • Version bumped: pyproject.toml and src/objectnat/_version.py updated to 1.4.0.
  • Visibility API consolidated:
    • get_visibility is the unified entry point (accepts method="accurate" or method="simple").
    • Older / separate helpers (get_visibility_accurate, get_visibilities_from_points, calculate_visibility_catchment_area) have been removed from public exports; relevant functionality is available via get_visibility and dist_to_furthest_point.
    • Consumers must call get_visibility with the desired method mode.
  • Noise simulation refactor:
    • noise_simulation.py now uses a lower-level accurate visibility function interface (_visibility_accurate) and dist_to_furthest_point instead of the previous get_visibility_accurate wrapper.
    • noise_simulation_simplified.py:
      • Replaced many per-point get_visibility_accurate calls with a batched call to get_visibility for a GeoDataFrame of sample points (supports parallel execution).
      • Added stronger metadata grouping to union group geometries and aggregate visibility polygons per group.
      • Introduced more explicit parameters and defaults in the signature:
        • target_noise_db: default 40
        • db_sim_step: default 5
        • linestring_point_radius: default 15 (was previously higher)
        • polygon_point_radius: default 5
        • visibility_parallel and visibility_max_workers for parallel processing
      • Geometry buffering/resolution changes (buffer resolution and union behavior tuned for performance/robustness).
      • Increased geometric safety when generating cone points (multiplied a by 1.05).
      • Added small-geometry filter: ignore noise polygons with area < 0.01 to reduce spurious tiny polygons in results.
  • Exports and package API:
    • src/objectnat/_api.py and src/objectnat/methods/visibility/init.py updated to export only get_visibility (and dist_to_furthest_point) to reflect the unified API.
  • Tests:
    • Tests updated to use new API (import get_visibility) and new visibility call signatures (method parameter).
    • Test data path corrected/updated to docs/methods/examples/examples_data.
  • Documentation:
    • docs/methods/visibility.rst rewritten to describe the unified get_visibility API, methods available ("accurate" and "simple"), and usage guidance.

Fixed / Improved

  • Performance: batched visibility computation and parallelization for simplified noise calculations improve throughput for large datasets.
  • Robustness: more careful geometry buffering, unioning, and filtering reduce tiny/invalid polygons and numeric edge cases.
  • Packaging/build: Makefile targets and release workflow make releases reproducible and easier to perform from the repository.

Migration notes / upgrade guidance

  • API changes:
    • Replace imports of get_visibility_accurate, get_visibilities_from_points, etc., with get_visibility.
    • Use get_visibility(..., method="accurate") or get_visibility(..., method="simple") depending on required behavior.
    • If you previously relied on direct get_visibility_accurate behavior, you may need to use dist_to_furthest_point where code previously read a max_view_dist return value.
  • Running releases:
    • Add secrets.PYPI_API_TOKEN and ensure GITHUB_TOKEN is available for the release workflow.
    • The Makefile includes convenience targets for version bumps (version-patch/minor/major) which call sync-version-file; run make release to tag & push a release.
    • You can run scripts/sync_version.py to sync src/objectnat/_version.py after changing pyproject.toml.
  • Tests and examples:
    • Update tests or user code that referenced old visibility functions or older example-data paths to the new names/paths.