forked from brendanjmeade/celeri
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
242 lines (220 loc) · 7.64 KB
/
Copy pathpyproject.toml
File metadata and controls
242 lines (220 loc) · 7.64 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
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
[build-system]
requires = ["hatchling", "hatch-vcs", "hatch-fancy-pypi-readme"]
build-backend = "hatchling.build"
[project]
name = "celeri"
dynamic = ["version", "readme"]
description = "Next generation earthquake cycle kinematics"
license = {file = "LICENSE"}
authors = [
{name = "Brendan Meade", email = "brendanjmeade@gmail.com"},
]
requires-python = ">=3.13"
dependencies = [
"cartopy",
"colorcet",
"cutde>=25.7.24",
"cvxopt",
"cvxpy",
"gmsh",
"h5py",
"ipykernel",
"ipython",
"loguru",
"matplotlib",
"meshio",
"numba",
"numpy",
"nutpie",
"pandas",
"papermill",
"pyarrow",
"pydantic",
"pymc",
"pyproj",
"pytest",
"scikit-learn",
"scipy",
"shapely",
"spherical-geometry",
"tqdm",
"xarray",
"zarr",
]
classifiers = [
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Physics",
"Topic :: Scientific/Engineering :: Visualization",
"Operating System :: OS Independent",
]
[project.scripts]
celeri-apply-mesh-params = "celeri.scripts.apply_mesh_params:main"
celeri-check-fix-segments = "celeri.scripts.celeri_check_fix_segments:main"
celeri-check-segment-block-integrity = "celeri.scripts.celeri_check_segment_block_integrity:main"
celeri-create-bel-mesh = "celeri.scripts.create_bel_mesh:main"
celeri-create-grid-station = "celeri.scripts.create_grid_station:main"
celeri-create-mesh-params-template = "celeri.scripts.create_mesh_params_template:main"
celeri-forward = "celeri.scripts.celeri_forward:main"
celeri-msh2stl = "celeri.scripts.msh2stl:main"
celeri-remove-vels-segment-collocated = "celeri.scripts.celeri_remove_vels_segment_collocated:main"
celeri-report-segment-priors = "celeri.scripts.celeri_report_segment_priors:main"
celeri-reweight-stations = "celeri.scripts.celeri-reweight-stations:main"
celeri-segmesh = "celeri.scripts.segmesh:main"
celeri-snap-segments = "celeri.scripts.snap_segments:main"
celeri-solve = "celeri.scripts.celeri_solve:main"
celeri-stl2msh = "celeri.scripts.stl2msh:main"
[project.urls]
Homepage = "https://github.com/brendanjmeade/celeri"
[tool.hatch.build.targets.sdist]
# We only really need the main package and the tests in order to build and verify
# the package.
exclude = [
"/.github",
"/convert",
"/data",
"/meshing",
"/notebooks",
]
[tool.hatch.build.targets.wheel]
packages = ["celeri"]
[tool.hatch.version]
# Determine the version number based on Git tags
source = "vcs"
# Ensure that the version number is of the form vX.Y.Z
tag-pattern = '''^v(\d+\.\d+\.\d+)$'''
[tool.hatch.version.raw-options]
# See configuration details in
# <https://setuptools-scm.readthedocs.io/en/latest/extending/#version-number-construction>
# The following avoids the weird default behavior of incrementing the version number
# before a release is made.
version_scheme = "no-guess-dev"
# Relative links to GitHub in the README.md file break when rendered on PyPI.
# hatch-fancy-pypi-readme fixes this issue by replacing the relative links with
# absolute links to the raw content on GitHub.
# <https://github.com/hynek/hatch-fancy-pypi-readme>
[tool.hatch.metadata.hooks.fancy-pypi-readme]
content-type = "text/markdown"
[[tool.hatch.metadata.hooks.fancy-pypi-readme.fragments]]
path = "README.md"
[[tool.hatch.metadata.hooks.fancy-pypi-readme.substitutions]]
# Image links should go to the raw content on GitHub
# <https://stackoverflow.com/a/46875147>
pattern = '\[(.*?)\]\(((?!https?://)\S+\.(png|jpe?g|svg|gif))\)'
replacement = '[\1](https://raw.githubusercontent.com/brendanjmeade/celeri/main/\g<2>)'
[[tool.hatch.metadata.hooks.fancy-pypi-readme.substitutions]]
# Handle also HTML image tags
pattern = '''(<img\b[^>]*\bsrc=)(['"])((?!https?://)[^'"]+)(['"][^>]*>)'''
replacement = '<img src="https://raw.githubusercontent.com/brendanjmeade/celeri/main/\g<3>\g<4>'
[[tool.hatch.metadata.hooks.fancy-pypi-readme.substitutions]]
# Remaining non-image relative links map to the normal absolute GitHub URL
# <https://stackoverflow.com/a/46875147>
pattern = '\[(.*?)\]\(((?!https?://)\S+)\)'
replacement = '[\1](https://github.com/brendanjmeade/celeri/tree/main/\g<2>)'
[tool.pytest.ini_options]
addopts = "-s --tb=short"
[tool.ruff]
line-length = 88
target-version = "py311"
show-fixes = true
output-format = "full"
[tool.ruff.format]
docstring-code-format = true
exclude = [
"notebooks/*",
]
[tool.ruff.lint]
select = [
"D", # pydocstyle
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # Pyflakes
"I", # isort
"C4", # flake8-comprehensions
"B", # flake8-bugbear
"UP", # pyupgrade
"RUF", # Ruff-specific rules
"TID", # flake8-tidy-imports
"BLE", # flake8-blind-except
"PTH", # flake8-pathlib
"PERF", # perflint
"A", # flake8-builtins
]
ignore = [
"C408", # unnecessary-collection-call (allow dict(a=1, b=2); clarity over speed!)
"D203", # one-blank-line-before-class (must ignore this or D211)
"D213", # multi-line-summary-second-line (must ignore this or D212)
"D100", # Missing docstring in public module
"D101", # Missing docstring in public class
"D102", # Missing docstring in public method
"D103", # Missing docstring in public function
"D104", # Missing docstring in public package
"D105", # Missing docstring in magic method
"D107", # Missing docstring in __init__
"D205", # Missing blank line after summary
"D400", # ends-in-period
"D401", # First line of docstring should be in imperative mood
"D404", # First word of the docstring should not be "This"
"D413", # Missing blank line after last section
"D415", # ends-in-punctuation (redundant with D400 ends-in-period)
"D417", # Missing argument descriptions in the docstring
"E501", # line-too-long
"BLE001", # bare except
"PERF203", # try-except-in-loop
"RUF001", # ambiguous-unicode-char-string (Unicode math symbols are fine in scientific code)
"RUF002", # ambiguous-unicode-char-docstring
"RUF003", # ambiguous-unicode-char-comment
# The following list is recommended to disable these when using ruff's formatter.
# (Not all of the following are actually enabled.)
"W191", # tab-indentation
"E111", # indentation-with-invalid-multiple
"E114", # indentation-with-invalid-multiple-comment
"E117", # over-indented
"D206", # indent-with-spaces
"D300", # triple-single-quotes
"Q000", # bad-quotes-inline-string
"Q001", # bad-quotes-multiline-string
"Q002", # bad-quotes-docstring
"Q003", # avoidable-escaped-quote
"COM812", # missing-trailing-comma
"COM819", # prohibited-trailing-comma
"ISC001", # single-line-implicit-string-concatenation
"ISC002", # multi-line-implicit-string-concatenation
]
exclude = [
"notebooks/*",
]
[tool.ruff.lint.per-file-ignores]
"notebooks/*" = [
"B905", # zip-without-explicit-strict - common in notebooks
"E402", # module-import-not-at-top-of-file - common in notebooks
"D", # pydocstyle - not needed in notebooks
"F401", # unused-import - exploratory notebooks often have unused imports
]
[tool.ruff.lint.flake8-tidy-imports]
ban-relative-imports = "all"
[tool.pyright]
venvPath = ".pixi/envs"
venv = "default"
[tool.mypy]
python_version = "3.13"
[[tool.mypy.overrides]]
module = [
"cartopy.*",
"colorcet",
"cutde.*",
"cvxopt.*",
"gmsh",
"meshio",
"mpl_toolkits.*",
"nutpie",
"okada_wrapper",
"papermill",
"pymc.*",
"spherical_geometry.*",
]
ignore_missing_imports = true
[tool.ty.environment]
python = ".pixi/envs/default"