Skip to content

Refactor montage.jl: shared helpers and thin wrappers#1929

Merged
joa-quim merged 1 commit into
masterfrom
refactor-montage-helpers
Feb 23, 2026
Merged

Refactor montage.jl: shared helpers and thin wrappers#1929
joa-quim merged 1 commit into
masterfrom
refactor-montage-helpers

Conversation

@joa-quim
Copy link
Copy Markdown
Member

Summary

  • Extract shared helpers (_montage_setup_frame!, _montage_divlines!, _montage_panels_size_str, _montage_adjust_margins!) to deduplicate logic across the three montage methods.
  • Add thin outer wrappers that convert kw...Dict immediately, calling typed inner functions (_montage_images, _montage_cube, _montage_choro) to reduce kwargs-driven recompilations.
  • Replace nothing defaults with concrete sentinels ("", (0,0), Int[], false) and add type annotations to helper signatures.
  • montage(GI) individual-CPT path now uses _montage_adjust_margins! for smart margin spacing with titles/colorbars.

Test plan

  • montage(G) — 3D cube with shared CPT
  • montage(G, cmap_mode=:individual, colorbar=true, titles="auto") — individual CPT + margin auto-adjustment
  • montage(G, divlines=0.5) — divlines
  • montage(G, cmap_mode=:individual, B=:a, colorbar=true) — annotations
  • montage(imgs, grid=(2,2), panels_size=5) — image montage
  • montage(G, Vd=2) — dry run to inspect commands

🤖 Generated with Claude Code

…recompilations

- Extract _montage_setup_frame!, _montage_divlines!, _montage_panels_size_str,
  _montage_adjust_margins! as shared helpers used by all three montage methods.
- Add thin outer wrappers that convert kw... to Dict immediately, calling typed
  inner functions (_montage_images, _montage_cube, _montage_choro) to avoid
  kwargs-driven method explosion.
- Replace nothing defaults with concrete sentinels: "" for strings, (0,0) for
  grid, Int[] for indices, false for divlines.
- Add type annotations to helper signatures (Dict, String, Bool, Vector{Int}).
- montage(GI) individual-CPT path now uses _montage_adjust_margins! for smart
  margin spacing with titles and colorbars.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@joa-quim joa-quim merged commit 06e1964 into master Feb 23, 2026
5 of 7 checks passed
@joa-quim joa-quim deleted the refactor-montage-helpers branch February 23, 2026 19:01
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Feb 23, 2026

Codecov Report

❌ Patch coverage is 21.71429% with 137 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (master@2789dde). Learn more about missing BASE report.
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
src/montage.jl 21.71% 137 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##             master    #1929   +/-   ##
=========================================
  Coverage          ?   85.47%           
=========================================
  Files             ?      187           
  Lines             ?    27816           
  Branches          ?        0           
=========================================
  Hits              ?    23777           
  Misses            ?     4039           
  Partials          ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

2 participants