Skip to content

feat(loop-link): add loop_link, a Python link to geoviewer (spec 006, S1 to S3) - #406

Merged
lachlangrose merged 98 commits into
masterfrom
feat/006-loop-link
Nov 17, 2026
Merged

lachlangrose merged 98 commits into
masterfrom
feat/006-loop-link

Conversation

@lachlangrose

Copy link
Copy Markdown
Member

Summary

Adds loop_link, a Python package that sends objects from a Python session to the geoviewer window over its local link (protocol 1.14). This is spec 006, stages S1 to S3 (stories 1 and 5).

  • Object classes: Points, Vectors, Lines, Surface, BlockModel, TetraMesh, Drillhole, Categorical. encode_object writes the geoviewer frame. Coordinates are shifted in float64 and written as f32 only when the shifted values are at most 4000.
  • Viewer (connect, send, send_group, remove, clear, inventory, flush, release_data, close) with a standard-library WebSocket client, a heartbeat thread, and find_viewer discovery.
  • Adapters for pyvista, LoopStructural and pandas, and push_objects with PushResult.
  • loop_link.testing.FakeViewer, which follows the main rules of the real codec.
  • The package is registered with release-please, the package CI, ROADMAP.md and the root ruff settings. packages/loop_link is in the uv workspace exclude list because uv 0.11.8 cannot lock a Python 3.10-only member with the Python 3.9 workspace. uv.lock is unchanged. Loop-link has its own CI job, loop-link-test.

This branch also merges origin/master, because repo-wide ruff check failed on master.

Checks

  • ruff check LoopStructural packages: pass.
  • black --check packages/loop_link: pass.
  • Package tests: 457 passed with the geoviewer fixtures (LOOP_LINK_GEOVIEWER_FIXTURES). 4 tests skip without them.
  • Root pytest: 2200 passed, 10 skipped.
  • Wave reviews and two end reviews passed. An end review ran the real geoviewer Rust codec on the frames.
  • Manual checks (packages/loop_link/tests/manual_checks.md), window viewer with the selection-and-fetch build (geoviewer spec 067):
    • M1: the object was in the inventory after 0.43 s (limit 5 s).
    • M2: seven types show. A manual check found that drillhole interval values did not offer colour, because the viewer needs interval arrays in a log set. The last commit fixes this.

Not in this pull request

  • FR-004 to FR-006, FR-013, FR-018 to FR-021, SC-002, SC-003 and SC-007. They need stages S4 and S5 (select, read selection, fetch, filter and colour), which depend on geoviewer spec 067.
  • The loop-link-test CI job has not yet run on a real runner.
  • SC-004, second half (library frames accepted by the geoviewer codec), has no repo test yet.
  • Open minor findings are listed in specs/006-loop-link/run-state.json.
  • The vector glyphs and drillhole tubes look pixelated in the viewer. That is geoviewer issue 181.

🤖 Generated with Claude Code

https://claude.ai/code/session_01XADRvLYYZrrcx9Nu8e5tgs

# Conflicts:
#	ROADMAP.md
#	specs/005-coordinate-frame-correctness/plan.md
#	specs/005-coordinate-frame-correctness/tasks.md
#	specs/README.md
OP5 fallback used: packages/loop_link is in the uv workspace exclude list; uv.lock is unchanged.
…ds and honours cancel; more adapter test cases (wave 10 review)
- Viewer: the tool connection uses the address of the data connection, so
  select, selection and fetch go to the same viewer as send.
- Viewer: a failed send or heartbeat no longer blocks later sends; only
  close() does. A later send opens a new connection.
- ToolConnection: an error in on_frame closes the connection, so the
  viewer stops the stream and a later request does not read it.
- pyvista adapter: refuse PolyData that mixes lines with polygons or strips;
  convert line cells with numpy, not a Python loop.
- loopstructural adapter: flatten grid properties in x-fastest order and
  split (n, k) properties into one property for each column.
- pandas adapter: accept 'category' columns.
- Selection: the index arrays are writeable copies.
- WebSocket mask: make the key pattern only as long as the frame.
- Read __version__ from the package metadata (version.py), so that
  release-please bumps keep it correct.
Resolve conflicts in ROADMAP.md and specs/README.md: keep the spec 005
status from master and the spec 006 status from this branch.
… timing test

- A send after a failed connection connects again. If no viewer is found,
  raise ViewerClosedError, not NoViewerError, as the documented error of a
  viewer that closes during use.
- test_main_thread_is_not_blocked_by_slow_push: check that the push ran
  while the main thread ran, not the elapsed time, which fails on slow CI
  runners.
@lachlangrose
lachlangrose merged commit 9fe00f5 into master Nov 17, 2026
57 checks passed
@lachlangrose
lachlangrose deleted the feat/006-loop-link branch November 17, 2026 05:45
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