Skip to content

small fixes 2026-08-08: use mortie's flat exports instead of the tools submodule (issue #406) - #411

Merged
espg merged 2 commits into
mainfrom
claude/small-fixes-2026-08-08
Aug 8, 2026
Merged

small fixes 2026-08-08: use mortie's flat exports instead of the tools submodule (issue #406)#411
espg merged 2 commits into
mainfrom
claude/small-fixes-2026-08-08

Conversation

@espg

@espg espg commented Aug 8, 2026

Copy link
Copy Markdown
Member

Closes #406.

Mechanical import swap, zero behaviour change: every remaining consumer of the
mortie.tools submodule path moves to mortie's flat export.

-from mortie.tools import mort2polygon
+from mortie import mort2polygon

Why this PR exists rather than PR #398

#406 was already implemented as ae408ea on PR #398's branch
(claude/small-fixes-2026-08-05), but that PR cannot carry the fix to merge, for
two independent reasons:

  1. PR small fixes 2026-08-05: refuse a sub-second windowing epoch (issue #390) #398 is entangled with an unsettled design. It closes windowing.epoch: validate the rendered value (sub-second epoch silently shifts every window conversion) #390 (refuse a
    sub-second windowing epoch), whose design is now bound up with Per-centroid temporal companion for t-digests: a 64-bit hierarchical time cell, mirroring the spatial location companion #410
    (temporal/timespan representation). That will not be settled soon. Use mortie's flat exports instead of the mortie.tools submodule path (6 sites) #406 is an
    unrelated mechanical import fix and should not sit behind a temporal-design
    decision.
  2. PR small fixes 2026-08-05: refuse a sub-second windowing epoch (issue #390) #398 structurally cannot reach two of the six sites. Its branch forked
    at 196867b, before PR land the AOI/CONUS shardmap builders (issue #372) #395 ("land the AOI/CONUS shardmap builders",
    issue conus shardmap builder mislabels the considered count as intersecting #372) merged on 2026-08-07 and added data/ to the repo. Those files
    were never in its tree, so git ls-files data on that branch is genuinely
    empty — which is exactly how the first correction comment on Use mortie's flat exports instead of the mortie.tools submodule path (6 sites) #406 came to
    report the data/ scripts as untracked.

This PR is cut from a main (4edbf0ee) that contains #395, so it can see all
six. It carries ae408ea forward by cherry-pick (authorship preserved) and adds
the two data/ sites on top.

Why it matters

mortie.tools is not an advertised submodule — only arrow and morton_index
are. espg/mortie#159 (PR espg/mortie#169) moves mort2polygon and mort2geo
into mortie/convert.py, and that PR cannot merge until all six sites here are
clear
. The PR #169 review independently surfaced the same six
(r3740911256).

Both names are flat exports on every mortie version that has the function, so
there is no floor bump here — mortie>=0.7.2 in pyproject.toml is unchanged.

Sites

File Line Name Commit
src/zagg/grids/healpix.py 252 (shards_bbox) mort2polygon e31070c (cherry-pick)
src/zagg/grids/healpix.py 436 (shard_footprint) mort2polygon e31070c (cherry-pick)
demo/05_california_read.ipynb 196 mort2polygon e31070c (cherry-pick)
notebooks/aoi_mask.ipynb 69 mort2geo e31070c (cherry-pick)
data/build_aoi_shardmap.py 129 (_leak_check) mort2polygon a49832c
data/conus/build_conus_shardmap.py 110 (_leak_check) mort2polygon a49832c

Note the notebook site is mort2geo, not mort2polygon#159 moves the two
names independently, so both had to be swept.

data/conus/plot_conus_shardmap.py appears in this issue's original site list
but is not tracked on main (it exists only as an untracked local file), so
it is out of scope here.

Phases

How it was tested

Acceptancegit grep -n "mortie\.tools\|from mortie import tools" over the
whole worktree returns nothing.

Both names are object-identical across the two paths, which is what makes
this a no-op (mortie 0.9.4):

mort2polygon  callable True  in __all__ True  identical True
mort2geo      callable True  in __all__ True  identical True

Test coverage is uneven, and worth stating plainly:

So rather than imply the suite exercises the data/ change, both scripts were
imported by path and their _leak_check — the one function carrying the changed
import — was called on real order-9 morton keys over CONUS. On the happy path
_leak_check never touches grid, so this runs standalone:

morton keys: [3856734946517319689, 3841143871635456009, 3823498909032906761]
build_aoi_shardmap._leak_check   -> {'passed': True, ..., 'cell_lat_min': 35.2328, 'cell_lat_max': 40.5278}
build_conus_shardmap._leak_check -> {'passed': True, ..., 'cell_lat_min': 35.2328, 'cell_lat_max': 40.5278}

Cell centres land on the input points, so the swapped import resolves and
mort2polygon returns correct geometry through it.

Gates (uv run):

Gate Result
ruff check src tests 1 error — pre-existing N818 at src/zagg/registry.py:64
ruff format --check src tests 1 file would be reformatted — pre-existing, tests/data/benchmark/README.md
pytest -q 1 failed, 3671 passed, 38 skipped — the failure is pre-existing test_lambda_build.py::TestFunctionBuild::test_function_build_succeeds

All three failures are pre-existing on 4edbf0ee and unrelated to this diff;
flagged, not fixed, per CLAUDE.md §4. The flaky test_client_transport.py poller
test passed on both runs.

Questions for review

@espg espg added the implement label Aug 8, 2026
@espg

espg commented Aug 8, 2026

Copy link
Copy Markdown
Member Author

🤖 from Claude

All six mortie.tools sites are clear on this branch (git grep returns nothing); gates run, three pre-existing failures flagged not fixed, and this unblocks espg/mortie#169. Left in draft for review.

@espg
espg marked this pull request as ready for review August 8, 2026 17:47
@espg
espg merged commit e9698f3 into main Aug 8, 2026
13 checks passed
@espg
espg deleted the claude/small-fixes-2026-08-08 branch August 8, 2026 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

1 participant