Oscar.jl
Oscar.jl copied to clipboard
Banners
The issue of banners for your projects comes up about every 6 months. So we, the project leaders, discussed it and recording this here, as an issue to be able to link against this.
Computer Algebra Systems always have banners
- Julia, Maple, Mathematica, Maple, ...
- Gap, Singular, Polymake Thus our "cornerstones" have banners - which can be suppressed in non-interactive mode.
Now we added a new, interactive, user interface to our systems, so of course, we display banners on interactive use - and do not print them otherwise. In Oscar, we "accumulate" the individual banners into the Oscar one.
Hecke/ Nemo are intended also as computer algebra systems, not "only" as libraries, thus have banners - which are not shown unless we are interactive.
It's worth adding that we have been removing banners where this is actually desirable (e.g. non-interactive/library use), but that this has been technically very difficult.
We apologise to everyone who has been affected by this. The issue is being addressed as we are able.
Hi, so is there a way to disable showing the banner by default when using Oscar as a dependency in a project? In out code, we have not just Oscar but all of its dependecies showing banners as well. It would be nice to have unified way to disable the display by default (i.e. an ENV
value).
If Oscar is a dependency of something else, then I agree that at most it should show its banner, but not the dependencies. That this is not currently the case is a bug!
Here's what e.g. GAP.jl
does:
if haskey(ENV, "GAP_SHOW_BANNER")
show_banner = ENV["GAP_SHOW_BANNER"] == "true"
else
show_banner =
isinteractive() && !any(x -> x.name in ["Oscar"], keys(Base.package_locks))
end
The use of the (undocumented) Base.package_locks
is likely the core of the problem. But that code isn't by me, so I don't know right now how to fix it. Perhaps @fieker has an idea.
Note that for GAP.jl and also Hecke.jlNemo.jl you can turn off the banner with an env var. While it shouldn't be necessary here, you could use that as a workaround. We should also consider adding similar env var overrides to more of the OSCAR packages.
We don't have it in Hecke yet, but after talking to @fieker, we decided to add it soon.
I meant Nemo.jl, not Hecke.jl, my bad.
@fingolfin I put this line at the top of my module like so:
module MyModule
ENV["NEMO_PRINT_BANNER"] = "false"
and it still prints the banner. Is it such placement correct?
module MyModule ENV["NEMO_PRINT_BANNER"] = "false"
It is too late. The banner is printed before this line is reached.
If it is only about your use, you can add the following line to .julia/config/startup.jl
:
ENV["NEMO_PRINT_BANNER"] = false
Not sure this is the right place for such a discussion but how about a banner that takes a little less vertical space and possibly uses unicode for smoother rendering?
Some attempts starting with the current Oscar banner.
Current: ascii, 7-line:
----- ----- ----- - -----
| | | | | | | | | |
| | | | | | | |
| | ----- | | | |-----
| | | | |-----| | |
| | | | | | | | | |
----- ----- ----- - - - -
Ascii, 5-line:
--- --- --- - ---
| | | | / \ | |
| | --- | --- |---
| | | | | | | |
--- --- --- - - - -
Unicode, 5-line:
╭───╮ ╭───╮ ╭───╮ ╭───╮ ┌───╮
│ │ │ │ │ │ │ │
│ │ ╰───╮ │ ├───┤ ├──<
│ │ │ │ │ │ │ │
╰───╯ ╰───╯ ╰───╯ ┴ ┴ ┴ ┴
Unicode, 3-line:
╭──╮ ╭──╮ ╭──╮ ╭──╮ ┌──╮
│ │ ╰──╮ │ ├──┤ ├─<
╰──╯ ╰──╯ ╰──╯ ┴ ┴ ┴ ┴
Unicode, 4-line:
╭───╮
│ │ ╭──╮ ╭──╮ ╭──╮ ┌──╮
│ │ ╰──╮ │ ├──┤ ├─<
╰───╯ ╰──╯ ╰──╯ ┴ ┴ ┴ ┴
I absolutely agree with (the first part of) https://github.com/Nemocas/AbstractAlgebra.jl/issues/158#issuecomment-429669467 and think no message should be displayed at all.