-
Notifications
You must be signed in to change notification settings - Fork 393
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
Docs: Fix issues callback docs #867
Conversation
- Added/removed some blank lines for consistency - Some entries like 'event_' were interpreted as links, so I added code markers around them. - Added usage example to TensorBoard docstring - Fixed a copy paste error in WandbLogger - Some links were not parsed correctly, so I used different syntax - Fixed issue in code example of SacredLogger What I would like to know: Is it possible to have blank lines inside example code blocks without starting a completely new block? Some examples are now very cramped and I would like to add some blank lines, but don't know how.
skorch/callbacks/logging.py
Outdated
@@ -747,32 +756,30 @@ class SacredLogger(Callback): | |||
|
|||
To use this logger, you first have to install Sacred: | |||
|
|||
$ python -m pip install sacred | |||
``$ python -m pip install sacred`` |
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 this works for Sphinx?
``$ python -m pip install sacred`` | |
.. code-block:: | |
$ python -m pip install sacred |
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 used code blocks for the 2 shell commands in this docstring.
>>> import numpy as np | ||
>>> from sacred import Experiment | ||
>>> from sklearn.datasets import make_classification | ||
>>> from skorch.callbacks.logging import SacredLogger | ||
>>> from skorch.callbacks.scoring import EpochScoring | ||
>>> from skorch import NeuralNetClassifier | ||
>>> from skorch.toy import make_classifier | ||
|
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.
One way to split this up is to add a comment describing the code.
XREF: https://numpydoc.readthedocs.io/en/latest/format.html#examples
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, but I wanted to avoid that. My goal would be to just have a block of code with some blank lines:
from skorch import NeuralNetClassifier
from skorch.toy import make_classifier
ex = Experiment()
@ex.config
def my_config():
max_epochs = 20
lr = 0.01
X, y = make_classification()
Adding comments seems unnecessary to me in this case.
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.
Ah I see. I do not think there is a great way to do this.
>>> import numpy as np | ||
>>> from sacred import Experiment | ||
>>> from sklearn.datasets import make_classification | ||
>>> from skorch.callbacks.logging import SacredLogger | ||
>>> from skorch.callbacks.scoring import EpochScoring | ||
>>> from skorch import NeuralNetClassifier | ||
>>> from skorch.toy import make_classifier | ||
|
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.
Ah I see. I do not think there is a great way to do this.
I fixed a couple of minor issues I found in the docs
markers around them.
TensorBoard
docstringWandbLogger
SacredLogger
Additionally, I removed an outdated comment in
probabilistic.py
docstring.What I would like to know: Is it possible to have blank lines inside
example code blocks without starting a completely new block? Some
examples are now very cramped and I would like to add some blank lines,
but don't know how.
Also, it looks like in the official docs, the API docs for
probabilistic.py
are empty:https://skorch.readthedocs.io/en/latest/probabilistic.html
I cannot reproduce this error locally :(