Skip to content

Tests for shapes of topological data#64

Open
borisdevos wants to merge 2 commits intomainfrom
bd/shapes
Open

Tests for shapes of topological data#64
borisdevos wants to merge 2 commits intomainfrom
bd/shapes

Conversation

@borisdevos
Copy link
Member

Tackles #60. As left as comment, CategoryData stores the GenericFusion topological data as sparse arrays, so this will fail. Not sure if it's sufficient to just check whether everything's a subtype of AbstractArray{T, N}?

I also had some fusion ring checks lying around and decided to add them. It might be overkill, since it'll be a bunch of 0=0 or 1=1 equations 🫠

@codecov
Copy link

codecov bot commented Feb 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

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

Comment on lines +60 to +62
TF_actual = Core.Compiler.return_type(Fsymbol, NTuple{6, I})
TF_imposed = FusionStyle(I) isa MultiplicityFreeFusion ? Ftype : Array{Ftype, 4} # won't work for sparse arrays (CategoryData)
@test TF_actual == TF_imposed
Copy link
Member

Choose a reason for hiding this comment

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

I don't think this is really what I had in mind, the TF_actual should simply be scalartype(Fsymbol(...)) for concrete values, while the TF_imposed is fusionscalartype(I).
We indeed do not want to put restrictions on the type of object that is output by Fsymbol.

Copy link
Member Author

@borisdevos borisdevos Feb 7, 2026

Choose a reason for hiding this comment

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

But this is already being tested in

@test eltype(F) === @testinferred fusionscalartype(I)
if BraidingStyle(I) isa HasBraiding
R = @testinferred Rsymbol(s...)
@test eltype(R) === @testinferred braidingscalartype(I)

Though I do agree that testing types is not good

@test size(Fsymbol(a, b, c, d, e, f)) == F_size
end
end

Copy link
Member

Choose a reason for hiding this comment

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

We may also consider adding tests for invalid fusion channels, as I think this would be easier to have uncaught errors in

Copy link
Member Author

Choose a reason for hiding this comment

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

This is tied together to a test suite that works for multifusion and fusion categories together, which remains difficult to realise 🫠 but I can differ between SimpleUnit and GenericUnit for this specific test easily if wanted

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