Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ repos:
- id: flake8 # Check style and syntax. Does not modify code, issues have to be solved manually.
args: [
'--ignore=E501,E203,W503,E402', # Ignore line length problems, space after colon problems, line break occurring before a binary operator problems, module level import not at top of file problems.
'--per-file-ignores=*/__init__.py:F401', # Ignore module imported but unused problems in __init__.py files.
]

- repo: https://github.com/pycqa/isort
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ changes that do not affect the user.

## [Unreleased]

### Added

- Added `__all__` in the `__init__.py` of packages. This should prevent PyLance from triggering warnings when importing from `torchjd`.

## [0.8.0] - 2025-11-13

### Added
Expand Down
3 changes: 1 addition & 2 deletions docs/source/docs/autogram/index.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
autogram
========


.. automodule:: torchjd.autogram
:members:
:no-members:

.. toctree::
:hidden:
Expand Down
3 changes: 1 addition & 2 deletions docs/source/docs/autojac/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ autojac
=======

.. automodule:: torchjd.autojac
:members:

:no-members:

.. toctree::
:hidden:
Expand Down
36 changes: 36 additions & 0 deletions src/torchjd/aggregation/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,48 @@
)
from ._weighting_bases import GeneralizedWeighting, Weighting

__all__ = [
"Aggregator",
"AlignedMTL",
"AlignedMTLWeighting",
"ConFIG",
"Constant",
"ConstantWeighting",
"DualProj",
"DualProjWeighting",
"Flattening",
"GeneralizedWeighting",
"GradDrop",
"IMTLG",
"IMTLGWeighting",
"Krum",
"KrumWeighting",
"Mean",
"MeanWeighting",
"MGDA",
"MGDAWeighting",
"PCGrad",
"PCGradWeighting",
"Random",
"RandomWeighting",
"Sum",
"SumWeighting",
"TrimmedMean",
"UPGrad",
"UPGradWeighting",
"Weighting",
]

try:
from ._cagrad import CAGrad, CAGradWeighting

__all__ += ["CAGrad", "CAGradWeighting"]
except _OptionalDepsNotInstalledError: # The required dependencies are not installed
pass

try:
from ._nash_mtl import NashMTL

__all__ += ["NashMTL"]
except _OptionalDepsNotInstalledError: # The required dependencies are not installed
pass
2 changes: 2 additions & 0 deletions src/torchjd/autogram/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,5 @@
"""

from ._engine import Engine

__all__ = ["Engine"]
2 changes: 2 additions & 0 deletions src/torchjd/autojac/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@

from ._backward import backward
from ._mtl_backward import mtl_backward

__all__ = ["backward", "mtl_backward"]
16 changes: 16 additions & 0 deletions src/torchjd/autojac/_transform/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,19 @@
from ._ordered_set import OrderedSet
from ._select import Select
from ._stack import Stack

__all__ = [
"Accumulate",
"Aggregate",
"Composition",
"Conjunction",
"Diagonalize",
"Grad",
"Init",
"Jac",
"OrderedSet",
"RequirementError",
"Select",
"Stack",
"Transform",
]
Loading