Skip to content

Conversation

@Jutho
Copy link
Member

@Jutho Jutho commented Dec 3, 2025

@lkdvos , this tries to get some sensible default for showing some blocks while respecting the displaysize when :limit = true. Since standard repl printing sets :limit = true, this is the default printing.

However, with the current implementation, this also means that the blocks will be truncated (both the matrices itself and the number of blocks shown) in both the output of the tensor t and in the output of blocks(t).

There might be a case to be made that, if a user calls blocks(t) explicitly as a REPL prompt, the user wants to see all blocks, and so we should "ignore" the default :limit = true setting of REPL printing, at least for truncating the number of blocks, but we could still pass on :limit = true to the individual block printing. This would then be analogous to how an array of size n x n x 10 with large n is shown. All 10 slices along the 3rd dimension are shown, but every slice is truncated such that single slice fits the display.

@Jutho Jutho requested a review from lkdvos December 3, 2025 22:48
@github-actions
Copy link
Contributor

github-actions bot commented Dec 3, 2025

Your PR no longer requires formatting changes. Thank you for your contribution!

@codecov
Copy link

codecov bot commented Dec 3, 2025

Codecov Report

❌ Patch coverage is 91.89189% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/tensors/blockiterator.jl 89.65% 3 Missing ⚠️
Files with missing lines Coverage Δ
src/tensors/abstracttensor.jl 57.07% <100.00%> (+5.11%) ⬆️
src/tensors/blockiterator.jl 38.61% <89.65%> (+23.79%) ⬆️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@lkdvos
Copy link
Member

lkdvos commented Dec 4, 2025

There might be a case to be made that, if a user calls blocks(t) explicitly as a REPL prompt, the user wants to see all blocks, and so we should "ignore" the default :limit = true setting of REPL printing, at least for truncating the number of blocks, but we could still pass on :limit = true to the individual block printing. This would then be analogous to how an array of size n x n x 10 with large n is shown. All 10 slices along the 3rd dimension are shown, but every slice is truncated such that single slice fits the display.

I think I agree with this, which might mean that we really just want a different show method for blocks vs for TensorMap?

Otherwise this definitely looks like a great improvement I can get behind!

@Jutho
Copy link
Member Author

Jutho commented Dec 4, 2025

Ok, I've changed the implementation such that explicitly calling blocks(t) will not truncate all the blocks being shown (but limit is still in effect when showing the individual blocks)

lkdvos
lkdvos previously approved these changes Dec 4, 2025
Copy link
Member

@lkdvos lkdvos left a comment

Choose a reason for hiding this comment

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

Do you think it would make sense to have some dummy tests that just checks that the output of showing a tensor is what it is now, such that we get notified if we (accidentally/intentionally) change this in the future?

Otherwise this looks ready for me.

Co-authored-by: Lukas Devos <ldevos98@gmail.com>
lkdvos
lkdvos previously approved these changes Dec 4, 2025
@lkdvos lkdvos enabled auto-merge (squash) December 4, 2025 23:56
@lkdvos
Copy link
Member

lkdvos commented Dec 5, 2025

I merged the other PR in hope of fixing the CI here, which would then automerge this tonight.

@lkdvos lkdvos merged commit b32f1f4 into main Dec 5, 2025
39 of 42 checks passed
@lkdvos lkdvos deleted the jh/tweakshow branch December 5, 2025 06:10
Jutho referenced this pull request Dec 9, 2025
* initial basic design SectorVector

* some additional functionality

* relax `foreachblock` signature

* replace `SectorDict` with `SectorVector` for eig/svdvals

* export `svd_vals`

* clean up SectorVector design

* small fix

* add finitedifferences support

* update changelog

* some simplifications and extensions

* some further fixes

* some more fixes

* update dates

---------

Co-authored-by: Jutho Haegeman <jutho.haegeman@ugent.be>
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.

3 participants