Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
yt-project
GitHub Repository: yt-project/yt
Path: blob/main/pyproject.toml
925 views
1
[build-system]
2
# keep in sync with .github/workflows/wheels.yaml
3
requires = [
4
"setuptools>=77.0.0",
5
"Cython>=3.0.3",
6
"numpy>=2.0.0",
7
"ewah-bool-utils>=1.2.0",
8
"wheel>=0.38.0",
9
]
10
build-backend = "setuptools.build_meta"
11
12
[project]
13
name = "yt"
14
version = "4.5.dev0"
15
description = "An analysis and visualization toolkit for volumetric data"
16
authors = [
17
{ name = "The yt project", email = "[email protected]" },
18
]
19
license = "BSD-3-Clause"
20
license-files = [
21
"COPYING.txt",
22
"yt/frontends/artio/artio_headers/LICENSE",
23
]
24
classifiers = [
25
"Development Status :: 5 - Production/Stable",
26
"Environment :: Console",
27
"Framework :: Matplotlib",
28
"Intended Audience :: Science/Research",
29
"Operating System :: MacOS :: MacOS X",
30
"Operating System :: POSIX :: AIX",
31
"Operating System :: POSIX :: Linux",
32
"Programming Language :: C",
33
"Programming Language :: C++",
34
"Programming Language :: Cython",
35
"Programming Language :: Python :: 3",
36
"Programming Language :: Python :: 3 :: Only",
37
"Programming Language :: Python :: 3.10",
38
"Programming Language :: Python :: 3.11",
39
"Programming Language :: Python :: 3.12",
40
"Programming Language :: Python :: 3.13",
41
"Programming Language :: Python :: 3.14",
42
"Topic :: Scientific/Engineering :: Astronomy",
43
"Topic :: Scientific/Engineering :: Physics",
44
"Topic :: Scientific/Engineering :: Visualization",
45
]
46
keywords = [
47
"adaptivemeshrefinement",
48
"amr",
49
"astronomy",
50
"astrophysics",
51
"visualization",
52
]
53
requires-python = ">=3.10.4"
54
55
# keep in sync with minimal_requirements.txt
56
dependencies = [
57
"cmyt>=1.1.2",
58
"ewah-bool-utils>=1.2.0",
59
"matplotlib>=3.6.0",
60
"more-itertools>=8.4",
61
"numpy>=1.21.3, <3", # keep minimal requirement in sync with NPY_TARGET_VERSION
62
# https://github.com/numpy/numpy/issues/27037
63
"numpy!=2.0.1 ; platform_machine=='arm64' and platform_system=='Darwin'",
64
"packaging>=20.9",
65
"pillow>=8.3.2",
66
"rlic>=0.3.2",
67
"tomli-w>=0.4.0",
68
"tqdm>=3.4.0",
69
"unyt>=2.9.2",
70
"tomli>=1.2.3;python_version < '3.11'",
71
"typing-extensions>=4.4.0;python_version < '3.12'",
72
]
73
74
[project.readme]
75
file = "README.md"
76
content-type = "text/markdown"
77
78
[project.urls]
79
Homepage = "https://yt-project.org/"
80
Documentation = "https://yt-project.org/doc/"
81
Source = "https://github.com/yt-project/yt/"
82
Tracker = "https://github.com/yt-project/yt/issues"
83
84
[project.entry-points."nose.plugins.0.10"]
85
# this section can be cleaned when nose tests on GHA are removed
86
answer-testing = "yt.utilities.answer_testing.framework:AnswerTesting"
87
88
[project.optional-dependencies]
89
# some generic, reusable constraints on optional-deps
90
HDF5 = ["h5py>=3.1.0,!=3.12.0; platform_system=='Windows'"] # see https://github.com/h5py/h5py/issues/2505
91
netCDF4 = ["netCDF4!=1.6.1,>=1.5.3"] # see https://github.com/Unidata/netcdf4-python/issues/1192
92
Fortran = ["f90nml>=1.1"]
93
94
# frontend-specific requirements
95
# all frontends should have a target, even if no additional requirements are needed
96
# note that, because pip normalizes underscores to hyphens, we need to apply this transformation
97
# in target names here so that recursive dependencies link correctly.
98
# This does *not* prevent end-users to write, say `pip install yt[enzo_e]`.
99
# We also normalize all target names to lower case for consistency.
100
adaptahop = []
101
ahf = []
102
amrex = []
103
amrvac = ["yt[Fortran]"]
104
art = []
105
arepo = ["yt[HDF5]"]
106
artio = []
107
athena = []
108
athena-pp = []
109
boxlib = []
110
cf-radial = ["xarray>=0.16.1", "arm-pyart>=1.19.2",]
111
chimera = ["yt[HDF5]"]
112
chombo = ["yt[HDF5]"]
113
cholla = ["yt[HDF5]"]
114
eagle = ["yt[HDF5]"]
115
enzo-e = ["yt[HDF5]", "libconf>=1.0.1"]
116
enzo = ["yt[HDF5]", "libconf>=1.0.1"]
117
exodus-ii = ["yt[netCDF4]"]
118
fits = ["astropy>=4.0.1", "regions>=0.7"]
119
flash = ["yt[HDF5]"]
120
gadget = ["yt[HDF5]"]
121
gadget-fof = ["yt[HDF5]"]
122
gamer = ["yt[HDF5]"]
123
gdf = ["yt[HDF5]"]
124
gizmo = ["yt[HDF5]"]
125
halo-catalog = ["yt[HDF5]"]
126
http-stream = ["requests>=2.20.0"]
127
idefix = ["yt_idefix[HDF5]>=2.3.0"] # externally packaged frontend
128
moab = ["yt[HDF5]"]
129
nc4-cm1 = ["yt[netCDF4]"]
130
open-pmd = ["yt[HDF5]"]
131
owls = ["yt[HDF5]"]
132
owls-subfind = ["yt[HDF5]"]
133
parthenon = ["yt[HDF5]"]
134
ramses = ["yt[Fortran]", "scipy"]
135
rockstar = []
136
sdf = ["requests>=2.20.0"]
137
stream = []
138
swift = ["yt[HDF5]"]
139
tipsy = []
140
ytdata = ["yt[HDF5]"]
141
142
# "full" should contain all optional dependencies intended for users (not devs)
143
# in particular it should enable support for all frontends
144
full = [
145
"cartopy>=0.22.0",
146
"firefly>=3.2.0",
147
"glueviz>=0.13.3",
148
"ipython>=7.16.2",
149
"ipywidgets>=8.0.0",
150
"miniballcpp>=0.2.1",
151
"mpi4py>=3.0.3",
152
"pandas>=1.1.2",
153
"pooch>=0.7.0",
154
"pyaml>=17.10.0",
155
"pykdtree>=1.3.1",
156
"pyx>=0.15",
157
"scipy>=1.5.0",
158
"glue-core!=1.2.4;python_version >= '3.10'", # see https://github.com/glue-viz/glue/issues/2263
159
"ratarmount~=0.8.1;platform_system!='Windows' and platform_system!='Darwin'",
160
"yt[adaptahop]",
161
"yt[ahf]",
162
"yt[amrex]",
163
"yt[amrvac]",
164
"yt[art]",
165
"yt[arepo]",
166
"yt[artio]",
167
"yt[athena]",
168
"yt[athena_pp]",
169
"yt[boxlib]",
170
"yt[cf_radial]",
171
"yt[chimera]",
172
"yt[chombo]",
173
"yt[cholla]",
174
"yt[eagle]",
175
"yt[enzo_e]",
176
"yt[enzo]",
177
"yt[exodus_ii]",
178
"yt[fits]",
179
"yt[flash]",
180
"yt[gadget]",
181
"yt[gadget_fof]",
182
"yt[gamer]",
183
"yt[gdf]",
184
"yt[gizmo]",
185
"yt[halo_catalog]",
186
"yt[http_stream]",
187
"yt[idefix]",
188
"yt[moab]",
189
"yt[nc4_cm1]",
190
"yt[open_pmd]",
191
"yt[owls]",
192
"yt[owls_subfind]",
193
"yt[parthenon]",
194
"yt[ramses]",
195
"yt[rockstar]",
196
"yt[sdf]",
197
"yt[stream]",
198
"yt[swift]",
199
"yt[tipsy]",
200
"yt[ytdata]",
201
]
202
203
# dev-only extra targets
204
mapserver = [
205
"bottle",
206
]
207
test = [
208
"pyaml>=17.10.0",
209
"pytest>=6.1",
210
"pytest-mpl>=0.16.1",
211
"sympy!=1.10,!=1.9", # see https://github.com/sympy/sympy/issues/22241
212
"imageio!=2.35.0", # see https://github.com/yt-project/yt/issues/4966
213
]
214
215
[project.scripts]
216
yt = "yt.utilities.command_line:run_main"
217
218
[tool.setuptools]
219
include-package-data = true
220
zip-safe = false
221
222
[tool.setuptools.packages.find]
223
namespaces = false
224
225
[tool.black]
226
# TODO: drop this section when ruff supports embedded python blocks
227
# see https://github.com/astral-sh/ruff/issues/8237
228
include = '\.pyi?$'
229
exclude = '''
230
/(
231
\.eggs
232
| \.git
233
| \.hg
234
| \.mypy_cache
235
| \.tox
236
| \.venv
237
| _build
238
| buck-out
239
| build
240
| dist
241
| yt/frontends/stream/sample_data
242
)/
243
| yt/visualization/_colormap_data.py
244
'''
245
246
[tool.ruff]
247
exclude = [
248
"doc",
249
"benchmarks",
250
"*/api.py",
251
"*/__init__.py",
252
"*/__config__.py",
253
"yt/units",
254
"yt/frontends/stream/sample_data",
255
"yt/utilities/fits_image.py",
256
"yt/utilities/lodgeit.py",
257
"yt/mods.py",
258
"yt/visualization/_colormap_data.py",
259
"yt/exthook.py",
260
]
261
262
[tool.ruff.lint]
263
select = [
264
"E",
265
"F",
266
"W",
267
"C4", # flake8-comprehensions
268
"B", # flake8-bugbear
269
"G", # flake8-logging-format
270
"TCH", # flake8-type-checking
271
"YTT", # flake8-2020
272
"UP", # pyupgrade
273
"I", # isort
274
"NPY", # numpy specific rules
275
"RUF031"# incorrectly-parenthesized-tuple-in-subscript
276
]
277
ignore = [
278
"E501", # line too long
279
"E741", # Do not use variables named 'I', 'O', or 'l'
280
"B018", # Found useless expression. # disabled because ds.index is idiomatic
281
"UP038", # non-pep604-isinstance
282
]
283
284
[tool.ruff.lint.per-file-ignores]
285
"test_*" = ["NPY002"]
286
287
[tool.ruff.lint.isort]
288
combine-as-imports = true
289
known-third-party = [
290
"IPython",
291
"nose",
292
"numpy",
293
"sympy",
294
"matplotlib",
295
"unyt",
296
"git",
297
"yaml",
298
"dateutil",
299
"requests",
300
"coverage",
301
"pytest",
302
"pyx",
303
"glue",
304
]
305
known-first-party = ["yt"]
306
307
# The -s option prevents pytest from capturing output sent to stdout
308
# -v runs pytest in verbose mode
309
# -rsfE: The -r tells pytest to provide extra test summary info on the events
310
# specified by the characters following the r. s: skipped, f: failed, E: error
311
[tool.pytest.ini_options]
312
addopts = '''
313
-rsfE
314
--ignore-glob='/*_nose.py'
315
--ignore-glob='/*/yt/data_objects/level_sets/tests/test_clump_finding.py'
316
--ignore-glob='/*/yt/data_objects/tests/test_connected_sets.py'
317
--ignore-glob='/*/yt/data_objects/tests/test_dataset_access.py'
318
--ignore-glob='/*/yt/data_objects/tests/test_particle_filter.py'
319
--ignore-glob='/*/yt/data_objects/tests/test_particle_trajectories.py'
320
--ignore-glob='/*/yt/data_objects/tests/test_pickling.py'
321
--ignore-glob='/*/yt/data_objects/tests/test_regions.py'
322
--ignore-glob='/*/yt/fields/tests/test_particle_fields.py'
323
--ignore-glob='/*/yt/fields/tests/test_vector_fields.py'
324
--ignore-glob='/*/yt/fields/tests/test_xray_fields.py'
325
--ignore-glob='/*/yt/frontends/adaptahop/tests/test_outputs.py'
326
--ignore-glob='/*/yt/frontends/ahf/tests/test_outputs.py'
327
--ignore-glob='/*/yt/frontends/amrex/tests/test_outputs.py'
328
--ignore-glob='/*/yt/frontends/amrvac/tests/test_outputs.py'
329
--ignore-glob='/*/yt/frontends/amrvac/tests/test_units_override.py'
330
--ignore-glob='/*/yt/frontends/arepo/tests/test_outputs.py'
331
--ignore-glob='/*/yt/frontends/art/tests/test_outputs.py'
332
--ignore-glob='/*/yt/frontends/artio/tests/test_outputs.py'
333
--ignore-glob='/*/yt/frontends/athena/tests/test_outputs.py'
334
--ignore-glob='/*/yt/frontends/athena_pp/tests/test_outputs.py'
335
--ignore-glob='/*/yt/frontends/boxlib/tests/test_outputs.py'
336
--ignore-glob='/*/yt/frontends/cf_radial/tests/test_outputs.py'
337
--ignore-glob='/*/yt/frontends/chimera/tests/test_outputs.py'
338
--ignore-glob='/*/yt/frontends/cholla/tests/test_outputs.py'
339
--ignore-glob='/*/yt/frontends/chombo/tests/test_outputs.py'
340
--ignore-glob='/*/yt/frontends/eagle/tests/test_outputs.py'
341
--ignore-glob='/*/yt/frontends/enzo/tests/test_outputs.py'
342
--ignore-glob='/*/yt/frontends/enzo_e/tests/test_outputs.py'
343
--ignore-glob='/*/yt/frontends/exodus_ii/tests/test_outputs.py'
344
--ignore-glob='/*/yt/frontends/fits/tests/test_outputs.py'
345
--ignore-glob='/*/yt/frontends/flash/tests/test_outputs.py'
346
--ignore-glob='/*/yt/frontends/gadget/tests/test_outputs.py'
347
--ignore-glob='/*/yt/frontends/gadget_fof/tests/test_outputs.py'
348
--ignore-glob='/*/yt/frontends/gamer/tests/test_outputs.py'
349
--ignore-glob='/*/yt/frontends/gdf/tests/test_outputs.py'
350
--ignore-glob='/*/yt/frontends/gdf/tests/test_outputs_nose.py'
351
--ignore-glob='/*/yt/frontends/gizmo/tests/test_outputs.py'
352
--ignore-glob='/*/yt/frontends/halo_catalog/tests/test_outputs.py'
353
--ignore-glob='/*/yt/frontends/moab/tests/test_c5.py'
354
--ignore-glob='/*/yt/frontends/nc4_cm1/tests/test_outputs.py'
355
--ignore-glob='/*/yt/frontends/open_pmd/tests/test_outputs.py'
356
--ignore-glob='/*/yt/frontends/owls/tests/test_outputs.py'
357
--ignore-glob='/*/yt/frontends/owls_subfind/tests/test_outputs.py'
358
--ignore-glob='/*/yt/frontends/parthenon/tests/test_outputs.py'
359
--ignore-glob='/*/yt/frontends/ramses/tests/test_outputs.py'
360
--ignore-glob='/*/yt/frontends/rockstar/tests/test_outputs.py'
361
--ignore-glob='/*/yt/frontends/tipsy/tests/test_outputs.py'
362
--ignore-glob='/*/yt/frontends/ytdata/tests/test_old_outputs.py'
363
--ignore-glob='/*/yt/frontends/ytdata/tests/test_outputs.py'
364
--ignore-glob='/*/yt/frontends/ytdata/tests/test_unit.py'
365
--ignore-glob='/*/yt/geometry/coordinates/tests/test_axial_pixelization.py'
366
--ignore-glob='/*/yt/geometry/coordinates/tests/test_cylindrical_coordinates.py'
367
--ignore-glob='/*/yt/geometry/coordinates/tests/test_spherical_coordinates.py'
368
--ignore-glob='/*/yt/tests/test_funcs.py'
369
--ignore-glob='/*/yt/utilities/lib/cykdtree/tests/__init__.py'
370
--ignore-glob='/*/yt/utilities/lib/cykdtree/tests/test_kdtree.py'
371
--ignore-glob='/*/yt/utilities/lib/cykdtree/tests/test_plot.py'
372
--ignore-glob='/*/yt/utilities/lib/cykdtree/tests/test_utils.py'
373
--ignore-glob='/*/yt/utilities/tests/test_cosmology.py'
374
--ignore-glob='/*/yt/visualization/tests/test_callbacks.py'
375
--ignore-glob='/*/yt/visualization/tests/test_color_maps.py'
376
--ignore-glob='/*/yt/visualization/tests/test_geo_projections.py'
377
--ignore-glob='/*/yt/visualization/tests/test_image_writer.py'
378
--ignore-glob='/*/yt/visualization/tests/test_line_plots.py'
379
--ignore-glob='/*/yt/visualization/tests/test_mesh_slices.py'
380
--ignore-glob='/*/yt/visualization/tests/test_norm_api_custom_norm.py'
381
--ignore-glob='/*/yt/visualization/tests/test_norm_api_inf_zlim.py'
382
--ignore-glob='/*/yt/visualization/tests/test_norm_api_lineplot.py'
383
--ignore-glob='/*/yt/visualization/tests/test_norm_api_particleplot.py'
384
--ignore-glob='/*/yt/visualization/tests/test_norm_api_phaseplot_set_colorbar_explicit.py'
385
--ignore-glob='/*/yt/visualization/tests/test_norm_api_phaseplot_set_colorbar_implicit.py'
386
--ignore-glob='/*/yt/visualization/tests/test_norm_api_profileplot.py'
387
--ignore-glob='/*/yt/visualization/tests/test_norm_api_set_background_color.py'
388
--ignore-glob='/*/yt/visualization/tests/test_particle_plot.py'
389
--ignore-glob='/*/yt/visualization/tests/test_plot_modifications.py'
390
--ignore-glob='/*/yt/visualization/tests/test_plotwindow.py'
391
--ignore-glob='/*/yt/visualization/tests/test_raw_field_slices.py'
392
--ignore-glob='/*/yt/visualization/volume_rendering/tests/test_mesh_render.py'
393
--ignore-glob='/*/yt/visualization/volume_rendering/tests/test_vr_orientation.py'
394
395
'''
396
397
398
[tool.check-manifest]
399
# ignore generated C/C++ files, otherwise reported as "missing from VCS" (Version Control System)
400
# Please resist the temptation to use patterns instead of exact file names here.
401
ignore = [
402
"yt/frontends/artio/_artio_caller.c",
403
"yt/frontends/gamer/cfields.c",
404
"yt/frontends/ramses/io_utils.c",
405
"yt/geometry/fake_octree.c",
406
"yt/geometry/grid_container.c",
407
"yt/geometry/grid_visitors.c",
408
"yt/geometry/oct_container.c",
409
"yt/geometry/oct_visitors.c",
410
"yt/geometry/particle_deposit.c",
411
"yt/geometry/particle_oct_container.cpp",
412
"yt/geometry/particle_smooth.c",
413
"yt/geometry/selection_routines.c",
414
"yt/utilities/cython_fortran_utils.c",
415
"yt/utilities/lib/_octree_raytracing.cpp",
416
"yt/utilities/lib/allocation_container.c",
417
"yt/utilities/lib/alt_ray_tracers.c",
418
"yt/utilities/lib/amr_kdtools.c",
419
"yt/utilities/lib/autogenerated_element_samplers.c",
420
"yt/utilities/lib/basic_octree.c",
421
"yt/utilities/lib/bitarray.c",
422
"yt/utilities/lib/bounded_priority_queue.c",
423
"yt/utilities/lib/bounding_volume_hierarchy.cpp",
424
"yt/utilities/lib/contour_finding.c",
425
"yt/utilities/lib/cosmology_time.c",
426
"yt/utilities/lib/cykdtree/kdtree.cpp",
427
"yt/utilities/lib/cykdtree/utils.cpp",
428
"yt/utilities/lib/cyoctree.c",
429
"yt/utilities/lib/cyoctree.cpp",
430
"yt/utilities/lib/depth_first_octree.c",
431
"yt/utilities/lib/distance_queue.c",
432
"yt/utilities/lib/element_mappings.c",
433
"yt/utilities/lib/ewah_bool_wrap.cpp",
434
"yt/utilities/lib/fnv_hash.c",
435
"yt/utilities/lib/fortran_reader.c",
436
"yt/utilities/lib/geometry_utils.cpp",
437
"yt/utilities/lib/grid_traversal.cpp",
438
"yt/utilities/lib/image_samplers.cpp",
439
"yt/utilities/lib/image_utilities.c",
440
"yt/utilities/lib/interpolators.c",
441
"yt/utilities/lib/lenses.c",
442
"yt/utilities/lib/marching_cubes.cpp",
443
"yt/utilities/lib/mesh_triangulation.c",
444
"yt/utilities/lib/mesh_utilities.c",
445
"yt/utilities/lib/misc_utilities.cpp",
446
"yt/utilities/lib/origami.c",
447
"yt/utilities/lib/particle_kdtree_tools.cpp",
448
"yt/utilities/lib/particle_mesh_operations.c",
449
"yt/utilities/lib/partitioned_grid.cpp",
450
"yt/utilities/lib/pixelization_routines.cpp",
451
"yt/utilities/lib/points_in_volume.c",
452
"yt/utilities/lib/primitives.c",
453
"yt/utilities/lib/quad_tree.c",
454
"yt/utilities/lib/ragged_arrays.c",
455
"yt/utilities/lib/write_array.c",
456
]
457
458
459
[tool.mypy]
460
python_version = '3.10'
461
show_error_codes = true
462
ignore_missing_imports = true
463
warn_unused_configs = true
464
warn_unused_ignores = true
465
warn_unreachable = true
466
show_error_context = true
467
exclude = "(test_*|lodgeit)"
468
469
[tool.cibuildwheel]
470
build-verbosity = 1
471
skip = ["cp314t-*"]
472
test-extras = "test"
473
test-command = [
474
'python -c "import yt"',
475
"python -m pytest -c {project}/pyproject.toml --rootdir . --color=yes --pyargs yt -ra",
476
]
477
environment = {"YT_LIMITED_API" = "1"}
478
479