-
Notifications
You must be signed in to change notification settings - Fork 130
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
Limit the number of global objects #1379
Comments
I don't see the harm in |
Um, the list of global objects is quite a bit longer than this... |
I'd limit it to at most QQ and ZZ. I don't see QQBar universally used, so I'd rather not have QQBar globally predefined. - neither QQi, ZZi, Qab, .... I think they are all niche types - most users will never use them. |
Regarding caches and FooBarID: as long as those are not I don't think and "oscar init file" is a workable solution, or at least it's not so easy to see how this should be done: for one thing, we'd only want this to be in effect when |
I don't understand the Oscar init file. If it is per user, it should go into |
On Thu, Jun 09, 2022 at 06:19:26AM -0700, Tommy Hofmann wrote:
I don't understand the Oscar init file. If it is per user, it should go into `$JULIAHOME/startup.jl`. Otherwise it is just somewhere in Oscar.
It is hard to add
QQ = rationals();
in startup.jl as oscar is not loaded at this point.
However, in Oscar we could, at the end of loading everything also
evaluate a user file - if present.
… --
Reply to this email directly or view it on GitHub:
#1379 (comment)
You are receiving this because you were mentioned.
Message ID: ***@***.***>
|
I see. But I have some reservations about Oscar loading random files. I am also not sure what loading means. Load into which namespace? To move forward we can
|
As someone who may have initiated the discussion: I'm happy with ZZ and QQ only (but these should exist for convenience). I just thought that when it was decided there's QQBar, there could be QQAb as well. I was surprised by QQi and feared QQsqrt2 may come next. |
On Thu, Jun 09, 2022 at 06:47:28AM -0700, Tommy Hofmann wrote:
I see. But I have some reservations about Oscar loading random files. I am also not sure what loading means. Load into which namespace?
A separate diskussion for when we are bored with life
To move forward we can
1. just remove `QQi`, `ZZi` `QQBar`,
2. write down in the developer documentation that we these are the only two exceptions.
Agreed
… --
Reply to this email directly or view it on GitHub:
#1379 (comment)
You are receiving this because you were mentioned.
Message ID: ***@***.***>
|
|
Yes, indeed. As of the current master (eb8ea10), the list is as follows: julia> filter(name -> !(typeof(getfield(Oscar, name)) <: Union{Function, DataType, UnionAll}), names(Oscar)) |> (x -> show(IOContext(stdout, :limit => false), "text/plain", x))
29-element Vector{Symbol}:
:ANTIC
:AbstractAlgebra
:CalciumQQBar
:FieldElement
:FlintQQ
:FlintQQi
:FlintZZ
:FlintZZi
:GAP
:Generic
:Graphs
:Hecke
:IntExt
:Native
:Nemo
:OSCAR
:Oscar
:Polymake
:QQ
:QQBar
:RDF
:RationalUnion
:RingElement
:Singular
:VarName
:ZZ
:error_dim_negative
:inf
:oscar I would group them as follows:(Sub)-modules of Oscar packages:ANTIC
AbstractAlgebra
GAP
Generic
Graphs
Hecke
Native
Nemo
OSCAR
Oscar
oscar
Polymake
Singular I think the cornerstones should be exported, but what about stuff like Often used rings/fieldsCalciumQQBar
FlintQQ
FlintQQi
FlintZZ
FlintZZi
QQ
QQBar
ZZ Summarizing the previous discussion, only Type unionsFieldElement
IntExt
RationalUnion
RingElement
VarName In my opinion either export all or none (and then the same for the ones missing here like Miscerror_dim_negative
inf
RDF I have no idea what they are used for, so no idea. |
I am taking care of IMHO we also should not (re-)export at least these:
|
Updated list as of 91d2938 julia> filter(name -> !(typeof(getfield(Oscar, name)) <: Union{Function, DataType, UnionAll}), names(Oscar)) |> (x -> show(IOContext(stdout, :limit => false), "text/plain", x))
27-element Vector{Symbol}:
:ANTIC
:AbstractAlgebra
:BasisLieHighestWeight
:FieldElement
:FlintQQ
:FlintQQi
:FlintZZ
:FlintZZi
:GAP
:Generic
:Hecke
:IntExt
:MPolyDecRingOrQuo
:NCRingElement
:Native
:Nemo
:Oscar
:Polymake
:QQ
:RDF
:RationalUnion
:RingElement
:Singular
:Strassen
:VarName
:ZZ
:inf |
removing also all unions and modules, we get this:
|
I'd also remove Flint* |
Lars @lgoettgens is looking at removing the stuff |
Triage decided to remove all uses of the four |
What about I think after that and removing the |
After discussion with @fieker, we agreed that Oscar should try to minimize the number of global (non-function) objects it defines.
We should write up some rules for that and document this in the style guide. Two possible rules of thumb:
Of course these are (necessarily) soft rules, but they give a rough idea, and if in doubt, we'll have to discuss it -- but if those are in the style guides, then at least people have a chance to act about them.
I'll try to illustrate further with concrete (counter) examples:
The current globals
QQ
andZZ
satisfy both of these: they are used virtually everywhere; and they are singletons, so it doesn't get more unique than that.In contrast, we think that e.g.
QQi
,ZZi
,QQBar
should not be there (at least should not be exported to the user name space by default:QQi
is not even aNumberField
, and differs completely fromquadratic_field(-1)[1]
; andQQBar
is just "a" algebraic closer of the rationals, for very specific applications)Thoughts, comments, ideas?
The text was updated successfully, but these errors were encountered: