Skip to content

Use generic feectools LinearOperator.toarray()/tosparse(), remove LinOpWithTransp - #662

Merged
spossann merged 6 commits into
develfrom
generic-linop-toarray
Oct 3, 2026
Merged

spossann merged 6 commits into
develfrom
generic-linop-toarray

Conversation

@spossann

@spossann spossann commented Oct 2, 2026

Copy link
Copy Markdown
Member

Solves the following issue(s):

Paired with struphy-hub/feectools#89. The feectools submodule points to that PR's branch, so struphy's tests run against it.

Core changes:

  • LinOpWithTransp is removed. Its only extra was toarray_struphy(), since transpose is already abstract in feectools. That method is now the default LinearOperator.toarray() in feectools (feectools#89), so all struphy operators subclass LinearOperator directly.
  • Removed toarray/tosparse overrides that only raised NotImplementedError (several declared as properties) or just forwarded to toarray(is_sparse=True). These classes now use the feectools defaults: the basis projection operators, StencilMatrixFreeMassOperator, AverageOperator, the preconditioners, projectors, variational transport operators, polar operators, BoundaryOperator, and GT_MAT_G.
  • Tests that used toarray_struphy() now call LinearOperator.toarray(M, ...).
  • Feectools submodule bumped to the feectools#89 branch.

Model-specific changes:

None

Documentation changes:

None

Before merging: merge feectools#89 into devel-tiny first, then move the submodule to the new devel-tiny head. Until then the "feectools submodule freshness" check is expected to fail.

🤖 Generated with Claude Code

spossann and others added 2 commits October 2, 2026 13:46
LinOpWithTransp only added toarray_struphy() (transpose is already abstract
in feectools). This method now lives in feectools as the default
LinearOperator.toarray(), so all struphy operators subclass LinearOperator
directly. BoundaryOperator and StencilMatrixFreeMassOperator use the generic
toarray(); their toarray/tosparse are plain methods again (were properties).
Bump feectools submodule to the feature branch commit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Remove toarray/tosparse overrides that only raised NotImplementedError
(several as properties) or forwarded to toarray(is_sparse=True), so the
generic feectools LinearOperator.toarray()/tosparse() apply.
Bump feectools submodule.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
spossann and others added 3 commits October 2, 2026 14:09
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@spossann
spossann requested a review from max-models October 3, 2026 08:48
@spossann
spossann merged commit f630fc8 into devel Oct 3, 2026
30 checks passed
@spossann
spossann deleted the generic-linop-toarray branch October 3, 2026 15:14
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