Skip to content
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

Resolve some issues of unbound type parameters #3060

Merged
merged 11 commits into from
Jan 4, 2024

Conversation

lgoettgens
Copy link
Member

Once all of them are resolved, we can enable the Aqua check unbound_args.

Most fixes were just minor reordering of a method header, such that the type parameter no longer gets instantiated. In some cases with varargs, it seemed more reasonable to split the method into two (one with 0 args, and one with at least 1 arg).

@lgoettgens lgoettgens added WIP NOT ready for merging optimization Simpler/more performant code or more/better tests and removed WIP NOT ready for merging labels Nov 30, 2023
@lgoettgens lgoettgens changed the title Resolve issues of unbound type parameters Resolve some issues of unbound type parameters Dec 5, 2023
@lgoettgens
Copy link
Member Author

This is done for now. All remaining instances have to do with direct_sum and tensor_product, and I do not want to interfere with #3059.

Copy link

codecov bot commented Dec 5, 2023

Codecov Report

Merging #3060 (50ab8dc) into master (cb10ff4) will increase coverage by 0.00%.
Report is 14 commits behind head on master.
The diff coverage is 93.10%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3060   +/-   ##
=======================================
  Coverage   80.49%   80.50%           
=======================================
  Files         523      521    -2     
  Lines       70413    70413           
=======================================
+ Hits        56677    56683    +6     
+ Misses      13736    13730    -6     
Files Coverage Δ
experimental/GModule/Cohomology.jl 67.55% <100.00%> (+0.10%) ⬆️
src/Groups/directproducts.jl 94.59% <ø> (ø)
src/Groups/gsets.jl 93.65% <100.00%> (ø)
src/Groups/perm.jl 99.27% <100.00%> (ø)
src/Groups/sub.jl 97.10% <100.00%> (-0.09%) ⬇️
src/InvariantTheory/invariant_rings.jl 91.32% <100.00%> (+0.05%) ⬆️
.../PolyhedralGeometry/Cone/standard_constructions.jl 100.00% <100.00%> (ø)
...alGeometry/PolyhedralFan/standard_constructions.jl 100.00% <100.00%> (ø)
src/PolyhedralGeometry/Polyhedron/properties.jl 83.98% <100.00%> (ø)
src/Rings/PBWAlgebraQuo.jl 84.40% <100.00%> (ø)
... and 3 more

... and 17 files with indirect coverage changes

@lgoettgens lgoettgens marked this pull request as ready for review December 5, 2023 22:15
Comment on lines +70 to +71
function invariant_ring(R::MPolyDecRing, m::MatrixElem{T}, ms::MatrixElem{T}...) where {T}
return invariant_ring(R, [m, ms...])
Copy link
Member

Choose a reason for hiding this comment

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

Dumb question: is this faster/better/prettier than what was there before?
Looking at this signature, I would now expect that m and ms have different meanings in this function and not that they are just put together in the same vector.
(If it is only about the T we could do

Suggested change
function invariant_ring(R::MPolyDecRing, m::MatrixElem{T}, ms::MatrixElem{T}...) where {T}
return invariant_ring(R, [m, ms...])
function invariant_ring(R::MPolyDecRing, matrices::MatrixElem...)
return invariant_ring(R, collect(matrices))

as the T is not used... If somebody puts in matrices of different types, this will error if the entries cannot be cast in the coefficient ring of the polynomial ring.)

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 about the existence of a dispatch where the T is not instantiated.

Your suggestion would be (mostly) fine as well. The single drawback is, that the type of collect(matrices) gets inferred as Vector{Any} for the 0-arg case.

Copy link
Member

Choose a reason for hiding this comment

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

(I think we should actually throw a meaningful error if there are no matrices, but that's off-topic for now.)
I can't say I can see the ramification of this function not having a completely well-defined return type. I find the new signature confusing (for the human); if it is less confusing for the computer, that's fine by me.

@benlorenz
Copy link
Member

The documentation build is still failing, probably one of the signatures there needs to be updated:

┌ Error: no docs found for 'intersect(V::T...) where T<:GAPGroup' in `@docs` block in src/Groups/subgroups.md:30-41

@thofma thofma merged commit 5c58698 into oscar-system:master Jan 4, 2024
19 checks passed
@lgoettgens lgoettgens deleted the lg/unbound_args branch January 4, 2024 18:58
paemurru pushed a commit to paemurru/Oscar.jl that referenced this pull request Jan 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
optimization Simpler/more performant code or more/better tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants