Skip to content

Add gap-free topology documentation and plot_topology() convenience helper#401

Merged
michaelchin merged 7 commits into
masterfrom
copilot/fix-gaps-in-topological-rendering
Jun 10, 2026
Merged

Add gap-free topology documentation and plot_topology() convenience helper#401
michaelchin merged 7 commits into
masterfrom
copilot/fix-gaps-in-topological-rendering

Conversation

Copilot AI commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Plotting individual boundary types (plot_ridges, plot_transforms, plot_trenches) in isolation leaves visible gaps along "other connection" segments. The fix is to render plot_all_topological_sections() as a continuous backbone first, then layer the styled boundaries on top — a pattern used across the tutorial suite but undiscovered by most users.

Changes

Documentation

  • Added a .. note:: block to get_ridges, plot_ridges, get_trenches, plot_trenches, get_transforms, and plot_transforms explaining:
    • why gaps appear
    • the backbone-first rendering pattern
    • reference to the new plot_topology() helper

New PlotTopologies.plot_topology() helper

Convenience method that enforces correct draw order internally: backbone → ridges → transforms → trenches.

# One-call gap-free topology with defaults (grey backbone, red ridges, black trenches)
gplot.plot_topology(ax)

# Fully customised
gplot.plot_topology(
    ax,
    backbone_kwargs={"color": "lightgrey", "linewidth": 0.5},
    ridge_kwargs={"color": "red", "linewidth": 1},
    transform_kwargs={"color": "green"},
    trench_kwargs={"color": "blue"},
)

# Skip a layer by passing False
gplot.plot_topology(ax, transform_kwargs=False, ridge_kwargs=False)

Parameter semantics: None → draw with default style; dict → draw with custom kwargs; False → skip layer. Transforms are skipped (False) by default since they visually overlap with ridges.

Tests

Added test_plot_topology_adds_artists and test_plot_topology_skip_layer to test_3_plottopologies.py.

- Document the backbone-first pattern for gap-free topology rendering in
  get_ridges/plot_ridges, get_trenches/plot_trenches, get_transforms/plot_transforms
- Add plot_topology() convenience method to PlotTopologies that handles the
  backbone-first ordering internally (backbone → ridges → transforms → trenches)
- Add tests for plot_topology in test_3_plottopologies.py
Copilot AI changed the title [WIP] Fix gaps in topological-boundary rendering Add gap-free topology documentation and plot_topology() convenience helper Jun 9, 2026
Copilot AI requested a review from michaelchin June 9, 2026 02:43
@michaelchin michaelchin marked this pull request as ready for review June 10, 2026 10:25
@michaelchin michaelchin merged commit 68e1632 into master Jun 10, 2026
2 checks passed
@michaelchin michaelchin deleted the copilot/fix-gaps-in-topological-rendering branch June 10, 2026 10:27
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.

Topological-boundary rendering leaves gaps without a continuous-backbone layer

2 participants