Skip to content

Feature/add sh axis property multichannel#329

Draft
tluebeck wants to merge 5 commits into
feature/add_sh_axis_propertyfrom
feature/add_sh_axis_property_multichannel
Draft

Feature/add sh axis property multichannel#329
tluebeck wants to merge 5 commits into
feature/add_sh_axis_propertyfrom
feature/add_sh_axis_property_multichannel

Conversation

@tluebeck

Copy link
Copy Markdown
Contributor

Which issue(s) are closed by this pull request?

Closes #327

Changes proposed in this pull request:

@tluebeck tluebeck requested a review from mberz May 18, 2026 14:01
@mberz mberz changed the base branch from develop to feature/add_sh_axis_property May 21, 2026 16:33

@mberz mberz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks very much feasible!
I think we'll need an update to the n_max property and additional checks to ensure that the order of each dimensions corresponding to spherical harmonic data matches.
Or would you suggest to allow different orders for each dimension?

Comment thread spharpy/spherical.py Outdated
Comment on lines +288 to +295
# check if all sh_channels match
sh_channels = [data.shape[a] for a in axis]

if len(set(sh_channels)) != 1:
raise ValueError(
"All SH axes must have the same number of channels, "
f"but got {sh_channels}"
)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this check should not be necessary, since the order governs the total number of channels. So all axes containing spherical harmonic data should have the same length.

So this check should probably be moved to the respective SphericalHarmonic* classes.

Comment thread spharpy/spherical.py Outdated
# check if all sh_channels match
sh_channels = [data.shape[a] for a in axis]

if len(set(sh_channels)) != 1:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment as above. Implementing the check also makes individual checks in each function obsolete.

tluebeck added 2 commits May 22, 2026 10:31
move check if all spherical harmonics axes have equal length to data init
test change_channel_convention and renormalize with mutlichannel data
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