Repository navigation
feat: add show methods for spaces, tensors and BilinearOperator - #23
Merged
Merged
Conversation
Only LinearOperator and BettiSpectrum had one; everything else fell back to the default struct dump, which for a tensor splats the whole coefficient vector into the REPL. Formats mirror the upstream Python `__repr__`s. Un-skips the three repr assertions in the ported Python suite. Closes #15.
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.
Closes #15.
Base.showwas defined only forLinearOperatorandBettiSpectrum; everything else printed as the default struct dump, which for a tensor splats the whole coefficient vector into the REPL.Adds compact
showmethods whose formats mirror the upstream Python__repr__s:The generic space/tensor methods sit in
base_tensor_space.jlandbase_tensor.jl;FormSpaceandDirectSumSpaceoverride them to carry the degree and the summand list. Coefficients are never printed.LinearOperators existingshowis reformatted to thedomain=/codomain=spelling, which the un-skipped upstream assertion requires.Tests
The three previously-skipped repr assertions in
test/test_pyclasses.jlare un-skipped, plus ashowtestset intest_tensor_algebra.jlcovering what upstream does not check (FormSpacedegree,DirectSumSpacesummand list). Full suite: 2441 passing, up from 2417.Note
Several
@assertmessages interpolate a space ("$(a.space)"), so their error text now readsFunctionSpace(dim=50)rather than a struct dump. An improvement, but a change beyond the REPL.