forked from dynamiqs/dynamiqs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
198 lines (170 loc) · 5.61 KB
/
Copy pathpyproject.toml
File metadata and controls
198 lines (170 loc) · 5.61 KB
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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
[project]
name = "dynamiqs"
description = "High-performance quantum systems simulation with JAX (GPU-accelerated & differentiable solvers)."
authors = [
{ name = "Pierre Guilmin", email = "pierreguilmin@gmail.com" },
{ name = "Ronan Gautier", email = "ron.gautier@gmail.com" },
{ name = "Adrien Bocquet", email = "adrienbocquet38@gmail.com" },
{ name = "Elie Genois", email = "elie.genois@usherbrooke.ca" },
{ name = "Daniel Weiss", email = "daniel.kamrath.weiss@gmail.com" },
]
dynamic = ["version"]
license = { file = "LICENSE" }
readme = "README_PYPI.md"
classifiers = [
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Topic :: Scientific/Engineering :: Physics",
]
requires-python = ">=3.11"
dependencies = [
"qutip>=4.7.5",
"scipy",
"numpy",
"matplotlib",
# jax>=0.4.36 for GPU eig support,
# jax!=0.7.0,!=0.7.1 because of diffrax compatibility issues, see https://github.com/patrick-kidger/diffrax/issues/680
"jax>=0.4.36,!=0.7.0,!=0.7.1",
"jaxtyping",
"diffrax>=0.6.1", # for complex support (0.5.0), progress meter (0.5.1), compatibility with jax 0.4.36 (0.6.1)
"equinox",
"optimistix", # for typing of root-finding in Event method
"pillow",
"cmap",
"ipython",
"tqdm",
"lineax",
]
[project.urls]
Homepage = "https://github.com/dynamiqs/dynamiqs"
Documentation = "https://www.dynamiqs.org/"
Repository = "https://github.com/dynamiqs/dynamiqs"
[build-system]
requires = ["flit_core >=3.2,<4"]
build-backend = "flit_core.buildapi"
[project.optional-dependencies]
dev = [
"taskipy>=1.14.1",
"ruff>=0.8",
"codespell",
"pytest>=8.0",
"pytest-ordering",
"pytest-sugar",
"pytest-xdist",
"mkdocs-material",
"mkdocstrings[python]!=1.12.0", # bug with parsing strings in signatures, see https://github.com/mkdocstrings/python/issues/191
"mkdocs-gen-files",
"mkdocs-literate-nav",
"mkdocs-section-index",
"mkdocs-simple-hooks",
"mkdocs-glightbox",
"mkdocs-exclude",
"sybil>=6",
"black", # needed by mkdocstrings to format function signatures
"flit",
"mike",
"optax", # for gradient descent tutorials
"ty",
]
[tool.ruff]
extend-include = ["*.ipynb"]
[tool.ruff.format]
quote-style = "single"
docstring-code-format = true
skip-magic-trailing-comma = true
[tool.ruff.lint]
select = [
"F", "E", "W", "C90", "I", "D", "UP", "YTT", "ANN", "BLE", "B", "A", "C4", "FA",
"INP", "NPY201", "PIE", "T20", "PYI", "PT", "RSE", "RET", "SLF", "SIM", "INT",
"ARG", "PTH", "PL", "TRY", "FLY", "NPY", "RUF",
]
extend-select = ["D204", "D400", "D404", "D406", "D410"]
ignore = [
"F403", "F405",
"E203", "E731", "E741",
"D100", "D101", "D102", "D103", "D104", "D105", "D106", "D107", "D205", "D405", "D417",
"ANN002", "ANN003", "ANN401",
"ARG001",
"RET505", "RUF022",
"TRY003",
"PLR0913", "PLR2004",
"PT028",
"SLF001",
]
[tool.ruff.lint.isort]
split-on-trailing-comma = false
[tool.ruff.lint.flake8-annotations]
suppress-none-returning = true
[tool.ruff.lint.flake8-comprehensions]
allow-dict-calls-with-keyword-arguments = true
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401"]
"docs/**.py" = ["INP001", "ARG001", "ANN"]
"conftest.py" = ["ANN"]
"tests/**.py" = ["ANN"]
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.codespell]
skip = ".git,*.ipynb"
ignore-words-list = "ket, braket, SME"
[tool.ty.src]
exclude = [
"dynamiqs/integrators",
"dynamiqs/plot",
"dynamiqs/qarrays",
"dynamiqs/random",
"dynamiqs/utils",
"dynamiqs/time_qarray.py",
"dynamiqs/conftest.py"
]
[tool.ty.rules]
division-by-zero = "error"
possibly-unresolved-reference = "error"
unused-ignore-comment = "error"
# === taskipy tasks definition ===
[tool.taskipy.tasks.lint]
cmd = 'echo "\n>>> ruff check --fix" && ruff check --fix'
help = "lint the code (ruff)"
[tool.taskipy.tasks.format]
cmd = 'echo "\n>>> ruff format" && ruff format'
help = "auto-format the code (ruff)"
[tool.taskipy.tasks.codespell]
cmd = 'echo "\n>>> codespell" && codespell tests dynamiqs'
help = "check for misspellings (codespell)"
[tool.taskipy.tasks.type]
cmd = 'echo "\n>>> ty check dynamiqs" && ty check dynamiqs'
help = "check types (ty)"
[tool.taskipy.tasks.clean]
cmd = 'task lint && task format && task codespell && task type'
help = "clean the code (ruff + codespell + ty)"
[tool.taskipy.tasks.test]
cmd = 'echo "\n>>> pytest -n=auto tests" && pytest -n=auto tests'
help = "run the unit tests suite (pytest)"
[tool.taskipy.tasks.doctest-code]
cmd = 'echo "\n>>> pytest dynamiqs" && python docs/remove_figs.py docs/figs_code && pytest dynamiqs'
help = "check code docstrings examples (doctest)"
[tool.taskipy.tasks.doctest-docs]
cmd = 'echo "\n>>> pytest docs" && python docs/remove_figs.py docs/figs_docs && pytest docs'
help = "check documentation examples (doctest)"
[tool.taskipy.tasks.doctest]
cmd = 'task doctest-code && task doctest-docs'
help = "check all examples (doctest)"
[tool.taskipy.tasks.docbuild]
cmd = 'mkdocs build'
help = "build the documentation website"
[tool.taskipy.tasks.docserve]
cmd = 'mkdocs serve'
help = "preview documentation website with hot-reloading"
[tool.taskipy.tasks.all]
cmd = 'task clean && task test && task doctest'
help = "run all tasks before a commit (ruff + codespell + ty + pytest + doctest)"
[tool.taskipy.tasks.ci]
cmd = '''echo "\n>>> ruff check" && ruff check &&
echo "\n>>> ruff format --check" && ruff format --check &&
task codespell &&
task type &&
task test &&
task doctest &&
task docbuild'''
help = "run all the CI checks"