Skip to content

Smaller cleanups - #12

Open
borisdevos wants to merge 23 commits into
mainfrom
bd/cleanup
Open

borisdevos wants to merge 23 commits into
mainfrom
bd/cleanup

Conversation

@borisdevos

Copy link
Copy Markdown
Member

Besides some refactors, there were some problems with #2 which I fixed here, in particular the unit and dual calculations. I'm surprised they didn't error previously.

Summary of the important parts:

  • I added TensorKit as a weakdep, not sure if this is okay to do, but earlier versions will just behave differently.
  • Iteration over the values is now row-major such that they are sorted. This was previously not the case, and not caught by the TKS testsuite because it only iterates to 10 sectors.
  • Tests are reproducible, and every unitarity check is done now.
  • Less allocations here and there
  • size isn't hardcoded, so the first call to a sector goes through loading the Nsymbols first

Will have to revisit the readme after a package release

@codecov

codecov Bot commented Oct 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
src/bimodulesector.jl 96.68% <100.00%> (+2.34%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@borisdevos
borisdevos requested a review from lkdvos October 30, 2026 16:44
Comment thread src/bimodulesector.jl
end

Base.size(::Type{A4Object}) = 7
Base.size(I::Type{<:BimoduleSector}) = size(_get_dual_cache(I)[3], 1)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looking at this I no longer really remember why we have this definition and it looks a bit odd to me, typically size(x) returns a tuple so maybe this should be (7,) instead, but do you remember what we use this for?

Comment thread src/bimodulesector.jl
data_dict = Dict{NTuple{3, Int}, Dict{NTuple{3, Int}, Int}}()
for row in eachrow(Narray)
i, j, k, a, b, c, N = Int.(@view(row[1:size(I)]))
i, j, k, a, b, c, N = Int.(@view(row[1:7]))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I guess this answers my previous question, does that mean we can remove the Base.size definition?

Comment thread Project.toml
Comment on lines +11 to +13
[weakdeps]
TensorKit = "07d1fe3e-3e46-537d-9eac-e9e13d0d4cec"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why is this a weakdep? That category is typically for package extensions, which I don't think we are defining here?

This branch has not been deployed

No deployments
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.

2 participants