-
Notifications
You must be signed in to change notification settings - Fork 1
define checkspaces
and findfirstblock_sector
#47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #47 +/- ##
==========================================
+ Coverage 94.40% 94.49% +0.08%
==========================================
Files 20 20
Lines 787 799 +12
==========================================
+ Hits 743 755 +12
Misses 44 44
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Do you say that function findallblocks(r::AbstractGradedUnitRange, s::AbstractSector)
return Block.(findall(==(s), sectors(g)))
end
function findfirstblock(g::AbstractGradedUnitRange, s::AbstractSector)
i = findfirst(==(s), sectors(g))
isnothing(i) && return nothing
return Block(i)
end |
No, it is not about name but about ambiguity error. If I define BlockArrays.findblock(g::AbstractGradedUnitRange, s) = findfirst(==(s), sectors(g))
g = gradedrange([1=>2])
findblock(g, 1) # error We can either specialize I am fine with defining 2 functions, although I do not really have a use case for |
Do we have a use case where the sector isn't an EDIT: I see in the tests where you're using
We can hold off on it for now and keep it in mind, partially I'm trying to anticipate other similar functions we might want so we choose a good interface. |
This PR moves utility functions from
FusionTensors.jl
toGradedArrays.jl
where they belong.I realized defining
BlockArrays.findblock
was ambiguous, so I think we need a different name. Here I proposefindfirstblock_sector
, I would gladly change for better.