Keep StructArray results when broadcasting over ArrayOfRDWaveforms - #55
Open
theHenks wants to merge 3 commits into
Open
Keep StructArray results when broadcasting over ArrayOfRDWaveforms#55theHenks wants to merge 3 commits into
StructArray results when broadcasting over ArrayOfRDWaveforms#55theHenks wants to merge 3 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #55 +/- ##
==========================================
+ Coverage 12.38% 13.15% +0.76%
==========================================
Files 4 4
Lines 113 114 +1
==========================================
+ Hits 14 15 +1
Misses 99 99 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
An ArrayOfRDWaveforms whose signal column is an ArraysOfArrays type
inherits that column's broadcast style, and StructArrays only assembles
a StructArray result for a DefaultArrayStyle parent. Give StructArrays
of RDWaveform a StructArrayStyle{DefaultArrayStyle} so struct-valued
broadcasts (e.g. signalstats.(wvfs, ...)) return a StructArray with
column access, and so elements are read through the RDWaveform-specific
getindex rather than converted to the declared element type.
theHenks
force-pushed
the
fix-structarray-broadcast
branch
2 times, most recently
from
September 12, 2026 13:52
6eaca37 to
c38bf40
Compare
Collaborator
|
I had a similar issue with |
fhagemann
reviewed
Sep 12, 2026
Collaborator
Author
Thanks 🙏🏻 I knew there was some fix for this.... |
The broadcast style of StructArray{<:RDWaveform} is expressed as
StructArrayStyle{S,N}, which exists in this form since StructArrays 0.6.5;
0.6.6 additionally keeps array-valued broadcast results out of StructArray
on Julia 1.10.
Unitful < 1.25.1 spells operator methods as `Base. *(...)`, which the Julia 1.13 parser rejects, so the lower-bound resolution cannot load it.
theHenks
force-pushed
the
fix-structarray-broadcast
branch
2 times, most recently
from
September 13, 2026 12:14
c930d42 to
3b7e72c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since ArraysOfArrays v1,
VectorOfArraysandArrayOfSimilarArrayshave their ownbroadcast style (
NestedArrayStyle), so anArrayOfRDWaveformswith such asignalcolumn gets
StructArrayStyle{NestedArrayStyle{1}}. StructArrays only builds aStructArrayresult for aDefaultArrayStyleparent; otherwise it falls back to a plainbroadcast that returns a
Vectorof structs (column access likesignalstats.(wvfs, a, b).meanfails with aFieldError) and rebuilds elements withconvertto the declared element type, bypassing thegetindexspecialization forStructArray{<:RDWaveform}(fails with aMethodErrorfor lazily read waveforms).This currently breaks the LegendDSP test suite (legend-exp/LegendDSP.jl).
StructArray{<:RDWaveform}gets broadcast styleStructArrayStyle{DefaultArrayStyle{N},N}:StructArrays' native path regardless of the signal column type
(wf -> 2 .* wf.signal).(wvfs)): plain vector of vectors as withArraysOfArrays < 1, no longer
VectorOfArraysStructArrayStyle×NestedArrayStylefix belongs in ArraysOfArrays; thismethod stays correct either way
StructArrayslower bound raised to 0.6.6:StructArrayStyle{S,N}exists since 0.6.5, and 0.6.6 fixesarray-valued broadcasts over
StructArrays on Julia 1.10 (Downgrade CI)🤖 Generated with Claude Code