Skip to content

v2.0.0 — imap, MappedRef, modular source layout#10

Merged
AFeuerpfeil merged 6 commits intomainfrom
fix/broadcast-style
Apr 2, 2026
Merged

v2.0.0 — imap, MappedRef, modular source layout#10
AFeuerpfeil merged 6 commits intomainfrom
fix/broadcast-style

Conversation

@AFeuerpfeil
Copy link
Copy Markdown
Member

@AFeuerpfeil AFeuerpfeil commented Apr 2, 2026

Summary

  • Breaking: PeriodicArray type signature extended from {T,N,A,F} to {T,N,A,F,G} — adds G for the inverse map type; internal field renamed from .map to .fmap, new .imap field added
  • Breaking: Source reorganised into separate files (types.jl, indexing.jl, broadcast.jl, vector_interface.jl, repeat.jl, circshift.jl, reverse.jl, mapped_ref.jl)
  • New: PeriodicArray accepts an explicit imap argument for setindex!; defaults to NegatedShiftMap(fmap) (i.e. (x, shifts...) -> fmap(x, -shifts...)) preserving previous behaviour
  • New: MappedRef type and mapped_ref(arr, I...) — lazy mutable wrapper for out-of-bounds elements that applies fmap on reads and imap on writes, fixing the long-standing limitation where iterated mutation (x[i][j] = v) silently did nothing

Breaking changes:
- PeriodicArray type signature: {T,N,A,F} → {T,N,A,F,G} (adds imap type param G)
- Internal field renamed from .map to .fmap; new .imap field added
- Source split into types.jl, indexing.jl, broadcast.jl, vector_interface.jl,
  repeat.jl, circshift.jl, reverse.jl, mapped_ref.jl

New features:
- PeriodicArray now accepts an explicit imap for setindex! (defaults to
  NegatedShiftMap(fmap) when omitted, preserving previous behaviour)
- New MappedRef type and mapped_ref(arr, I...) for lazy mutable out-of-bounds
  element access, fixing iterated mutation (e.g. x[i][j] = v)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 2, 2026

Your PR no longer requires formatting changes. Thank you for your contribution!

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 2, 2026

Codecov Report

❌ Patch coverage is 98.42105% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/broadcast.jl 81.25% 3 Missing ⚠️

📢 Thoughts on this report? Let us know!

@AFeuerpfeil AFeuerpfeil changed the title feat!: v2.0.0 — imap, MappedRef, modular source layout v2.0.0 — imap, MappedRef, modular source layout Apr 2, 2026
@AFeuerpfeil AFeuerpfeil merged commit f76ad83 into main Apr 2, 2026
43 checks passed
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