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

Remove divisible, copy documentation to is_divisible_by instead #1618

Merged
merged 3 commits into from
Jan 23, 2024

Conversation

lgoettgens
Copy link
Collaborator

@lgoettgens lgoettgens commented Jan 11, 2024

Resolves oscar-system/Oscar.jl#3178 by removing divisible and promoting is_divisible_by with a fixed docstring instead. (as suggested by @fieker in oscar-system/Oscar.jl#3178 (comment))

This function is already used throughout AbstractAlgebra. Thus I removed the duplicate implementation for (::Integer, ::Integer) here in Nemo.

cc @JohnAAbbott

Copy link

codecov bot commented Jan 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (34c280b) 84.04% compared to head (87ffc41) 84.09%.
Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1618      +/-   ##
==========================================
+ Coverage   84.04%   84.09%   +0.04%     
==========================================
  Files          93       93              
  Lines       36766    36761       -5     
==========================================
+ Hits        30901    30913      +12     
+ Misses       5865     5848      -17     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@fieker fieker left a comment

Choose a reason for hiding this comment

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

Shall we also remove divides? Or is the meaning there clear?

@lgoettgens
Copy link
Collaborator Author

I think divides additionally returns the quotient.
I'll put it into the renaming hackmd for further discussion. But that's for the future

@fieker
Copy link
Contributor

fieker commented Jan 11, 2024 via email

@thofma
Copy link
Member

thofma commented Jan 11, 2024

divides is is_divisible_by with additional quotient. Not sure if this makes sense, we decided upon the names here: #862 (comment). It would be more logical to do is_divisible_by_with_quotient, but decided against it in #862 (comment).

@lgoettgens
Copy link
Collaborator Author

divides is is_divisible_by with additional quotient. Not sure if this makes sense, we decided upon the names here: #862 (comment). It would be more logical to do is_divisible_by_with_quotient, but decided against it in #862 (comment).

Thanks for the ref. I added it to the hackmd.

This PR is good to go then, right?

@lgoettgens
Copy link
Collaborator Author

Ah, CI is failing, but it seems to be some kind of GAP thing:

OscarInterface: Error During Test at /home/runner/.julia/packages/Oscar/1Moid/test/GAP/oscarinterface.jl:5
  Test threw exception
  Expression: GAP.Globals.TestDirectory(GAP.Globals.DirectoriesPackageLibrary(GAP.Obj("OscarInterface"), GAP.Obj("tst")))
  Error thrown by GAP: Error, UndefVarError: `divisible` not defined

summoning our GAP expert @fingolfin since I don't see this function used in the GAP tests at all...

@lgoettgens
Copy link
Collaborator Author

@fingolfin wanted to look at this in the afternoon

@fingolfin
Copy link
Member

Spent the afternoon in renaming discussions... But now I had a look. And it is exactly as I suspected, the error comes from a call into Hecke. Here is condensed version of some of the code being run,

julia> K = GAP.Globals.K
Number field with defining polynomial x^4 + 4*x^3 - 100*x^2 - 208*x + 1744
  over rational field

julia> maximal_order(K)
ERROR: UndefVarError: `divisible` not defined
Stacktrace:
 [1] pmaximal_overorder_at(O::NfOrd, primes::Vector{ZZRingElem})
   @ Hecke ~/.julia/packages/Hecke/HCQ1K/src/NumFieldOrd/NfOrd/MaxOrd/MaxOrd.jl:113
 [2] new_maximal_order(O::NfOrd; index_divisors::Vector{ZZRingElem}, disc::ZZRingElem, ramified_primes::Vector{ZZRingElem})
   @ Hecke ~/.julia/packages/Hecke/HCQ1K/src/NumFieldOrd/NfOrd/MaxOrd/MaxOrd.jl:200
 [3] (::Hecke.var"#2069#2070"{Vector{ZZRingElem}, AnticNumberField})()
   @ Hecke ~/.julia/packages/Hecke/HCQ1K/src/NumFieldOrd/NfOrd/MaxOrd/MaxOrd.jl:44
 [4] get!(default::Hecke.var"#2069#2070"{Vector{ZZRingElem}, AnticNumberField}, h::Dict{Symbol, Any}, key::Symbol)
   @ Base ./dict.jl:479
 [5] get_attribute!(f::Function, G::AnticNumberField, attr::Symbol)
   @ AbstractAlgebra ~/.julia/packages/AbstractAlgebra/R29qD/src/Attributes.jl:230
 [6] MaximalOrder(K::AnticNumberField; discriminant::ZZRingElem, ramified_primes::Vector{ZZRingElem})
   @ Hecke ~/.julia/packages/Hecke/HCQ1K/src/NumFieldOrd/NfOrd/MaxOrd/MaxOrd.jl:42
 [7] MaximalOrder(K::AnticNumberField)
   @ Hecke ~/.julia/packages/Hecke/HCQ1K/src/NumFieldOrd/NfOrd/MaxOrd/MaxOrd.jl:41
 [8] top-level scope
   @ REPL[5]:1

@lgoettgens
Copy link
Collaborator Author

Ah okay, so Hecke doesn't like the deprecation somehow. Let me just mark this breaking then.

@lgoettgens lgoettgens mentioned this pull request Jan 23, 2024
12 tasks
@lgoettgens lgoettgens closed this Jan 23, 2024
@lgoettgens lgoettgens reopened this Jan 23, 2024
@lgoettgens lgoettgens merged commit 83a439e into Nemocas:master Jan 23, 2024
24 of 28 checks passed
@lgoettgens lgoettgens deleted the lg/divisible branch January 23, 2024 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(minor) DOCUMENTATION mistake for divisible
4 participants