Skip to content

Commit

Permalink
[MAINT] Support python 3.12 (aramis-lab#667)
Browse files Browse the repository at this point in the history
* support Python 3.12

* run unit tests on Python 3.12

* update dependencies to be compatible with 3.12

* bump torch

* use np.prod instead of np.product which was removed in Numpy 2
  • Loading branch information
NicolasGensollen authored and camillebrianceau committed Jan 2, 2025
1 parent a799f93 commit b8547bc
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,15 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
<<<<<<< HEAD
<<<<<<< HEAD
python-version: [ '3.9', '3.10', '3.11', '3.12']
=======
python-version: ['3.9', '3.10', '3.11']
>>>>>>> 78ccf96c ([MAINT] Drop python 3.8 (#663))
=======
python-version: ['3.9', '3.10', '3.11', '3.12']
>>>>>>> 3c40944b ([MAINT] Support python `3.12` (#667))
steps:
- uses: actions/checkout@v4
- uses: snok/install-poetry@v1
Expand Down
2 changes: 1 addition & 1 deletion clinicadl/networks/old_network/cnn/random.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ def fc_dict_design(n_fcblocks, convolutions, initial_shape, n_classes=2):
out_channels = last_conv["out_channels"]
flattened_shape = np.ceil(np.array(initial_shape) / 2**n_conv)
flattened_shape[0] = out_channels
in_features = np.product(flattened_shape)
in_features = np.prod(flattened_shape)

# Sample number of FC layers
ratio = (in_features / n_classes) ** (1 / n_fcblocks)
Expand Down
11 changes: 11 additions & 0 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,17 @@ classifiers = [

[tool.poetry.dependencies]
<<<<<<< HEAD
<<<<<<< HEAD
python = ">=3.9,<3.13"
torch = "^2.3.0"
=======
python = ">=3.9,<3.12"
torch = "^2.1.0"
>>>>>>> 78ccf96c ([MAINT] Drop python 3.8 (#663))
=======
python = ">=3.9,<3.13"
torch = "^2.3.0"
>>>>>>> 3c40944b ([MAINT] Support python `3.12` (#667))
torchvision = "*"
tensorboard = "*"
toml = "*"
Expand Down

0 comments on commit b8547bc

Please sign in to comment.