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

Rename isweighted -> is_weighted #2953

Merged
merged 2 commits into from
Oct 28, 2023

Conversation

lgoettgens
Copy link
Member

This is used in #2936, and I think it should follow our naming scheme. As the function was not exported before, I think we can omit the deprecation.

Copy link
Member

@fingolfin fingolfin left a comment

Choose a reason for hiding this comment

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

I don't agree that we should export is_weighted at this point, at least not with those methods. And also not without any docstrings on them.

Comment on lines +48 to 49
function is_weighted(P::ProjSpc)
return !all(x->isone(x[1]), P.Rx.d)
Copy link
Member

Choose a reason for hiding this comment

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

I find this method problematic -- why is a projective space in which all weights are 1 "not weighted" ?

@@ -124,7 +124,7 @@ function _unique_var_indices(a::AbstractVector{<:MPolyRingElem})
return z
end

function isweighted(ord::Symbol)
function is_weighted(ord::Symbol)
Copy link
Member

Choose a reason for hiding this comment

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

I find this method problematic: in how far is a symbol weighted? This is perhaps OK for an internal helper, but not for something we export. I would suggest to call this _is_weighted

Copy link
Member

Choose a reason for hiding this comment

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

I have the impression that this function should be removed completely. It is not used (apparently it was used originally for a show method) and monomial orderings should not be represented by symbols nowadays. So if the functionality is needed, there should be a is_weighted(::MonomialOrdering) in my opinion.

It looks like one could easily implement this with

is_weighted(::MonomialOrdering) = false
is_weighted(::WSymbOrdering) = true

but no guarantee.

Copy link
Member Author

Choose a reason for hiding this comment

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

The reason why I opened this PR is that I need this for #2936. Users should be able to provide an ordering via symbol as an input there. So please don't remove

@codecov
Copy link

codecov bot commented Oct 27, 2023

Codecov Report

Merging #2953 (576aeee) into master (d5e7b73) will decrease coverage by 0.04%.
Report is 8 commits behind head on master.
The diff coverage is 50.00%.

@@            Coverage Diff             @@
##           master    #2953      +/-   ##
==========================================
- Coverage   80.38%   80.35%   -0.04%     
==========================================
  Files         469      470       +1     
  Lines       66383    66654     +271     
==========================================
+ Hits        53363    53557     +194     
- Misses      13020    13097      +77     
Files Coverage Δ
src/AlgebraicGeometry/Miscellaneous/basics.jl 64.65% <100.00%> (ø)
...cGeometry/RationalPoint/ProjectiveRationalPoint.jl 53.78% <0.00%> (ø)
src/Rings/orderings.jl 97.05% <0.00%> (ø)

... and 23 files with indirect coverage changes

@lgoettgens lgoettgens changed the title Rename isweighted -> is_weighted and export Rename isweighted -> is_weighted Oct 27, 2023
@fingolfin fingolfin merged commit 2bed7c9 into oscar-system:master Oct 28, 2023
14 of 19 checks passed
@lgoettgens lgoettgens deleted the lg/is-weighted branch November 9, 2023 09:07
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.

None yet

3 participants