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

Replace type declarations #2981

Merged
merged 3 commits into from
Nov 5, 2023

Conversation

fingolfin
Copy link
Member

Type declarations insert convert calls. Instead, use type assertions
(which just verify the object has the right type to start with), or
fix the code to actually be type stable and return the right type.

Type declarations insert `convert` calls. Instead, use type assertions
(which just verify the object has the right type to start with), or
fix the code to actually be type stable and return the right type.
end
n = AbstractAlgebra.leading_coefficient(top_form.f)
m = AbstractAlgebra.leading_coefficient(polynomial(volume_form(toric_variety(c))).f)
return QQFieldElem(n//m)
return QQFieldElem(n,m)
Copy link
Member

Choose a reason for hiding this comment

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

@fingolfin Unless I am mistaken, this change leads to the CI-failures in 1.6 ubuntu-latest: no method matching QQFieldElem(::QQFieldElem, ::QQFieldElem).

Generally speaking, your changes look good to me. In particular, I would hope that once the above line is fixed, the tests pass again.

Copy link
Member

Choose a reason for hiding this comment

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

Maybe QQFieldElem(ZZ(n), ZZ(m)) might work.

Copy link
Member

Choose a reason for hiding this comment

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

I just tested this fix, and it seems to work. So I have taken the liberty to push a corresponding fix.

(Origin: m, n are coefficients of polynomials with rational coefficients. So by construction, they are rational numbers.)

Copy link
Member

@HereAround HereAround left a comment

Choose a reason for hiding this comment

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

Modulo the minor change above, this PR looks good to me. Thank you @fingolfin . (But as always, let us see if the tests pass...)

@thofma
Copy link
Collaborator

thofma commented Nov 4, 2023

Tests are not passing with a genuine error

@fingolfin fingolfin enabled auto-merge (squash) November 4, 2023 18:26
@fingolfin fingolfin closed this Nov 4, 2023
auto-merge was automatically disabled November 4, 2023 23:29

Pull request was closed

@fingolfin fingolfin reopened this Nov 4, 2023
@fingolfin fingolfin enabled auto-merge (squash) November 4, 2023 23:29
Copy link

codecov bot commented Nov 5, 2023

Codecov Report

Merging #2981 (e40c4f3) into master (a04a050) will decrease coverage by 0.35%.
Report is 8 commits behind head on master.
The diff coverage is 66.66%.

@@            Coverage Diff             @@
##           master    #2981      +/-   ##
==========================================
- Coverage   80.22%   79.88%   -0.35%     
==========================================
  Files         473      473              
  Lines       67257    67909     +652     
==========================================
+ Hits        53960    54249     +289     
- Misses      13297    13660     +363     
Files Coverage Δ
...try/Schemes/CoveredSchemes/Morphisms/Attributes.jl 61.11% <100.00%> (ø)
src/Rings/mpoly-affine-algebras.jl 80.27% <66.66%> (ø)
...ometry/ToricVarieties/CohomologyClasses/methods.jl 60.00% <57.14%> (ø)

... and 9 files with indirect coverage changes

@fingolfin fingolfin merged commit 0f7269b into oscar-system:master Nov 5, 2023
30 of 42 checks passed
@fingolfin fingolfin deleted the mh/type-assertions branch May 29, 2024 15:53
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.

3 participants