-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpyproject.toml
146 lines (138 loc) · 6.44 KB
/
pyproject.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
[tool.setuptools.packages.find]
include = ["cneuromax"]
[project]
name = "cneuromax"
requires-python = ">=3.10" # Did not test with lower versions
authors = [{ name = "The SIMEXP Laboratory", email = "simexp.lab@gmail.com" }]
description = "The CNeuromod project's centralized Machine Learning repository"
version = "0.0.1"
# The following assumes that we build on top of the NGC PyTorch Docker image.
dependencies = [
# MANDATORY for cneuromax/
"hydra-core==1.3.2", # Configuration management
"hydra-zen==0.12.1", # Cleaner Hydra configs
"beartype==0.17.1", # Dynamic type checking
"wandb==0.16.3", # Logging
"""
submitit@git+https://github.com/courtois-neuromod/submitit@\
b289f81004ab063b185dc97982934c266e605fad""", # Local & SLURM job launcher
# CNeuroMod fork that launches the `tasks_per_node` with `mpi` rather
# than the original `submitit` method. Used for
# `cneuromax/fitting/neuroevolution/`.
"""
hydra-submitit-launcher@git+https://github.com/courtois-neuromod/hydra@\
9e227a095345b5ea3d914efa95b74b622e7d1fdf\
#subdirectory=plugins/hydra_submitit_launcher/""", # Launcher config
# CNeuroMod fork that implements the missing connecting feature to
# `submitit`'s `python` option. Also modifies the `local` launcher
# so that it queues the jobs sequentially rather than in parallel.
# OPTIONAL for cneuromax/
"hydra-orion-sweeper==1.6.4", # Hyperparameter optimization
"jaxtyping==0.2.25", # Torch tensor annotations
"nptyping==2.5.0", # Numpy array annotations
"einops==0.7.0", # Makes shape transformations more readable
"jupyterlab==4.1.0", # Jupyter notebook
"jupyterlab-code-formatter==2.2.1", # Jupyter code formatter
"ipywidgets==8.1.2", # Jupyter widgets
"wandb-osh==1.2.1", # W&B support for SLURM
"h5py==3.10.0", # HDF5 file format load/save
"opencv-python==4.8.0.74", # Image processing
# MANDATORY for cneuromax/fitting/deeplearning/
"lightning==2.2.0.post0",
# OPTIONAL for cneuromax/fitting/deeplearning/
"diffusers==0.26.2", # Diffusion models
"transformers==4.37.2", # HuggingFace models & utils
"datasets==2.17.0", # HuggingFace datasets
# MANDATORY for cneuromax/fitting/neuroevolution/
"mpi4py==3.1.5", # Inter-process communication
"torchrl==0.3.0", # For reinforcement/imitation Learning tasks
"""
gymnasium[mujoco]@git+https://github.com/Farama-Foundation/Gymnasium@\
6baf8708bfb08e37ce3027b529193169eaa230fd""", # RL/IL environments
# Bug fixes for Gymnasium
# MANDATORY for docs/
"sphinx==7.2.6", # Documentation generator
"esbonio==0.16.4", # Language server to render sphinx
"furo==2024.1.29", # Theme
"sphinx-copybutton==0.5.2", # Copy button for code blocks
"sphinx-paramlinks==0.6.0", # Links to parameters in other pages
"sphinx-autodoc-typehints==2.0.0", # More type hint customization
"myst-parser==2.0.0", # Embeds markdown in sphinx
# DEVELOPMENT
"black[jupyter]==24.2.0", # Python Formatter
"ruff==0.2.1", # Python Linter
"doc8==1.1.1", # Documentation linter
"yamllint==1.34.0", # YAML linter
"pre-commit==3.6.1", # Git commit hooks
"mypy==1.8.0", # Static type checker
"pytest==8.0.0", # Testing framework
"pytest-cov==4.1.0", # Test coverage
]
[tool.black]
line-length = 79
[tool.ruff]
line-length = 79
select = ["ALL"]
ignore = [
"D107", # `undocumented-public-init`
# Missing docstring in public `__init__`
# https://docs.astral.sh/ruff/rules/undocumented-public-init/
# Disabled as we combine the docstring of the class and the
# `__init__` method because 1) `__init__` docstrings are
# often redundant and 2) Our auto-documentation tool
# renders better when the full docstring is in the class.
"F722", # `forward-annotation-syntax-error`
# Syntax error in forward annotation: {body}.
# https://docs.astral.sh/ruff/rules/forward-annotation-syntax-error/
# Disabled to be able to utilize Jaxtyping, see:
# https://docs.kidger.site/jaxtyping/faq/#flake8-or-ruff-are-throwing-an-error
"G004", # `logging-f-string`
# Logging statement uses f-string.
# https://docs.astral.sh/ruff/rules/logging-f-string/
# Disabled to make it less verbose to log since printing is
# disabled, see: https://docs.astral.sh/ruff/rules/print/
"NPY002", # `numpy-legacy-random`
# Replace legacy np.random.{method_name} call with
# np.random.Generator
# Disabled for legacy purposes.
"S301", # `suspicious-pickle-usage`
# `pickle` and modules that wrap it can be unsafe when used to
# deserialize untrusted data, possible security issue
# https://docs.astral.sh/ruff/rules/suspicious-pickle-usage/
# Disabled due to current implementation of checkpointing
# in `cneuromax.fitting.neuroevolution`.
"TCH001", # `typing-only-first-party-import`
# Move application import {} into a type-checking block
# https://docs.astral.sh/ruff/rules/typing-only-first-party-import/
# Disabled as we use Beartype for dynamic type checking.
"TCH002", # `typing-only-third-party-import`
# Move third-party import {} into a type-checking block
# https://docs.astral.sh/ruff/rules/typing-only-third-party-import/
# Disabled as we use Beartype for dynamic type checking.
]
[tool.mypy]
strict = true
allow_redefinition = true
ignore_missing_imports = true
[tool.ruff.pycodestyle]
max-doc-length = 72
[tool.ruff.pydocstyle]
convention = "google"
[tool.ruff.per-file-ignores]
"*_test.py" = [
"S101", # `assert`
# Use of assert detected.
# https://docs.astral.sh/ruff/rules/assert/
# Disabled to be able to use assertions in test files.
"PLR2004", # `magic-value-comparison`
# Magic value used in comparison, consider replacing {value}
# with a constant variable.
# https://docs.astral.sh/ruff/rules/magic-value-comparison/
# Disabled to be able to use magic values in test files.
]
[tool.doc8]
max-line-length = 79
# docs/index.rst:1: D000 Error in "include" directive:
# invalid option value: (option: "parser"; value: 'myst_parser.sphinx_')
# Parser "myst_parser.sphinx_" not found. No module named 'myst_parser'.
ignore-path-errors = ["docs/index.rst;D000"]