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 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555
|
[build-system]
build-backend = 'setuptools.build_meta'
requires = ['setuptools>=77.0.3']
[project]
authors = [{ name = 'PyVista Developers', email = 'info@pyvista.org' }]
classifiers = [
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Science/Research',
'Operating System :: MacOS',
'Operating System :: Microsoft :: Windows',
'Operating System :: POSIX',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: 3.13',
'Programming Language :: Python :: 3.9',
'Topic :: Scientific/Engineering :: Information Analysis',
]
dependencies = [
'matplotlib>=3.0.1',
'numpy>=1.21.0', # minimum typing support
'pillow',
'pooch',
'scooby>=0.5.1',
'typing-extensions>=4.10',
'vtk!=9.4.0',
'vtk!=9.4.1',
'vtk<9.6.0',
]
description = 'Easier Pythonic interface to VTK'
dynamic = ['version']
keywords = ['mesh', 'numpy', 'plotting', 'vtk']
license = 'MIT'
name = 'pyvista'
readme = 'README.rst'
requires-python = '>=3.9'
[project.optional-dependencies]
all = ['pyvista[colormaps,io,jupyter]']
colormaps = ['cmcrameri', 'cmocean', 'colorcet']
io = ['imageio', 'meshio>=5.2']
jupyter = [
'ipywidgets',
'jupyter-server-proxy',
'nest_asyncio',
'trame-client>=2.12.7',
'trame-server>=2.11.7',
'trame-vtk>=2.5.8',
'trame-vuetify>=2.3.1',
'trame>=2.5.2',
]
[dependency-groups]
pinned = [ # Pinned versions of core dependencies
'matplotlib<3.10.2',
'numpy<2.4.0',
'pillow<11.4.0',
'pooch<1.9.0',
'scooby<0.11.0',
'typing-extensions<4.15.0',
]
typing = [
'mypy<1.17.0',
'npt-promote==0.2',
'numpy>=2.0.0',
'trimesh<4.7.0',
{ include-group = 'pinned' },
]
test = [
'cmcrameri<1.10.0',
'cmocean<4.0.4',
'colorcet<3.2.0',
'embreex<2.17.8; sys_platform != "darwin" or platform_machine != "arm64"', # Does not work with arm-based macs
'hypothesis<6.136.8',
'imageio-ffmpeg<0.7.0',
'imageio<2.38.0',
'ipython<10.0.0',
'ipywidgets<9.0.0',
'meshio<5.4.0',
'nest_asyncio<1.6.1',
'numpydoc<1.10.0',
'pandas<=2.4.0',
'pyanalyze<=0.13.1',
'pytest-cov<6.3.0',
'pytest-mypy-plugins<3.3.0',
'pytest-pyvista==0.2.0',
'pytest-xdist<3.9.0',
'pytest<8.5.0',
'pytest_cases<3.10.0',
'pytest_mock<3.15.0',
'retry-requests<2.1.0',
'scipy<1.17.0',
'sphinx-book-theme<1.2.0',
'sphinx-gallery<0.20.0',
'sphinx<8.3.0',
'sphinx_design<0.7.0',
'sympy<1.15.0',
'tqdm<4.68.0',
'trame-vtk>=2.5.8,<2.9.1',
'trame-vuetify>=2.3.1,<3.0.2',
'trame>=2.5.2,<3.10.3',
'trimesh<4.7.0',
'typing-extensions<4.15.0',
{ include-group = 'pinned' },
]
docs = [
'atsphinx-mini18n==0.4.1',
'cmcrameri==1.9.0',
'cmocean==4.0.3',
'colorcet==3.1.0',
'colour-science==0.4.6',
'enum-tools==0.13.0',
'imageio-ffmpeg==0.6.0',
'imageio==2.37.0',
'jupyter_sphinx==0.5.3',
'jupyterlab==4.4.5',
'lxml==6.0.0',
'meshio==5.3.5',
'mypy-extensions==1.1.0',
'mypy==1.17.1',
'numpydoc==1.9.0',
'osmnx==2.0.5',
'pydata-sphinx-theme==0.15.4', # Do not upgrade, see https://github.com/pyvista/pyvista/pull/7095
'pypandoc==1.15',
'pytest-pyvista==0.2.0',
'pytest-sphinx==0.6.3',
'scipy==1.16.0',
'sphinx-autobuild==2024.10.3',
'sphinx-book-theme==1.1.4',
'sphinx-copybutton==0.5.2',
'sphinx-design==0.6.1',
'sphinx-gallery==0.19.0',
'sphinx-notfound-page==1.1.0',
'sphinx-sitemap==2.7.2',
'sphinx-tags==0.4.0',
'sphinx-toolbox==4.0.0',
'sphinx==8.2.3',
'sphinxcontrib-asciinema==0.4.2',
'sphinxcontrib-websupport==2.0.0',
'sphinxext-opengraph==0.10.0',
'sympy==1.14.0',
'trame-vtk==2.9.1',
'trame-vuetify==3.0.1',
'trame==3.11.0',
'trimesh==4.7.1',
'vtk-xref==0.1.0',
{ include-group = 'pinned' },
]
dev = ['pre-commit', { include-group = 'test' }, { include-group = 'typing' }]
[project.urls]
'Bug Reports' = 'https://github.com/pyvista/pyvista/issues'
Documentation = 'https://docs.pyvista.org/'
Homepage = 'https://github.com/pyvista/pyvista'
'Source Code' = 'https://github.com/pyvista/pyvista'
[tool.setuptools.dynamic]
version = { attr = 'pyvista._version.__version__' }
[tool.setuptools.packages.find]
include = ['pyvista', 'pyvista.*']
[tool.setuptools.package-data]
pyvista = ['py.typed']
'pyvista.examples' = [
'2k_earth_daymap.jpg',
'airplane.ply',
'ant.ply',
'channels.vti',
'frog_tissues.vti',
'globe.vtk',
'hexbeam.vtk',
'nut.ply',
'pyvista_logo.png',
'rectilinear.vtk',
'sphere.ply',
'uniform.vtk',
]
[tool.blackdoc]
# From https://numpydoc.readthedocs.io/en/latest/format.html
# Extended discussion: https://github.com/pyvista/pyvista/pull/4129
# The length of docstring lines should be kept to 75 characters to facilitate
# reading the docstrings in text terminals.
line-length = 75
[tool.build_sphinx]
all_files = 1
build-dir = './doc/_build'
source-dir = 'doc'
[tool.upload_sphinx]
upload-dir = 'doc/_build/html'
[tool.codespell]
ignore-words = 'doc/styles/Vocab/pyvista/accept.txt'
quiet-level = 3
skip = '*.pyc,*.txt,*.gif,*.png,*.jpg,*.ply,*.vtk,*.vti,*.vtu,*.js,*.html,*.doctree,*.ttf,*.woff,*.woff2,*.eot,*.mp4,*.inv,*.pickle,*.ipynb,flycheck*,./.git/*,./.hypothesis/*,*.yml,doc/_build/*,./doc/images/*,./dist/*,*~,.hypothesis*,./doc/examples/*,*.mypy_cache/*,*cover,./tests/tinypages/_build/*,*/_autosummary/*'
[tool.coverage.run]
omit = [
'pyvista/conftest.py',
'pyvista/plotting/theme.py', # kept for backwards compatibility
]
[tool.coverage.report]
exclude_also = ['^\s*@overload.*\n\s*def .*\(.*$', '^\s*if TYPE_CHECKING:']
[tool.pytest.ini_options]
addopts = ['--strict-config', '--strict-markers', '-ra']
doctest_optionflags = 'NUMBER ELLIPSIS'
# Keep spaces between filter warnings since order matters (see https://docs.pytest.org/en/stable/how-to/capture-warnings.html#controlling-warnings)
filterwarnings = [
'error',
"ignore:'mode' parameter is deprecated and will be removed in Pillow 13:DeprecationWarning", # matplotlib toolbar icon creation with newer Pillow
'ignore:.*A NumPy version .* is required for this version of SciPy.*:UserWarning',
'ignore:.*Given trait value dtype "float64":UserWarning', # bogus numpy ABI warning (see numpy/#432)
'ignore:.*The NumPy module was reloaded*:UserWarning', # bogus numpy ABI warning (see numpy/#432)
'ignore:.*numpy.dtype size changed.*:RuntimeWarning', # bogus numpy ABI warning (see numpy/#432)
'ignore:.*numpy.ufunc size changed.*:RuntimeWarning', # bogus numpy ABI warning (see numpy/#432)
'ignore:Ignoring invalid PYVISTA_USERDATA_PATH.*:UserWarning',
'ignore:Passing .{1}N.{1} to ListedColormap is deprecated since:DeprecationWarning', # https://github.com/matplotlib/cmocean/pull/114
'ignore:The .*interactive_bk.* attribute was deprecated in Matplotlib 3\.9.*:matplotlib.MatplotlibDeprecationWarning', # https://github.com/microsoft/debugpy/issues/1623
'ignore:pyvista test \w+ image dir.* does not yet exist. Creating dir.:UserWarning',
'always:.*Exceeded image regression warning of .* with an image error of .*:UserWarning',
]
junit_family = 'legacy'
log_cli_level = "INFO"
markers = [
'needs_download: this test downloads data during execution',
'needs_vtk_version(at_least, less_than, reason): skip test unless VTK version corresponds to at_least and greater_than values.',
'skip_check_gc: Disable the autouse check_gc fixture for this test.',
'skip_egl(reason="Test fails when using OSMesa/EGL VTK build"): skip test for OSMesa/EGL.',
'skip_mac(reason="Test fails on MacOS", machine=None, processor=None): skip test for MacOS and specific architectures if needed',
'skip_windows(reason="Test fails on Windows"): skip test for windows.',
]
minversion = "7"
testpaths = 'tests'
xfail_strict = true
[tool.mypy]
check_untyped_defs = true
disallow_any_generics = true
disallow_subclassing_any = true
enable_error_code = ['ignore-without-code', 'redundant-expr', 'truthy-bool']
exclude = ['pyvista/ext/']
extra_checks = true
ignore_missing_imports = true
no_implicit_reexport = true
packages = ['pyvista']
plugins = ['npt_promote', 'pyvista.typing.mypy_plugin']
pretty = true
show_error_context = true
strict_equality = true
warn_redundant_casts = true
warn_unreachable = true
warn_unused_configs = true
warn_unused_ignores = true
[tool.numpydoc_validation]
checks = [
'all', # all but the following:
#
'ES01', # Not all docstrings need an extend summary.
'EX01', # Examples: Will eventually enforce
'GL01', # Contradicts numpydoc examples
'GL02', # Permit a blank line after the end of our docstring
'GL03', # Considering enforcing
'GL06', # Found unknown section
'GL07', # 'Sections are in the wrong order. Correct order is: {correct_sections}',
'GL08', # The object does not have a docstring
'GL09', # Deprecation warning should precede extended summary (check broken)
'PR01', # 'Parameters {missing_params} not documented',
'PR02', # 'Unknown parameters {unknown_params}',
'PR03', # 'Wrong parameters order. Actual: {actual_params}. Documented: {documented_params}',
'PR04', # 'Parameter "{param_name}" has no type',
'PR05', # 'Parameter "{param_name}" type should not finish with "."',
'PR06', # 'Parameter "{param_name}" type should use "{right_type}" instead of "{wrong_type}"',
'PR07', # 'Parameter "{param_name}" has no description',
'PR08', # 'Parameter "{param_name}" description should start with a capital letter",
'PR09', # 'Parameter "{param_name}" description should finish with "."',
'PR10', # 'Parameter "{param_name}" requires a space before the colon separating the parameter name and type",
'SA01', # Not all docstrings need a see also
'SA04', # See also section does not need descriptions
'SS05', # Appears to be broken.
'YD01', # Yields: No plan to enforce
]
exclude = [ # don't report on objects that match any of these regex
'\.*Reader(\.|$)', # classes inherit from BaseReader
'\._.*$', # Ignore anything that's private (e.g., starts with _)
'^plot_directive\..*$',
'^viewer_directive\..*$',
]
[tool.ruff]
exclude = ['.git', 'build', 'dist', 'doc/_build', 'doc/examples', 'pycache__']
indent-width = 4
line-length = 99
[tool.ruff.format]
docstring-code-format = true
# From https://numpydoc.readthedocs.io/en/latest/format.html
# Extended discussion: https://github.com/pyvista/pyvista/pull/4129
# The length of docstring lines should be kept to 75 characters to facilitate
# reading the docstrings in text terminals.
docstring-code-line-length = 75
quote-style = 'single'
[tool.ruff.lint]
explicit-preview-rules = true
preview = true
extend-safe-fixes = ['EM']
extend-select = [
'A',
'AIR',
'ANN',
'ARG',
'ASYNC',
'ASYNC1',
'B',
'BLE',
'C4',
'COM',
'D',
'DJ',
'DTZ',
'E',
'EM',
'F',
'FA',
'FBT001',
'FBT002',
'FLY',
'FURB',
'I',
'ICN',
'INP',
'INT',
'ISC',
'LOG',
'N',
'NPY',
'PERF',
'PGH',
'PIE',
'PL',
'PLR0917',
'PT',
'PTH',
'PYI',
'Q',
'RET',
'RSE',
'RUF',
'SIM',
'T10',
'T20',
'TCH',
'TID',
'TRY',
'UP',
'W',
'YTT',
]
fixable = ['ALL']
ignore = [
'ANN002', # Missing annotations for `*args`
'ANN003', # Missing annotations for `*kwargs`
'ANN401', # Disallow `Any`
'B028', # https://github.com/pyvista/pyvista/pull/6030
'B904', # https://github.com/pyvista/pyvista/pull/6022
'COM812', # May cause conflicts when used with the formatter
'D105', # Missing docstring in magic method
'D107', # Missing docstring in `__init__`
'D203', # May conflict with the formatter
'D211', # Incompatible with D203
'D213', # Incompatible with D212
'D402', # First line should not be the function's signature
'D416', # Section name ends in colon
'E402', # module level import not at top of file
'E731', # do not assign a lambda expression, use a def
'E741', # ambiguous variable name
'F403', # 'from module import *' used; unable to detect undefined names
'ISC001', # May cause conflicts when used with the formatter
'N806',
'PERF203', # https://github.com/pyvista/pyvista/pull/6037
'PLR0912', # Too many branches
'PLR0913', # Too many arguments in function definition
'PLR0915', # Too many statements
'PLR2004', # Magic value used in comparison
'Q0', # Quotes (temporary)
'RET505', # https://github.com/pyvista/pyvista/pull/5911
'RET506', # https://github.com/pyvista/pyvista/pull/5911
'RET507', # https://github.com/pyvista/pyvista/pull/5911
'SIM102', # https://github.com/pyvista/pyvista/pull/5877
'SIM117', # https://github.com/pyvista/pyvista/pull/5888
'SIM118', # https://github.com/pyvista/pyvista/pull/5837
'TRY301', # https://github.com/pyvista/pyvista/pull/7572
]
unfixable = ['F401', 'PLC0415']
[tool.ruff.lint.flake8-comprehensions]
allow-dict-calls-with-keyword-arguments = true
[tool.ruff.lint.per-file-ignores]
# TODO: Add annotations to any files with 'ANN' ignores listed below
'__init__.py' = ['PLC0414']
'doc/*' = ['ANN', 'INP', 'PLC0415']
'doc/source/make_tables.py' = [
'D101',
'D102',
'PTH103',
'PTH113',
'PTH118',
'PTH123',
'T20',
]
'examples*' = ['ANN', 'INP', 'PLC0415']
'examples/*' = [
'B015', # https://github.com/pyvista/pyvista/pull/6014
'B018', # https://github.com/pyvista/pyvista/pull/6019
'D102',
'D103',
'D205',
'D212',
'D400',
'D415',
'PLC0415', # https://github.com/pyvista/pyvista/pull/7676
'SIM115',
'T20',
]
'examples/99-advanced/warp_by_vector_eigenmodes.py' = ['N802', 'N803']
'examples_trame/*' = ['D100', 'D103', 'T20']
'examples_trame/tests/*' = ['D']
'pyvista/__init__.py' = ['ANN']
'pyvista/_plot.py' = ['ANN']
'pyvista/conftest.py' = ['ANN']
'pyvista/core/_validation/_cast_array.py' = ['ANN']
'pyvista/core/_validation/validate.py' = ['ANN202']
'pyvista/core/_vtk_core.py' = ['ANN', 'PLC0414']
'pyvista/core/dataobject.py' = ['PLC0415']
'pyvista/core/errors.py' = ['ANN']
'pyvista/core/filters/*' = ['ANN', 'PYI019']
'pyvista/core/objects.py' = ['ANN']
'pyvista/core/partitioned.py' = ['ANN']
'pyvista/core/pointset.py' = ['ANN']
'pyvista/core/utilities/cell.py' = ['ANN']
'pyvista/core/utilities/docs.py' = ['ANN']
'pyvista/core/utilities/features.py' = ['ANN']
'pyvista/core/utilities/geometric_objects.py' = ['N802']
'pyvista/core/utilities/helpers.py' = ['ANN']
'pyvista/core/utilities/image_sources.py' = ['ANN']
'pyvista/core/utilities/observers.py' = ['ANN']
'pyvista/core/utilities/parametric_objects.py' = ['N802']
'pyvista/core/utilities/reader.py' = ['ANN', 'N802']
'pyvista/demos/*' = ['ANN']
'pyvista/errors.py' = ['ANN']
'pyvista/examples*' = ['ANN']
'pyvista/examples/_dataset_loader.py' = [
'PTH112',
'PTH113',
'PTH117',
'PTH118',
'PTH202',
]
'pyvista/examples/cells.py' = ['N802']
'pyvista/ext/*' = ['ANN', 'D100', 'D101', 'D102', 'D103']
'pyvista/jupyter*' = ['ANN']
'pyvista/plotting/_plotting.py' = ['ANN']
'pyvista/plotting/_property.py' = ['ANN']
'pyvista/plotting/_typing.py' = ['PLC0414']
'pyvista/plotting/_vtk*.py' = ['PLC0414']
'pyvista/plotting/actor.py' = ['ANN']
'pyvista/plotting/actor_properties.py' = ['ANN']
'pyvista/plotting/affine_widget.py' = ['ANN']
'pyvista/plotting/axes.py' = ['ANN']
'pyvista/plotting/axes_actor.py' = ['ANN']
'pyvista/plotting/axes_assembly.py' = ['ANN']
'pyvista/plotting/background_renderer.py' = ['ANN']
'pyvista/plotting/camera.py' = ['ANN']
'pyvista/plotting/charts.py' = ['ANN']
'pyvista/plotting/colors.py' = ['ANN']
'pyvista/plotting/composite_mapper.py' = ['ANN']
'pyvista/plotting/cube_axes_actor.py' = ['ANN']
'pyvista/plotting/errors.py' = ['ANN']
'pyvista/plotting/helpers.py' = ['ANN']
'pyvista/plotting/lights.py' = ['ANN']
'pyvista/plotting/lookup_table.py' = ['ANN']
'pyvista/plotting/mapper.py' = ['ANN']
'pyvista/plotting/opts.py' = ['ANN']
'pyvista/plotting/picking.py' = ['ANN']
'pyvista/plotting/plotting/__init__.py' = ['ANN']
'pyvista/plotting/prop3d.py' = ['ANN']
'pyvista/plotting/prop_collection.py' = ['ANN']
'pyvista/plotting/render_passes.py' = ['ANN']
'pyvista/plotting/render_window_interactor.py' = ['ANN']
'pyvista/plotting/renderer.py' = ['ANN', 'PLC0415']
'pyvista/plotting/renderers.py' = ['ANN']
'pyvista/plotting/scalar_bars.py' = ['ANN']
'pyvista/plotting/text.py' = ['ANN']
'pyvista/plotting/texture.py' = ['ANN']
'pyvista/plotting/themes.py' = ['ANN']
'pyvista/plotting/tools.py' = ['ANN']
'pyvista/plotting/utilities/*.py' = ['ANN']
'pyvista/plotting/utilities/algorithms.py' = ['N802', 'N803']
'pyvista/plotting/volume.py' = ['ANN']
'pyvista/plotting/volume_property.py' = ['ANN']
'pyvista/plotting/widgets.py' = ['ANN', 'PLC0415']
'pyvista/report.py' = ['ANN']
'pyvista/trame/*' = ['ANN', 'FBT', 'PLR0917']
'pyvista/utilities/*' = ['ANN', 'F401'] # deprecated modules
'tests/*' = ['ANN', 'D', 'FBT', 'INP', 'PLC0415', 'PLR0917', 'T20']
'tests/examples/test_dataset_loader.py' = [
'PTH102',
'PTH107',
'PTH112',
'PTH113',
'PTH117',
'PTH118',
'PTH119',
]
[tool.ruff.lint.pylint]
max-positional-args = 3
[tool.ruff.lint.isort]
combine-as-imports = true # Combines 'as' imports on the same line
force-single-line = true # https://github.com/pyvista/pyvista/pull/5712
force-sort-within-sections = true # Sort by name, don't cluster 'from' vs 'import'
required-imports = [
'from __future__ import annotations', # https://github.com/pyvista/pyvista/pull/5712
]
[tool.ruff.lint.pyupgrade]
keep-runtime-typing = true # Preserve types, even if a file imports `from __future__ import annotations`.
[tool.repo-review]
ignore = [
'MY101', # to be removed once https://github.com/pyvista/pyvista/issues/6279 is closed
'PC111', # ruff is taking care of docstring formatting https://github.com/pyvista/pyvista/pull/6991
'PC140', # mypy deliberately removed from pre-commit in https://github.com/pyvista/pyvista/pull/6741
'PY004', # we have a 'doc' folder, not 'docs'
'PY007', # tox support
'RTD', # RTD: the documentation is not hosted by ReadTheDocs
]
|