Surfaced during #159 review while trying to construct a genuine num_pcs < data_dim test case for AmicaOutput.sources/loadmodout.
Observation
With the Fortran-parity default do_approx_sphere=True, pcakeep < data_dim still yields a full (data_dim, data_dim) (rank-deficient, not shape-reduced) sphere, so num_pcs == data_dim and nothing downstream reduces dimensionality. The only path that actually produces a non-square sphere / num_pcs < data_dim is do_approx_sphere=False + pcakeep, and that currently crashes during fit() itself:
RuntimeError: The size of tensor a (20) must match the size of tensor b (32) at ...
at pyAMICA/torch_impl/core.py:839 (the E-step b = (X - c).T @ W, where the reduced sphere makes the sphered-data channel count disagree with W's dimension).
Why it matters
The genuine PCA-reduction path is unreachable via the public API without hitting this crash, so:
AmicaOutput.sources/loadmodout/load_results have no test coverage for num_pcs < data_dim (they are correct dimensionally under the symmetric-ZCA default, but the reduced path can't be exercised).
- Any user asking for real PCA reduction with
do_approx_sphere=False cannot fit.
Not a regression from #159
Pre-existing; #159 only touches the loader/writer byte order. Filing separately per the parity-regression sequencing rule.
Acceptance
fit() with do_approx_sphere=False + pcakeep < data_dim runs (sphere/W/c dimensions consistent through the E-step), or rejects the combination up front with a clear error if reduced non-symmetric sphering is intentionally unsupported.
- A round-trip test for
sources/loadmodout under genuine num_pcs < data_dim once the fit path works.
Surfaced during #159 review while trying to construct a genuine
num_pcs < data_dimtest case forAmicaOutput.sources/loadmodout.Observation
With the Fortran-parity default
do_approx_sphere=True,pcakeep < data_dimstill yields a full(data_dim, data_dim)(rank-deficient, not shape-reduced) sphere, sonum_pcs == data_dimand nothing downstream reduces dimensionality. The only path that actually produces a non-square sphere /num_pcs < data_dimisdo_approx_sphere=False+pcakeep, and that currently crashes duringfit()itself:at
pyAMICA/torch_impl/core.py:839(the E-stepb = (X - c).T @ W, where the reduced sphere makes the sphered-data channel count disagree withW's dimension).Why it matters
The genuine PCA-reduction path is unreachable via the public API without hitting this crash, so:
AmicaOutput.sources/loadmodout/load_resultshave no test coverage fornum_pcs < data_dim(they are correct dimensionally under the symmetric-ZCA default, but the reduced path can't be exercised).do_approx_sphere=Falsecannot fit.Not a regression from #159
Pre-existing; #159 only touches the loader/writer byte order. Filing separately per the parity-regression sequencing rule.
Acceptance
fit()withdo_approx_sphere=False+pcakeep < data_dimruns (sphere/W/c dimensions consistent through the E-step), or rejects the combination up front with a clear error if reduced non-symmetric sphering is intentionally unsupported.sources/loadmodoutunder genuinenum_pcs < data_dimonce the fit path works.