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

Add @attr types in simple cases #4059

Merged
merged 5 commits into from
Aug 30, 2024

Conversation

lgoettgens
Copy link
Member

If one only adds @attr to a function without giving a type, one shadows all inference of this function for callers of this function as the @attr code changes the inference result to Any. This PR thus adds types there, where it was obvious to me what the return type is, or where the compiler was able to prove a concrete return type (if one removes the @attr to allow for real inference).

The commits are partitioned by the area they touch. Let me ping some people in the different areas here to make them aware / get a review.

Copy link
Collaborator

@afkafkafk13 afkafkafk13 left a comment

Choose a reason for hiding this comment

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

Those in my courtyard are fine. ( src/AlgebraicGeometry/Schemes/CoveredSchemes/Objects/Properties.jl )
ToricVarieties is in @HereAround 's courtyard.

Copy link
Collaborator

@afkafkafk13 afkafkafk13 left a comment

Choose a reason for hiding this comment

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

I'm not @jankoboehm , but from my point of view the changes around rings are spot-on.

Copy link

codecov bot commented Aug 29, 2024

Codecov Report

Attention: Patch coverage is 84.61538% with 4 lines in your changes missing coverage. Please review.

Project coverage is 84.63%. Comparing base (66928b8) to head (b611f87).
Report is 5 commits behind head on master.

Files with missing lines Patch % Lines
...metry/Schemes/CoveredSchemes/Objects/Properties.jl 85.71% 1 Missing ⚠️
src/Rings/MPolyQuo.jl 50.00% 1 Missing ⚠️
src/Rings/mpoly-localizations.jl 75.00% 1 Missing ⚠️
src/Rings/mpolyquo-localizations.jl 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4059      +/-   ##
==========================================
- Coverage   84.66%   84.63%   -0.04%     
==========================================
  Files         600      600              
  Lines       82610    82610              
==========================================
- Hits        69944    69919      -25     
- Misses      12666    12691      +25     
Files with missing lines Coverage Δ
experimental/LieAlgebras/src/AbstractLieAlgebra.jl 90.65% <100.00%> (ø)
...xperimental/LieAlgebras/src/DirectSumLieAlgebra.jl 87.87% <100.00%> (ø)
...ntal/QuadFormAndIsom/src/lattices_with_isometry.jl 99.44% <100.00%> (ø)
...try/ToricVarieties/cohomCalg/special_attributes.jl 92.50% <100.00%> (ø)
src/Groups/group_characters.jl 95.65% <100.00%> (ø)
src/Groups/spinor_norms.jl 82.91% <100.00%> (ø)
src/Modules/local_rings.jl 81.25% <100.00%> (ø)
...metry/Schemes/CoveredSchemes/Objects/Properties.jl 78.57% <85.71%> (ø)
src/Rings/MPolyQuo.jl 91.99% <50.00%> (ø)
src/Rings/mpoly-localizations.jl 77.66% <75.00%> (ø)
... and 1 more

... and 1 file with indirect coverage changes

@StevellM
Copy link
Member

For lattices_with_isometry.jl and spinor_norms.jl, if the tests pass, then I am good.

@ThomasBreuer
Copy link
Member

Yes, this is o.k.

Copy link
Collaborator

@afkafkafk13 afkafkafk13 left a comment

Choose a reason for hiding this comment

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

As everyone answered in the meantime, I now put this on approve.

@joschmitt joschmitt merged commit 8385005 into oscar-system:master Aug 30, 2024
28 checks passed
@lgoettgens lgoettgens deleted the lg/attr-types branch September 2, 2024 13:49
HechtiDerLachs pushed a commit to HechtiDerLachs/Oscar.jl that referenced this pull request Sep 13, 2024
* Add `@attr` type in LieAlgebras

* Add `@attr` type around lattices

* Add `@attr` type around schemes

* Add `@attr` type around rings

* Fix some inference issue in group code
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.

5 participants