docs: fix CometLogger log_model docstring example#21759
Conversation
|
Marked ready for review. This is a one-line docstring fix matching the corrected call signature in the issue body — no behavior change, ruff check and ruff format both pass locally. Happy to adjust if maintainers prefer a fuller rewrite of the surrounding |
|
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## master #21759 +/- ##
=========================================
- Coverage 87% 79% -8%
=========================================
Files 270 267 -3
Lines 24010 23951 -59
=========================================
- Hits 20790 18830 -1960
- Misses 3220 5121 +1901 |
798ade7 to
efa33ef
Compare
|
Rebased onto the latest |
The example for `log_model` in the CometLogger class docstring was
syntactically invalid Python (positional argument after keyword) and
omitted the `file_or_folder=` keyword that the Comet SDK requires.
Update the rst code-block to use the documented call signature:
logger.experiment.log_model(name="my-model", file_or_folder="<path to your model>")
Fixes Lightning-AI#20583
efa33ef to
aedba1b
Compare
What does this PR do?
Fixes the broken docstring example for
log_modelin theCometLoggerclass (
src/lightning/pytorch/loggers/comet.py). The current example issyntactically invalid Python — it places a positional argument after a
keyword argument, and it omits the
file_or_folder=keyword that theComet SDK requires.
Before:
After:
This matches the call signature documented at
https://www.comet.com/docs/v2/api-and-sdk/python-sdk/reference/Experiment/#experimentlog_model
and the worked example in issue #20583.
Fixes #20583
Before submitting
ruff checkandruff format --checkpass; AST parses cleanly.PR review
Anyone in the community is welcome to review the PR.