devkit_f2c_planner.f2c_test_helpers
Shared helpers for the devkit_f2c_planner unit tests.
planner: f2c_planner imported even where fields2cover is not installed (fields2cover is built in docker/Dockerfile and is not pip-installable in CI). Only the shapely-based functions work without it; tests that go through_run_f2c()patchplanner.f2cwithFakeF2C.to_ll/to_xy: build fixtures in metres and convert them with the planner’s own projection. The projection itself is tested independently in test_projection.py.FakeF2C: records calls and returns canned swaths. It mirrors only the fields2cover calls made by_run_f2c(), so it tests the planner’s own logic (ordering, clipping, projection), not fields2cover.
Functions
|
The planner logs to stderr with print(); keep test output clean. |
|
Local xy metres -> lat/lon, anchored at (lat0, lon0) == xy (0, 0). |
|
lat/lon -> local xy metres, anchored at (lat0, lon0). |
Classes
|
f2c.Cell stand-in. |
|
Canned stand-in for the |
- class devkit_f2c_planner.f2c_test_helpers.FakeCell[source]
Bases:
objectf2c.Cell stand-in.
rings[0]is the outer boundary, the rest are hole hints.
- class devkit_f2c_planner.f2c_test_helpers.FakeF2C(swaths_xy: list, headland_cells: list | None = None, headland_error: Exception | None = None)[source]
Bases:
objectCanned stand-in for the
fields2covermodule, as used by_run_f2c().swaths_xy swaths (lists of local-xy points) returned by SG_BruteForce headland_cells cells returned by the headland generator (default: one inset cell) headland_error exception raised by the headland generator instead
- LinearRing
alias of
_FakeRing
- Point
alias of
_FakePoint
- devkit_f2c_planner.f2c_test_helpers.silence_planner_log(test: TestCase) None[source]
The planner logs to stderr with print(); keep test output clean.