-
-
Notifications
You must be signed in to change notification settings - Fork 4
Update Tutorials #26
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
Update Tutorials #26
Conversation
@ChrisRackauckas I think these are better |
docs/src/developer_tutorial.md
Outdated
3. Log levels - Predefined log levels (`Silent`, `InfoLevel`, `WarnLevel`, `ErrorLevel`, `CustomLevel(n)`) | ||
4. Verbosity preset levels - `None`, `Minimal`, `Standard`, `Detailed`, `All` | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Explain this a bit. It sounds redundant without more information. What happens if you use both? Etc.
docs/src/developer_tutorial.md
Outdated
- Type parameter T: Controls whether logging is enabled (T=true) or disabled (T=false). When `T = false`, any use of the `SciMLLogging.emit_message` function points to any empty function. When the the type parameter is known at compile time, this allows for the compiler to make certain optimizations that can lead to this system having zero runtime overhead when not in use. | ||
- Message levels: Fields of the `AbstractVerbositySpecifier` represent messages or groups of messages. These fields should be of the type `SciMLLogging.MessageLevel`. Each message level subtype represents a different level at which the message will be logged at. | ||
### @SciMLMessage |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't make sense. Can you share an example?
docs/src/developer_tutorial.md
Outdated
``` | ||
|
||
This example shows the minimal structure needed to integrate SciMLLogging into a package. | ||
This example shows the minimal structure needed to integrate SciMLLogging into a package. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tutorial starts here? Why is there effectively a manual page on the top of the tutorial? Why isn't there a manual page for the manual page information?
docs/src/developer_tutorial.md
Outdated
This example shows the minimal structure needed to integrate SciMLLogging into a package. | ||
This example shows the minimal structure needed to integrate SciMLLogging into a package. | ||
|
||
## Utility Functions for Integration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is manual page information... why is this here??????
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I'll set up a separate manual page and put this stuff there.
docs/src/developer_tutorial.md
Outdated
### `verbosity_to_int()` | ||
|
||
Converts a `MessageLevel` to an integer value. This is useful when interfacing with packages that use integer-based verbosity levels: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is docstring information. Why is it not in a docstring?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's in the docstring for verbosity_to_int
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then why is it copied? You already violated the standard style by just making an API
page, instead there just needs to be a manual page where the right docstrings have the right information around it, rather than just dumping docstrings in a random order with no context.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't create the api.md
file, that was Claude c147cab
I'll take a look at the Documentation part of the SciML style guide and fix these up
docs/src/user_tutorial.md
Outdated
- **`T` parameter**: Controls whether logging is enabled (`T=true`) or disabled (`T=false`) | ||
- **Each field**: Represents a category of messages the package can emit | ||
- **MessageLevel values**: Can be `Silent()`, `InfoLevel()`, `WarnLevel()`, `ErrorLevel()`, or `CustomLevel(n)` for custom levels | ||
- **`T` parameter**: Controls whether logging is enabled (`T=true`) or disabled (`T=false`) for all messages |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is there a T if there's also the message levels? Why wouldn't you just construct with all Silent
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having the T there allowed the actual construction of the LinearVerbosity object to be compiled out in earlier iterations. Moving to the types for all of the levels seems to have broken that but I thought it might be useful to keep around in case I can get that working again.
It's not strictly necessary to make it work, so I could get rid of it.
docs/src/user_tutorial.md
Outdated
- `Silent()` : no message is emitted | ||
- `InfoLevel()` : message is emitted as an `Info` log | ||
- `WarnLevel()` : message is emitted as a `Warn` log | ||
- `ErrorLevel()` : message is emitted as an `Error` log | ||
- `CustomLevel(n)` : message is emitted at `LogLevel(n)` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these types? How does ::MessageLevel
work then? Don't those all have to be MessageLevel
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh... this is misnamed... https://github.com/SciML/SciMLLogging.jl/blob/main/src/verbosity.jl#L13 this kind of stuff really shouldn't need iterations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Misnamed how exactly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AbstractMessageLevel
docs/src/user_tutorial.md
Outdated
initialization::MessageLevel # Controls startup messages | ||
iterations::MessageLevel # Controls per-iteration output | ||
convergence::MessageLevel # Controls convergence messages | ||
warnings::MessageLevel # Controls warning messages | ||
error_control::MessageLevel # Controls messages about solver error |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Won't this be uninferred?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possibly since MessageLevel is an abstract type. I had no issues when testing LinearVerbosity with it set up like this though, JET tests pass etc. though we can change it to be all concrete and maybe we should.
Really this is up to whoever is implementing the AbstractVerbositySpecifier, the fields just need to be <: MessageLevel to be compatible with the macro.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should probably be made concrete though, otherwise it won't compile out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logging code can still be compiled out when Silent() is used, even if they aren't concrete, I show it here: SciML/LinearSolve.jl#756 (comment)
But yeah only reason not to make it concrete is to be able to change logging levels with setproperty!, which was a request someone had. But that's not really that important
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No supporting setproperty with this is a bad idea.
docs/src/user_tutorial.md
Outdated
- `ErrorLevel()` : message is emitted as an `Error` log | ||
- `CustomLevel(n)` : message is emitted at `LogLevel(n)` | ||
|
||
When `T=false`, all logging is disabled with zero runtime overhead. When `T=true`, each category can be individually controlled. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does this exist if there are presets?
docs/src/user_tutorial.md
Outdated
|
||
Here's an example of how one might use a packages `AbstractVerbositySpecifier` implementation to control the output. | ||
|
||
Here's an example of how one might use a packages `AbstractVerbositySpecifier` implementation to control the output, using the same `SolverVerbosity` type as above. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't the main way people use this be via Presets? So why are the details coming before the simple use case?
docs/src/user_tutorial.md
Outdated
Note: You need to restart Julia after changing the backend preference in order to use the chosen backend. | ||
|
||
|
||
## Common Scenarios |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This section is just redundant information.
87dad2c
to
924ee09
Compare
ec79818
to
fc6397c
Compare
|
docs/src/getting_started.md
Outdated
|
||
**Available Presets:** | ||
- `None()`: No output at all (zero overhead) | ||
- `Minimal()`: Only essential messages and warnings | ||
- `Standard()`: Balanced verbosity for typical usage | ||
- `Detailed()`: Comprehensive information for debugging | ||
- `All()`: Maximum verbosity |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
**Available Presets:** | |
- `None()`: No output at all (zero overhead) | |
- `Minimal()`: Only essential messages and warnings | |
- `Standard()`: Balanced verbosity for typical usage | |
- `Detailed()`: Comprehensive information for debugging | |
- `All()`: Maximum verbosity |
@ChrisRackauckas anything else? |
It's still missing the main manual page. |
bbf0bbc
to
4618f8a
Compare
docs/src/manual/presets.md
Outdated
|
||
Use `Minimal` when you want to be informed of important issues but don't need detailed progress information. | ||
|
||
**What to include at each level:** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
**What to include at each level:** | |
**What to include at this level:** |
docs/src/manual/presets.md
Outdated
**Typical message categories:** | ||
- Errors: `ErrorLevel()` | ||
- Warnings: `WarnLevel()` | ||
- Everything else: `Silent()` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this mean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part is meant more for the people implementing the presets. I wanted to give a rough idea of what log levels should be included each preset, and what should be silent.
So for the Minimal preset, you would only want errors and warnings to show up in the logs, and you would want to log them at the error level and the warning level. Then all other informational things should be silent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I know that's what it's for, but it's not understandable. Why not just write a normal sentence?
docs/src/manual/presets.md
Outdated
Use `Minimal` when you want to be informed of important issues but don't need detailed progress information. | ||
|
||
**What to include at each level:** | ||
- **WarnLevel or higher**: Warnings about potential issues (e.g., convergence problems, parameter choices that may affect results, deprecated features) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it better if this kind of stuff is in the docstrings for each preset?
docs/src/manual/presets.md
Outdated
|
||
**What to include at each level:** | ||
- **WarnLevel or higher**: Warnings about potential issues (e.g., convergence problems, parameter choices that may affect results, deprecated features) | ||
- **ErrorLevel**: Critical failures and errors that stop computation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this true?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think so? What else would we want to use ErrorLevel for?
docs/src/manual/presets.md
Outdated
- **InfoLevel or higher**: Important initialization messages (e.g., algorithm selection, key parameter values), significant milestones, convergence status, final results, warnings, and errors | ||
- **WarnLevel or higher**: All warnings and errors as in `Minimal` | ||
- **ErrorLevel**: All critical failures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copied? Is there a reason to not just say it has all of below and?
It is completely not understandable what should be in each level. Try again. Is that Claude because it's really bad? This is really wasting time to have me review your Claude output without you ever reading it. |
Not trying to waste your time. These made sense in my head, good to know they were confusing. I moved the descriptions of what each preset should have in to the docstrings, and made them read more like a sentence. Hopefully they make more sense now. Also let me know your opinion on #29. If we want |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs examples of what kinds of things would go into each category.
|
||
The `All` preset enables maximum verbosity, useful for deep debugging or understanding complex behaviors. | ||
|
||
## Custom Presets |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does this work? It doesn't dispatch?
src/verbosity.jl
Outdated
This verbosity preset should include the settings from `Minimal`, while also setting | ||
messages such as important initialization messages (e.g., algorithm selection, key parameter values), | ||
significant milestones, convergence status, final results to `InfoLevel()` or higher. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what do you mean by significant milestones?
src/verbosity.jl
Outdated
(e.g., iteration counters, intermediate state), performance metrics | ||
(e.g., timing information, memory usage), detailed diagnostics, and internal state information. | ||
The only messages that should be `Silent()` at this preset are very small details that would | ||
clutter output even during debugging. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clutter output even during debugging. | |
clutter output even during debugging and outputs that require a significant amount of additional computation | |
(for example, computing condition numbers of matrices which are normally not computed during the standard | |
usage). |
src/verbosity.jl
Outdated
This verbosity preset should set messages related to critical failures and | ||
errors that stop computation to `ErrorLevel`. Messages related to potential issues | ||
(e.g., convergence problems, parameter choices that may affect results, deprecated features) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(e.g., convergence problems, parameter choices that may affect results, deprecated features) | |
(e.g., convergence problems, solver exiting, etc.) |
This verbosity preset should include the settings from `Minimal`, while also setting | ||
messages such as important initialization messages (e.g., algorithm selection, key parameter values), | ||
significant milestones, convergence status, final results to `InfoLevel()` or higher. | ||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
""" | |
Deprecation warnings should be included at `WarnLevel()`. Critical but non-fatal warnings, such as | |
major performance warnings about fallbacks related to a given problem/solver choice, should be | |
included at this level. | |
""" |
src/verbosity.jl
Outdated
the user with details. | ||
This verbosity preset should include the settings from `Minimal`, while also setting | ||
messages such as important initialization messages (e.g., algorithm selection, key parameter values), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, we shouldn't print algorithm selection by default or key parameter values... that would be really noisy. We don't do that standard so why would we change that?
What are the message levels and why aren't they 1-1 with presets? Why are they using names |
I will merge so it has my updates, but there are still a lot of nonsensical things in here. |
Checklist
contributor guidelines, in particular the SciML Style Guide and
COLPRAC.
Additional context
Add any other context about the problem here.