From ea27361ad1d8a1d9a299724a8d7f237b42f2830d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Val=C3=A9rian=20Rey?= Date: Tue, 10 Feb 2026 14:04:42 +0100 Subject: [PATCH] docs: Fix installation suggestion for options --- CHANGELOG.md | 6 +++--- docs/source/installation.md | 6 +++--- src/torchjd/aggregation/_cagrad.py | 2 +- src/torchjd/aggregation/_nash_mtl.py | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 66b4418b..1a4c6d1f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -106,9 +106,9 @@ changelog does not include internal changes that do not affect the user. ### Changed - **BREAKING**: Changed the dependencies of `CAGrad` and `NashMTL` to be optional when installing - TorchJD. Users of these aggregators will have to use `pip install torchjd[cagrad]`, `pip install - torchjd[nash_mtl]` or `pip install torchjd[full]` to install TorchJD alongside those dependencies. - This should make TorchJD more lightweight. + TorchJD. Users of these aggregators will have to use `pip install "torchjd[cagrad]"`, `pip install + "torchjd[nash_mtl]"` or `pip install "torchjd[full]"` to install TorchJD alongside those + dependencies. This should make TorchJD more lightweight. - **BREAKING**: Made the aggregator modules and the `autojac` package protected. The aggregators must now always be imported via their package (e.g. `from torchjd.aggregation.upgrad import UPGrad` must be changed to diff --git a/docs/source/installation.md b/docs/source/installation.md index 8647738c..423e5181 100644 --- a/docs/source/installation.md +++ b/docs/source/installation.md @@ -10,13 +10,13 @@ Note that `torchjd` requires Python 3.10, 3.11, 3.12, 3.13 or 3.14 and `torch>=2 Some aggregators (CAGrad and Nash-MTL) have additional dependencies that are not included by default when installing `torchjd`. To install them, you can use: ``` -pip install torchjd[cagrad] +pip install "torchjd[cagrad]" ``` ``` -pip install torchjd[nash_mtl] +pip install "torchjd[nash_mtl]" ``` To install `torchjd` with all of its optional dependencies, you can also use: ``` -pip install torchjd[full] +pip install "torchjd[full]" ``` diff --git a/src/torchjd/aggregation/_cagrad.py b/src/torchjd/aggregation/_cagrad.py index 67f94a94..d29ca7b3 100644 --- a/src/torchjd/aggregation/_cagrad.py +++ b/src/torchjd/aggregation/_cagrad.py @@ -31,7 +31,7 @@ class CAGrad(GramianWeightedAggregator): This aggregator is not installed by default. When not installed, trying to import it should result in the following error: ``ImportError: cannot import name 'CAGrad' from 'torchjd.aggregation'``. - To install it, use ``pip install torchjd[cagrad]``. + To install it, use ``pip install "torchjd[cagrad]"``. """ def __init__(self, c: float, norm_eps: float = 0.0001): diff --git a/src/torchjd/aggregation/_nash_mtl.py b/src/torchjd/aggregation/_nash_mtl.py index 76862975..7485a358 100644 --- a/src/torchjd/aggregation/_nash_mtl.py +++ b/src/torchjd/aggregation/_nash_mtl.py @@ -59,7 +59,7 @@ class NashMTL(WeightedAggregator): This aggregator is not installed by default. When not installed, trying to import it should result in the following error: ``ImportError: cannot import name 'NashMTL' from 'torchjd.aggregation'``. - To install it, use ``pip install torchjd[nash_mtl]``. + To install it, use ``pip install "torchjd[nash_mtl]"``. .. warning:: This implementation was adapted from the `official implementation