-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathpyproject.toml
More file actions
156 lines (141 loc) · 4.72 KB
/
pyproject.toml
File metadata and controls
156 lines (141 loc) · 4.72 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
[build-system]
requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "fdm-book"
version = "1.0.0"
description = "Finite Difference Computing with PDEs - A Modern Software Approach"
readme = "README.md"
license = {text = "CC BY 4.0"}
authors = [
{name = "Hans Petter Langtangen"},
{name = "Svein Linge"},
]
maintainers = [
{name = "Gerard Gorman", email = "g.gorman@imperial.ac.uk"},
]
requires-python = ">=3.10"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Education",
"Intended Audience :: Science/Research",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Mathematics",
"Topic :: Scientific/Engineering :: Physics",
]
keywords = ["finite difference", "PDE", "numerical methods", "scientific computing"]
dependencies = [
"matplotlib>=3.7.0",
"numpy>=1.24.0",
"scipy>=1.10.0",
"sympy>=1.12",
]
[project.optional-dependencies]
dev = [
"pytest>=7.0.0",
"pytest-cov>=4.0.0",
"ruff>=0.14.0",
"isort>=5.13.0",
"flake8>=7.0.0",
"flake8-pyproject>=1.2.0",
"pre-commit>=3.0.0",
"pint>=0.23",
]
devito = [
"devito @ git+https://github.com/devitocodes/devito.git@main",
]
devito-petsc = [
"devito @ git+https://github.com/devitocodes/devito.git@petsc",
]
[project.urls]
Homepage = "https://github.com/devitocodes/devito_book"
Documentation = "https://hplgit.github.io/fdm-book/doc/web/"
Repository = "https://github.com/devitocodes/devito_book"
[tool.setuptools]
packages = ["src"]
package-dir = {"" = "."}
[tool.setuptools.package-data]
"*" = ["*.dict4spell.txt"]
[tool.ruff]
line-length = 90
target-version = "py310"
[tool.ruff.lint]
# Add the following rule sets
select = ["E", "W", "F", "B", "UP", "SIM", "RUF022"]
# But ignore these inconvenient rules
ignore = [
"F403", # from module import *
"E226", # missing whitespace around arithmetic operator
"E731", # lambda expressions
"E275", # missing whitespace after keyword
"F405", # name may be undefined from star import
"E722", # bare except
"E741", # ambiguous variable name (I, l, O)
"E743", # ambiguous function name (I, l, O) - common in math code
"W605", # invalid escape sequence
"E402", # module level import not at top of file - common in examples
"E702", # multiple statements on one line (semicolon) - compact examples
"E701", # multiple statements on one line (colon)
"B007", # loop control variable not used
"B023", # function uses loop variable - common pattern in closures
"B905", # zip without strict - Python 3.9 compatibility
"F841", # local variable assigned but never used - often for documentation
"F821", # undefined name - from star imports (numpy)
"F811", # redefinition of unused name - common in examples
"B018", # useless expression - often for demonstration
"B006", # mutable default argument - common in simple examples
"B008", # function call in default argument - common pattern
"E501", # line too long - allow long lines for math formulas and docstrings
"UP031", # use format specifiers - %-formatting is fine for educational code
"UP036", # version block outdated - legacy compatibility code
"SIM", # simplify rules - explicit code often clearer for educational purposes
"E401", # multiple imports on one line - common in compact examples
]
[tool.isort]
profile = "black"
line_length = 90
py_version = 310
skip = ["__init__.py"]
skip_gitignore = true
[tool.typos]
# For identifiers: Ignore words 2 characters or fewer followed by zero or more digits
# Also ignore collections of 20 or more "word character"s
default.extend-ignore-identifiers-re = ["\\b[[:alpha:]]{1,2}\\d*\\b", "\\b\\w{20,}\\b"]
# For words: Ignore words 2 characters or fewer followed by one or more digits
default.extend-ignore-words-re = ["\\b[[:alpha:]]{1,2}\\d?\\b", "\\b\\w{20,}\\b"]
[tool.typos.default.extend-words]
# numer - common abbreviation of numerator
numer = "numer"
[tool.flake8]
max-line-length = 90
ignore = [
"F403","E226","E731","E275",
"W503","F405","E722","E741",
"W504","W605"
]
[tool.coverage.run]
source = ["src"]
branch = true
omit = [
"src/legacy/*",
"tests/*",
"*/__init__.py",
]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"raise AssertionError",
"raise NotImplementedError",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
"if DEVITO_AVAILABLE:",
]
show_missing = true
precision = 2
[tool.coverage.xml]
output = "coverage.xml"