Skip to content

feat: add map2loop as packages/map2loop workspace package - #302

Open
lachlangrose wants to merge 2 commits into
split/02-visualisation-packagefrom
split/03-map2loop-package
Open

feat: add map2loop as packages/map2loop workspace package#302
lachlangrose wants to merge 2 commits into
split/02-visualisation-packagefrom
split/03-map2loop-package

Conversation

@lachlangrose

Copy link
Copy Markdown
Member

Split out of #298 / #299. PR 3 of 9 in the stack — depends on #301.

Adds the map2loop package as a new self-contained workspace member under packages/map2loop. No wiring into the root workspace config yet — that's PR 4 (next in the stack).

Base is #301 only because of stack ordering; this package's content doesn't depend on the visualisation package.

Ports Loop3D/map2loop (upstream commit 078f8a6, master @ 3.3.1) into this
repo as packages/map2loop, following the packages/loop_interpolation
src-layout convention (Stage 2 of ROADMAP.md), for Stage 4's map2loop half.

- Source moved from flat map2loop/ to src/map2loop/; test suite ported to
  packages/map2loop/tests/ unchanged apart from one CWD-relative fixture
  path fix (tests/sampler/geo_test.csv -> path relative to the test file)
  needed because tests now run from the monorepo root, not map2loop's own
  repo root.
- pyproject.toml written from the loop_interpolation template (build
  system, classifiers, src-layout packages.find, tests extra) but keeps
  map2loop's own real name/version/requires-python/dependencies.
- Dependency-declaration gaps fixed (imported at module level but
  undeclared upstream): pandas and packaging. GDAL (osgeo) is also a hard,
  module-level import but is deliberately left undeclared, matching
  upstream's own convention of treating it as an externally-provisioned
  (conda/system) dependency rather than a pip one -- their own
  dependencies.txt explicitly skips it in check_all_dependencies(), and
  pip-building it from source fails without system libgdal headers.
- dependencies.txt (consulted at runtime by map2loop's own import-time
  version-compatibility self-check) copied to src/dependencies.txt to
  match the relative path the existing code resolves it from, and pytest
  removed from it since map2loop's own self-check otherwise hard-requires
  pytest to be installed for a plain (non-tests-extra) install to import
  successfully.

Verified in an isolated uv venv: `import map2loop` succeeds, and
`pytest packages/map2loop/tests` gives 78 passed, 4 failed, 1 skipped, 1
collection error -- all 5 non-passing outcomes trace back to the absence
of native GDAL bindings in this pip/Windows-only verification environment
(4 of them) or a monorepo-embedding artifact where one test's internal
`pytest.main()` call with no explicit path picks up this repo's own
unrelated tests/conftest.py pytest_plugins (1 of them), not to the port
itself.

Audited for loop_common type reuse per ROADMAP.md Stage 4: no swap made.
map2loop's bounding_box is a plain dict of map-CRS extents threaded
through dozens of call sites, architecturally unrelated to
loop_common.geometry.BoundingBox's local/global mesh-frame transform
model; its own map2loop.logging module is already map2loop's public,
already-used API surface, so routing its handful of ad-hoc print()
statements through loop_common.logging would need adding loop-common as a
new hard dependency for a cosmetic swap; no custom point/orientation data
structures exist to compare against loop_common.observations (dip/dip
direction data stays as GeoDataFrame columns throughout). No clean,
low-risk win found.

(cherry picked from commit fb755cc)
@lachlangrose
lachlangrose force-pushed the split/03-map2loop-package branch from 3c7f735 to 2215803 Compare August 14, 2026 11:14
…al in tool.uv.sources

Same fix as split/02-visualisation-package: packages/* workspace glob
auto-includes every package dir under packages/ as a uv workspace
member, but uv separately requires each member to have a
tool.uv.sources entry declaring it as workspace = true. Missing
entries broke uv sync/build for every package in this repo with:
"loopstructuralvisualisation is included as a workspace member, but
is missing an entry in tool.uv.sources".
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