Skip to content

Commit 531e0f7

Browse files
committed
Modified many files to improve package conception: citation, requirement files, setup, readme.
1 parent 37bd591 commit 531e0f7

File tree

6 files changed

+260
-39
lines changed

6 files changed

+260
-39
lines changed

.gitignore

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1-
torch_som/__pycache__
21
# data/
3-
# notebooks/results/
2+
# notebooks/results/
3+
4+
.venv/
5+
*.egg-info/
6+
torchsom/__pycache__/

CITATION.cff

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ keywords:
1313
- "Clustering"
1414
- "Data Visualization"
1515

16-
repository: "https://github.com/LouisTier/TorchSOM" # More general than the one below, can include both
17-
# repository-code: "https://github.com/LouisTier/TorchSOM" # Better suited for source code
16+
repository: "https://github.com/LouisTier/TorchSOM"
1817
license:
1918
type: "Apache-2.0"
2019
url: "https://opensource.org/licenses/Apache-2.0"
@@ -38,17 +37,16 @@ references:
3837
given-names: "Louis"
3938
version: "1.0.0"
4039
date-released: "2025-05-20"
41-
# url: "https://github.com/LouisTier/TorchSOM"
42-
# repository-code: "https://github.com/LouisTier/TorchSOM"
43-
# license: "Apache-2.0"
40+
url: "https://github.com/LouisTier/TorchSOM"
41+
license: "Apache-2.0"
4442

45-
preferred-citation:
46-
type: inproceedings
47-
title: "TorchSOM: A Scalable PyTorch-Compatible Library for Self-Organizing Maps"
48-
authors:
49-
- family-names: "Berthier"
50-
given-names: "Louis"
51-
# booktitle: "Proceedings of the XXth CONFERENCE NAME"
52-
# year: "2025"
53-
# url: "https://arxiv.org/abs/XXXXX" # If available
54-
# doi: "10.XXXX/XXXXX" # If available
43+
# preferred-citation:
44+
# type: inproceedings
45+
# title: "TorchSOM: A Scalable PyTorch-Compatible Library for Self-Organizing Maps"
46+
# authors:
47+
# - family-names: "Berthier"
48+
# given-names: "Louis"
49+
# booktitle: "Proceedings of the XXth CONFERENCE NAME"
50+
# year: "2025"
51+
# url: "https://arxiv.org/abs/XXXXX" # If available
52+
# doi: "10.XXXX/XXXXX" # If available

README.md

Lines changed: 29 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ It provides an efficient and scalable implementation of **Self-Organizing Maps (
2222
- [Installation](#installation)
2323
<!-- - [Using pip](#using-pip)
2424
- [Manually](#manually) -->
25-
- [Dependencies](#dependencies)
25+
<!-- - [Dependencies](#dependencies) -->
2626
<!-- - [Documentation](#documentation) -->
2727
- [Citation](#citation)
2828
- [Acknowledgement](#acknowledgement)
@@ -38,41 +38,49 @@ It provides an efficient and scalable implementation of **Self-Organizing Maps (
3838

3939
Also, this **repository is highly documented and commented**, which makes it easy to use, understand, deploy, and which offers endless possibilities for improvements.
4040
To help you explore and experiment with **TorchSOM**, we provide Jupyter notebooks in the [`notebooks/`](notebooks) directory. There are multiples datasets and the corresponding results respectively in the [`data/`](data) and [`notebooks/results/`](notebooks/results) directories.
41-
<!-- First, execute [`get_data.ipynb`](notebooks/get_data.ipynb) to retrieve the datasets in a `data/` folder. Then you'll be able to run different TorchSOM examples: -->
4241
- [`iris.ipynb`](notebooks/iris.ipynb): A multiclass classification example.
4342
- [`wine.ipynb`](notebooks/wine.ipynb): Another multiclass classification example.
4443
- [`boston_housing.ipynb`](notebooks/boston_housing.ipynb): A regression example.
4544
- [`energy_efficiency.ipynb`](notebooks/energy_efficiency.ipynb): A multi-regression example.
45+
- [`get_data.ipynb`](notebooks/get_data.ipynb): The notebook used to generated the datasets provided in the [`data/`](data) directory.
4646

4747
If you find this project interesting, we would be grateful for your support by starring ⭐ this [`GitHub repository`](https://github.com/LouisTier/TorchSOM).
4848

4949

5050

5151
## Installation
5252

53-
You can install the package using pip following this command:
53+
You can install the package using pip following this command (not available yet):
5454

5555
```bash
56-
pip install torchsom
56+
pip install torchsom # Requires the dependencies from the requirements.txt file
5757
```
5858

59-
If you want to use the latest version, or if you prefer the command line interface, you can use it locally by cloning or forking this repository to your local machine.
59+
If you want to use the latest version, or if you prefer the command line interface, you can use it locally by cloning or forking this repository to your local machine. TorchSOM requires a recent version of Python, preferably **3.11 or higher**.
6060

6161
```bash
62-
git clone https://github.com/LouisTier/TorchSOM.git
62+
git clone https://github.com/LouisTier/TorchSOM.git # Retrieve the GitHub repository
6363
```
6464

65+
If you want to develop the package and run the notebooks after cloning the repository, make sure you have the required dependencies installed before using it:
6566

67+
```bash
68+
python3.11 -m venv .torchsom_env # Create a virtual environment
69+
source .torchsom_env/bin/activate # Activate the environment
70+
pip install -r dev-requirements.txt # Install the required dependencies
71+
pip install -e . # Install the torchsom package
72+
```
6673

67-
## Dependencies
68-
69-
TorchSOM requires a recent version of Python, preferably **3.10 or higher**. Also, make sure you have the required dependencies installed before using it.
70-
You can these dependencies by running the command:
74+
You can also run:
7175

7276
```bash
73-
pip install -r requirements.txt
77+
pip install . # Install the required dependencies from setup.py
78+
pip install .[dev] # Install the required dependencies from setup.py and "extras_require"
7479
```
7580

81+
[`requirements.txt`](requirements.txt) stands for the dependencies that are required when importing `torchsom`.
82+
[`dev-requirements.txt`](dev-requirements.txt) stands for the dependencies that are required when cloning the GitHub repository and developing the `torchsom` package or running `notebooks`.
83+
7684

7785

7886
<!-- ## Documentation
@@ -88,21 +96,21 @@ If you use TorchSOM in your research or work, please consider citing it using th
8896
1. **Paper**
8997
```bibtex
9098
@inproceedings{Berthier2025TorchSOM_paper,
91-
title = {TorchSOM: A Scalable PyTorch-Compatible Library for Self-Organizing Maps},
92-
author = {Berthier, Louis},
93-
year = {2025},
99+
title = {TorchSOM: A Scalable PyTorch-Compatible Library for Self-Organizing Maps},
100+
author = {Berthier, Louis},
101+
year = {2025},
94102
}
95103
```
96104
97105
2. **Software**
98106
```bibtex
99107
@software{Berthier2025TorchSOM_software,
100-
author = {Louis Berthier},
101-
title = {TorchSOM: A Scalable PyTorch-Compatible Library for Self-Organizing Maps},
102-
version = {1.0.0},
103-
year = {2025},
104-
url = {https://github.com/LouisTier/TorchSOM},
105-
license = {Apache-2.0},
108+
author = {Louis Berthier},
109+
title = {TorchSOM: A Scalable PyTorch-Compatible Library for Self-Organizing Maps},
110+
version = {1.0.0},
111+
year = {2025},
112+
url = {https://github.com/LouisTier/TorchSOM},
113+
license = {Apache-2.0},
106114
}
107115
```
108116
@@ -130,7 +138,7 @@ Please take a moment to read our [`Code of Conduct`](CODE_OF_CONDUCT.md) if you'
130138
131139
## License
132140
133-
TorchSOM is licensed under the [Apache License, Version 2.0](https://opensource.org/license/apache-2-0). Feel free to use and modify the code as per the terms of the [`LICENSE`](LICENSE) file.
141+
TorchSOM is licensed under the [Apache License, Version 2.0](https://opensource.org/license/apache-2-0). Feel free to use and modify the code as per the terms of the [`LICENSE`](LICENSE).
134142
135143
136144

dev-requirements.txt

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
asttokens==3.0.0
2+
comm==0.2.2
3+
contourpy==1.3.1
4+
cycler==0.12.1
5+
debugpy==1.8.13
6+
decorator==5.2.1
7+
et_xmlfile==2.0.0
8+
executing==2.2.0
9+
filelock==3.13.1
10+
fonttools==4.57.0
11+
fsspec==2024.6.1
12+
ipykernel==6.29.5
13+
ipython==9.1.0
14+
ipython_pygments_lexers==1.1.1
15+
jedi==0.19.2
16+
Jinja2==3.1.4
17+
joblib==1.4.2
18+
jupyter_client==8.6.3
19+
jupyter_core==5.7.2
20+
kiwisolver==1.4.8
21+
MarkupSafe==2.1.5
22+
matplotlib==3.10.1
23+
matplotlib-inline==0.1.7
24+
mpmath==1.3.0
25+
nest-asyncio==1.6.0
26+
networkx==3.3
27+
numpy==2.2.4
28+
nvidia-cublas-cu11==11.11.3.6
29+
nvidia-cuda-cupti-cu11==11.8.87
30+
nvidia-cuda-nvrtc-cu11==11.8.89
31+
nvidia-cuda-runtime-cu11==11.8.89
32+
nvidia-cudnn-cu11==9.1.0.70
33+
nvidia-cufft-cu11==10.9.0.58
34+
nvidia-curand-cu11==10.3.0.86
35+
nvidia-cusolver-cu11==11.4.1.48
36+
nvidia-cusparse-cu11==11.7.5.86
37+
nvidia-nccl-cu11==2.21.5
38+
nvidia-nvtx-cu11==11.8.86
39+
openpyxl==3.1.5
40+
packaging==24.2
41+
pandas==2.2.3
42+
parso==0.8.4
43+
pexpect==4.9.0
44+
pillow==11.1.0
45+
platformdirs==4.3.7
46+
prompt_toolkit==3.0.50
47+
psutil==7.0.0
48+
ptyprocess==0.7.0
49+
pure_eval==0.2.3
50+
Pygments==2.19.1
51+
pyparsing==3.2.3
52+
python-dateutil==2.9.0.post0
53+
pytz==2025.2
54+
pyzmq==26.4.0
55+
scikit-learn==1.6.1
56+
scipy==1.15.2
57+
six==1.17.0
58+
stack-data==0.6.3
59+
sympy==1.13.1
60+
threadpoolctl==3.6.0
61+
tornado==6.4.2
62+
tqdm==4.67.1
63+
traitlets==5.14.3
64+
triton==3.2.0
65+
typing_extensions==4.13.1
66+
tzdata==2025.2
67+
wcwidth==0.2.13
68+
69+
# # Issues with artifactories for the '+cu118'
70+
# torch==2.6.0+cu118 -f https://download.pytorch.org/whl/cu118
71+
# torchaudio==2.6.0+cu118 -f https://download.pytorch.org/whl/cu118
72+
# torchvision==0.21.0+cu118
73+
torch==2.6.0
74+
-f https://download.pytorch.org/whl/cu118 # For CUDA 11.8 support
75+
76+
# # Issues with commands below, I need to run 'pip install -e .' instead
77+
# -e git+https://github.com/LouisTier/TorchSOM.git@ae8ae25e74e6631acc25c1b0a04f88771ab82f81#egg=torchsom&subdirectory=../../../../lib_bib_sensing/bib_sensing/TorchSOM
78+
# -e git+https://github.com/LouisTier/TorchSOM.git@main#egg=torchsom
79+
# -e git+https://github.com/LouisTier/TorchSOM.git@main#egg=torchsom&subdirectory=TorchSOM,
80+
# -e git+https://github.com/LouisTier/TorchSOM.git@ae8ae25e74e6631acc25c1b0a04f88771ab82f81#egg=torchsom&subdirectory=TorchSOM
81+
# -e .

requirements.txt

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,38 @@
1-
# TO UPDATE WHEN OPEN-SOURCING THE LIBRARY
1+
contourpy==1.3.1
2+
cycler==0.12.1
3+
filelock==3.13.1
4+
fonttools==4.57.0
5+
fsspec==2024.6.1
6+
Jinja2==3.1.4
7+
kiwisolver==1.4.8
8+
MarkupSafe==2.1.5
9+
matplotlib==3.10.1
10+
mpmath==1.3.0
11+
networkx==3.3
12+
numpy==2.1.2
13+
nvidia-cublas-cu11==11.11.3.6
14+
nvidia-cuda-cupti-cu11==11.8.87
15+
nvidia-cuda-nvrtc-cu11==11.8.89
16+
nvidia-cuda-runtime-cu11==11.8.89
17+
nvidia-cudnn-cu11==9.1.0.70
18+
nvidia-cufft-cu11==10.9.0.58
19+
nvidia-curand-cu11==10.3.0.86
20+
nvidia-cusolver-cu11==11.4.1.48
21+
nvidia-cusparse-cu11==11.7.5.86
22+
nvidia-nccl-cu11==2.21.5
23+
nvidia-nvtx-cu11==11.8.86
24+
packaging==24.2
25+
pillow==11.0.0
26+
pyparsing==3.2.3
27+
python-dateutil==2.9.0.post0
28+
six==1.17.0
29+
sympy==1.13.1
30+
tqdm==4.67.1
31+
triton==3.2.0
32+
typing_extensions==4.12.2
33+
34+
torch==2.6.0
35+
-f https://download.pytorch.org/whl/cu118
36+
# torch==2.6.0+cu118
37+
# torchaudio==2.6.0+cu118
38+
# torchvision==0.21.0+cu118

setup.py

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
from setuptools import find_packages, setup
2+
3+
setup(
4+
name="torchsom",
5+
version="0.1.0",
6+
author="Louis Berthier",
7+
description="A Scalable PyTorch-Compatible Library for Self-Organizing Maps",
8+
packages=find_packages(),
9+
install_requires=[
10+
"contourpy==1.3.1",
11+
"cycler==0.12.1",
12+
"filelock==3.13.1",
13+
"fonttools==4.57.0",
14+
"fsspec==2024.6.1",
15+
"Jinja2==3.1.4",
16+
"kiwisolver==1.4.8",
17+
"MarkupSafe==2.1.5",
18+
"matplotlib==3.10.1",
19+
"mpmath==1.3.0",
20+
"networkx==3.3",
21+
"numpy==2.1.2",
22+
"nvidia-cublas-cu11==11.11.3.6",
23+
"nvidia-cuda-cupti-cu11==11.8.87",
24+
"nvidia-cuda-nvrtc-cu11==11.8.89",
25+
"nvidia-cuda-runtime-cu11==11.8.89",
26+
"nvidia-cudnn-cu11==9.1.0.70",
27+
"nvidia-cufft-cu11==10.9.0.58",
28+
"nvidia-curand-cu11==10.3.0.86",
29+
"nvidia-cusolver-cu11==11.4.1.48",
30+
"nvidia-cusparse-cu11==11.7.5.86",
31+
"nvidia-nccl-cu11==2.21.5",
32+
"nvidia-nvtx-cu11==11.8.86",
33+
"packaging==24.2",
34+
"pillow==11.0.0",
35+
"pyparsing==3.2.3",
36+
"python-dateutil==2.9.0.post0",
37+
"six==1.17.0",
38+
"sympy==1.13.1",
39+
"torch==2.6.0",
40+
# "torch==2.6.0+cu118",
41+
# "torchaudio==2.6.0+cu118",
42+
# "torchvision==0.21.0+cu118",
43+
"tqdm==4.67.1",
44+
"triton==3.2.0",
45+
"typing_extensions==4.12.2",
46+
],
47+
# To pip install torchsom[dev]
48+
extras_require={
49+
"dev": [
50+
"asttokens==3.0.0",
51+
"comm==0.2.2",
52+
"debugpy==1.8.13",
53+
"decorator==5.2.1",
54+
"et_xmlfile==2.0.0",
55+
"executing==2.2.0",
56+
"fsspec==2024.6.1",
57+
"ipykernel==6.29.5",
58+
"ipython==9.1.0",
59+
"ipython_pygments_lexers==1.1.1",
60+
"jedi==0.19.2",
61+
"joblib==1.4.2",
62+
"jupyter_client==8.6.3",
63+
"jupyter_core==5.7.2",
64+
"matplotlib-inline==0.1.7",
65+
"nest-asyncio==1.6.0",
66+
"numpy==2.2.4",
67+
"pandas==2.2.3",
68+
"parso==0.8.4",
69+
"pexpect==4.9.0",
70+
"pillow==11.1.0",
71+
"platformdirs==4.3.7",
72+
"prompt_toolkit==3.0.50",
73+
"psutil==7.0.0",
74+
"ptyprocess==0.7.0",
75+
"pure_eval==0.2.3",
76+
"Pygments==2.19.1",
77+
"pytz==2025.2",
78+
"pyzmq==26.4.0",
79+
"scikit-learn==1.6.1",
80+
"scipy==1.15.2",
81+
"stack-data==0.6.3",
82+
"threadpoolctl==3.6.0",
83+
"tornado==6.4.2",
84+
"traitlets==5.14.3",
85+
"tzdata==2025.2",
86+
"wcwidth==0.2.13",
87+
# Link to the dev version of TorchSOM if needed
88+
# "-e git+https://github.com/LouisTier/TorchSOM.git@ae8ae25e74e6631acc25c1b0a04f88771ab82f81#egg=torchsom&subdirectory=../../../../lib_bib_sensing/bib_sensing/TorchSOM"
89+
# "-e git+https://github.com/LouisTier/TorchSOM.git@main#egg=torchsom",
90+
# "-e git+https://github.com/LouisTier/TorchSOM.git@main#egg=torchsom&subdirectory=TorchSOM",
91+
]
92+
},
93+
python_requires=">=3.11",
94+
)

0 commit comments

Comments
 (0)