Skip to content

warn or raise error when merge/wrap inconsistent axes#1691

Open
ykyohei wants to merge 1 commit into
masterfrom
aman_merge_fix
Open

warn or raise error when merge/wrap inconsistent axes#1691
ykyohei wants to merge 1 commit into
masterfrom
aman_merge_fix

Conversation

@ykyohei

@ykyohei ykyohei commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Now I think this was probably intended behavior, but merge and wrap always silently intersect and restrict axes.
Added an on_mismatch to warn or raise error when the coverage of axes with same name are different.

This silent intesection/truncation caused issues in analysis several times, for example when we calculate psd with different length of trimmed data, or after downsampling.
We need to rename axes in such cases but I think default warning (or error) is helpful..

Example:

WARNING: sotodlib.core.axisman: Axis mismatch on merge/wrap causes truncation: axis 'dets' of self changes LabelAxis(3:np.str_('det0'),np.str_('det1'),np.str_('det2')) -> LabelAxis(2:np.str_('det0'),np.str_('det1')).
WARNING: sotodlib.core.axisman: Axis mismatch on merge/wrap causes truncation: axis 'samps' of self changes OffsetAxis(1000:None+0) -> OffsetAxis(900:None+0).

add test

update

update docstring
@ykyohei ykyohei changed the title warn or raise error when merge/warp inconsistent axes warn or raise error when merge/wrap inconsistent axes Jul 7, 2026
@ykyohei ykyohei requested a review from mhasself July 7, 2026 02:32
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