-
Notifications
You must be signed in to change notification settings - Fork 87
/
pyproject.toml
345 lines (318 loc) · 13.5 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
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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
# Copyright 2023 TerraPower, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#######################################################################
# GENERAL PYTHON CONFIG #
#######################################################################
[build-system]
requires = ["setuptools>=61.2"]
build-backend = "setuptools.build_meta"
[project]
name = "armi"
version = "0.4.0"
description = "An open-source nuclear reactor analysis automation framework that helps design teams increase efficiency and quality."
license = {file = "LICENSE.md"}
requires-python = ">3.8"
readme = "README.rst"
authors = [
{ name="TerraPower, LLC", email="armi-devs@terrapower.com" },
]
dependencies = [
"coverage>=7.2.0", # Code coverage tool. Sadly baked into every Case.
"h5py>=3.9 ; python_version >= '3.11.0'", # Needed because our database files are H5 format
"h5py>=3.0,<=3.9 ; python_version < '3.11.0'",
"htmltree>=0.7.6", # Our reports have HTML output
"matplotlib>=3.5.3,<3.8.0", # Important plotting library
"numpy>=1.21", # Important math library
"ordered-set>=3.1.1", # A useful data structure
"pluggy>=1.2.0", # Central tool behind the ARMI Plugin system
"pyDOE>=0.3.8", # We import a Latin-hypercube algorithm to explore a phase space
"pyevtk>=1.2.0", # Handles binary VTK visualization files
"ruamel.yaml.clib ; python_version >= '3.11.0'", # C-based core of ruamel below
"ruamel.yaml ; python_version >= '3.11.0'", # Our foundational YAML library
"ruamel.yaml.clib<=0.2.7 ; python_version < '3.11.0'", # C-based core of ruamel below
"ruamel.yaml<=0.17.21 ; python_version < '3.11.0'", # Our foundational YAML library
"scipy>=1.7.0", # Used for curve-fitting and matrix math
"tabulate>=0.8.9", # Used to pretty-print tabular data
"toml>0.9.5", # Needed to parse the pyproject.toml file
"voluptuous>=0.12.1", # Used to validate YAML data files
"yamlize==0.7.1", # Custom YAML-to-object library
]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Scientific/Engineering :: Information Analysis",
]
[project.urls]
Homepage = "https://terrapower.github.io/armi/"
Documentation = "https://terrapower.github.io/armi"
Changelog = "https://github.com/terrapower/armi/releases"
Repository = "https://github.com/terrapower/armi"
"Bug Tracker" = "https://github.com/terrapower/armi/issues"
[project.optional-dependencies]
grids = ["wxpython==4.2.1"]
memprof = ["psutil"]
mpi = ["mpi4py"]
test = [
"black==22.6.0", # Code formatter (version-pinned)
"ipykernel>=6.0.0", # IPython Kernel (We run test notebooks from the doc tutorials.)
"jupyter_client>=7.0.0", # Reference implementation of the Jupyter protocol
"nbconvert>=7.0.0", # Converting Jupyter Notebooks to other formats
"pytest>=7.0.0", # Our primary test tooling
"pytest-cov>=4.0.0", # coverage plugin
"pytest-xdist>=3.0.0", # To spread our tests over multiple CPUs
"ruff==0.5.1", # Linting and code formatting (version-pinned)
]
docs = [
#######################################################################
# These are most specified that usual, because Sphinx docs seem to be
# quite fragile limited <7 by sphinx-rtd-theme at the moment.
#
# sphinx-rtd-theme requires docutils <0.19 but sphinx dropped support
# for 0.18 in 6.0.0 so we're stuck at these versions.
#
# We are only building our docs with Python 3.9.
#######################################################################
"Sphinx==5.3.0", # central library used to build our docs
"docutils==0.18.1", # Needed by sphinx-rtd-them
"sphinx-rtd-theme==1.2.2", # Read-The-Docs theme for Sphinx
"nbsphinx==0.9.2", # Parses Jupyter notebooks
"nbsphinx-link==1.3.0", # Adds Jupyter NBs to Sphinx source root
"sphinx-gallery==0.13.0", # Builds an HTML version of a Python script and puts it into a gallery
"sphinxcontrib-apidoc==0.3.0", # More easily document our API
"sphinxext-opengraph==0.8.2", # Generates OpenGraph metadata to make good-looking cards on social media
"sphinx-needs==1.2.2", # Requirements traceability matrices for QA
"sphinxcontrib-plantuml==0.25", # UML support in sphinx-needs
"pandoc", # Must be in the path (to convert file formats)
"ipykernel==6.25.1", # iPython kernel to run Jupyter notebooks
"pylint==2.17.5", # Generates UML diagrams
"Jinja2==3.0.3", # Used in numpydoc and nbconvert
"sphinxcontrib-jquery==4.1", # Handle missing jquery errors
"jupyter-contrib-nbextensions", # A collections of JS extensions for jupyter notebooks
"lxml<5.0.0", # Needed because the dep above is no longer an active project
]
[project.scripts]
armi = "armi.__main__:main"
[tool.setuptools.packages]
find = {}
#######################################################################
# RUFF CONFIG #
#######################################################################
[tool.ruff]
# This is the exact version of Ruff we use.
required-version = "0.5.1"
# Assume Python 3.9
target-version = "py39"
# Setting line-length to 120 (though blacks default is 88)
line-length = 120
# Exclude a variety of commonly ignored directories.
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".git-rewrite",
".hg",
".mypy_cache",
".nox",
".pants.d",
".pytype",
".ruff_cache",
".svn",
".tox",
".venv",
"__pycache__",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"doc/tutorials/armi-example-app",
"node_modules",
"venv",
]
[tool.ruff.lint]
# Enable pycodestyle (E) and Pyflakes (F) codes by default.
# D - NumPy docstring rules
# N801 - Class name should use CapWords convention
# SIM - code simplification rules
# TID - tidy imports
# TODO: We want to support PLW0603 - don't use the global keyword
select = ["E", "F", "D", "N801", "SIM", "TID"]
# Ruff rules we ignore (for now) because they are not 100% automatable
#
# D100 - Missing docstring in public module
# D101 - Missing docstring in public class
# D102 - Missing docstring in public method
# D103 - Missing docstring in public function
# D106 - Missing docstring in public nested class
# D401 - First line of docstring should be in imperative mood
# D404 - First word of the docstring should not be "This"
# SIM102 - Use a single if statement instead of nested if statements
# SIM105 - Use contextlib.suppress({exception}) instead of try-except-pass
# SIM108 - Use ternary operator {contents} instead of if-else-block
# SIM114 - Combine if branches using logical or operator
# SIM115 - Use context handler for opening files
# SIM117 - Use a single with statement with multiple contexts instead of nested with statements
# Ruff rules we ignore because we don't want them
#
# D105 - we don't need to document well-known magic methods
# D205 - 1 blank line required between summary line and description
# E731 - we can use lambdas however we want
# RUF100 - no unused noqa statements (not consistent enough yet)
# SIM118 - this does not work where we overload the .keys() method
#
ignore = ["D100", "D101", "D102", "D103", "D105", "D106", "D205", "D401", "D404", "E731", "RUF100", "SIM102", "SIM105", "SIM108", "SIM114", "SIM115", "SIM117", "SIM118"]
[tool.ruff.lint.per-file-ignores]
# D1XX - enforces writing docstrings
# E741 - ambiguous variable name
# N - We have our own naming conventions for unit tests.
# SLF001 - private member access
"*/tests/*" = ["D1", "E741", "N", "SLF001"]
"doc/gallery-src/*" = ["D400"]
[tool.ruff.lint.flake8-tidy-imports]
ban-relative-imports = "all"
[tool.ruff.lint.pydocstyle]
convention = "numpy"
#######################################################################
# PYTEST CONFIG #
#######################################################################
[tool.pytest.ini_options]
python_files = "test_*.py"
python_functions = "nothing matches this pattern"
addopts = "--durations=30 --tb=native"
filterwarnings = [
"ignore: the matrix subclass is not the recommended way:PendingDeprecationWarning",
]
[tool.coverage.run]
exclude_also = [
"armi/cli/gridGui.py",
"armi/utils/gridEditor.py",
"armi/utils/tests/test_gridGui.py",
"venv/",
]
source = ["armi"]
parallel = true
# Change default .coverage file to something that doesn't have a dot
# because some Windows services can't handle dots.
data_file = "coverage_results.cov"
[tool.coverage.report]
# Regexes for lines to exclude from consideration
omit = [
"armi/cli/gridGui.py",
"armi/utils/gridEditor.py",
"*/tests/*",
]
exclude_also = [
# Don't complain about missing debug-only code:
"def __repr__",
"if self\\.debug",
# Don't complain if tests don't hit defensive assertion code:
"raise AssertionError",
"raise KeyboardInterrupt",
"raise NotImplementedError",
"except ImportError",
"pass",
# Don't complain if non-runnable code isn't run:
"if __name__ == .__main__.:",
]
ignore_errors = true
#######################################################################
# DATA FILES TO BE INCLUDED WITH THE PROJECT #
#######################################################################
[tool.setuptools.package-data]
armi = [
"bookkeeping/tests/armiRun-A0032-aHist-ref.txt",
"nuclearDataIO/cccc/tests/fixtures/labels.ascii",
"nuclearDataIO/cccc/tests/fixtures/labels.binary",
"nuclearDataIO/cccc/tests/fixtures/mc2v3.dlayxs",
"nuclearDataIO/cccc/tests/fixtures/simple_cartesian.pwdint",
"nuclearDataIO/cccc/tests/fixtures/simple_cartesian.rtflux",
"nuclearDataIO/cccc/tests/fixtures/simple_cartesian.rzflux",
"nuclearDataIO/cccc/tests/fixtures/simple_hexz.dif3d",
"nuclearDataIO/cccc/tests/fixtures/simple_hexz.geodst",
"nuclearDataIO/cccc/tests/fixtures/simple_hexz.nhflux",
"nuclearDataIO/tests/fixtures/AA.gamiso",
"nuclearDataIO/tests/fixtures/AA.pmatrx",
"nuclearDataIO/tests/fixtures/AB.gamiso",
"nuclearDataIO/tests/fixtures/AB.pmatrx",
"nuclearDataIO/tests/fixtures/combined-AA-AB.gamiso",
"nuclearDataIO/tests/fixtures/combined-AA-AB.isotxs",
"nuclearDataIO/tests/fixtures/combined-AA-AB.pmatrx",
"nuclearDataIO/tests/fixtures/combined-and-lumped-AA-AB.gamiso",
"nuclearDataIO/tests/fixtures/combined-and-lumped-AA-AB.isotxs",
"nuclearDataIO/tests/fixtures/combined-and-lumped-AA-AB.pmatrx",
"nuclearDataIO/tests/fixtures/ISOAA",
"nuclearDataIO/tests/fixtures/ISOAB",
"nuclearDataIO/tests/fixtures/mc2v3-AA.flux_ufg",
"nuclearDataIO/tests/fixtures/mc2v3-AA.gamiso",
"nuclearDataIO/tests/fixtures/mc2v3-AA.isotxs",
"nuclearDataIO/tests/fixtures/mc2v3-AA.pmatrx",
"nuclearDataIO/tests/fixtures/mc2v3-AB.gamiso",
"nuclearDataIO/tests/fixtures/mc2v3-AB.isotxs",
"nuclearDataIO/tests/fixtures/mc2v3-AB.pmatrx",
"nuclearDataIO/tests/library-file-generation",
"nuclearDataIO/tests/library-file-generation/combine-AA-AB.inp",
"nuclearDataIO/tests/library-file-generation/combine-and-lump-AA-AB.inp",
"nuclearDataIO/tests/library-file-generation/mc2v2-dlayxs.inp",
"nuclearDataIO/tests/library-file-generation/mc2v3-AA.inp",
"nuclearDataIO/tests/library-file-generation/mc2v3-AB.inp",
"nuclearDataIO/tests/library-file-generation/mc2v3-dlayxs.inp",
"nuclearDataIO/tests/simple_hexz.inp",
"physics/neutronics/tests/ISOXA",
"physics/neutronics/tests/rzmflxYA",
"resources/*",
"resources/**/*",
"tests/1DslabXSByCompTest.yaml",
"tests/armiRun-SHUFFLES.txt",
"tests/armiRun.yaml",
"tests/COMPXS.ascii",
"tests/detailedAxialExpansion/armiRun.yaml",
"tests/detailedAxialExpansion/refSmallCoreGrid.yaml",
"tests/detailedAxialExpansion/refSmallReactor.yaml",
"tests/detailedAxialExpansion/refSmallReactorBase.yaml",
"tests/geom.xml",
"tests/geom1Assem.xml",
"tests/ISOAA",
"tests/refSmallCartesian.yaml",
"tests/refSmallCoreGrid.yaml",
"tests/refSmallReactor.yaml",
"tests/refSmallReactorBase.yaml",
"tests/refSmallSfpGrid.yaml",
"tests/refTestCartesian.yaml",
"tests/sfpGeom.yaml",
"tests/smallestTestReactor/armiRunSmallest.yaml",
"tests/smallestTestReactor/refOneBlockReactor.yaml",
"tests/smallestTestReactor/refSmallestReactor.yaml",
"tests/ThRZGeom.xml",
"tests/ThRZloading.yaml",
"tests/ThRZSettings.yaml",
"tests/trz_geom.xml",
"tests/tutorials",
"tests/tutorials/anl-afci-177-blueprints.yaml",
"tests/tutorials/anl-afci-177-coreMap.yaml",
"tests/tutorials/anl-afci-177-fuelManagement.py",
"tests/tutorials/anl-afci-177.yaml",
"tests/tutorials/data_model.ipynb",
"tests/zpprTest.yaml",
"tests/zpprTestGeom.xml",
]