We absolutely welcome contributions and we hope that this guide will facilitate an understanding of the PyVista code repository. It is important to note that the PyVista software package is maintained on a volunteer basis and thus we need to foster a community that can support user questions and develop new features to make this software a useful tool for all users.
This page is dedicated to outline where you should start with your question, concern, feature request, or desire to contribute.
Cloning the Source Repository
You can clone the source repository from
and install the latest version by running:
git clone https://github.com/pyvista/pyvista.git cd pyvista python -m pip install -e .
For general questions about the project, its applications, or about software usage, please create a discussion in the Discussions repository where the community can collectively address your questions. You are also welcome to join us on Slack or send one of the developers an email. The project support team can be reached at firstname.lastname@example.org
For more technical questions, you are welcome to create an issue on the issues page which we will address promptly. Through posting on the issues page, your question can be addressed by community members with the needed expertise and the information gained will remain available on the issues page for other users.
If you stumble across any bugs, crashes, or concerning quirks while using code distributed here, please report it on the issues page with an appropriate label so we can promptly address it. When reporting an issue, please be overly descriptive so that we may reproduce it. Whenever possible, please provide tracebacks, screenshots, and sample files to help us address the issue.
We encourage users to submit ideas for improvements to PyVista code base! Please create an issue on the issues page with a Feature Request label to suggest an improvement. Please use a descriptive title and provide ample background information to help the community implement that functionality. For example, if you would like a reader for a specific file format, please provide a link to documentation of that file format and possibly provide some sample files with screenshots to work with. We will use the issue thread as a place to discuss and provide feedback.
Contributing New Code
If you have an idea for how to improve PyVista, please first create an issue as a feature request which we can use as a discussion thread to work through how to implement the contribution.
Once you are ready to start coding and develop for PyVista, please see the Development Practices section for more details.
All contributed code will be licensed under The MIT License found in the repository. If you did not write the code yourself, it is your responsibility to ensure that the existing license is compatible and included in the contributed files or you can obtain permission from the original author to relicense the code.
This section provides a guide to how we conduct development in the PyVista repository. Please follow the practices outlined here when contributing directly to this repository.
Through direct access to the Visualization Toolkit (VTK) via direct array access and intuitive Python properties, we hope to make the entire VTK library easily accessible to researchers of all disciplines. To further PyVista towards being the de facto Python interface to VTK, we need your help to make it even better!
If you want to add one or two interesting analysis algorithms as filters, implement a new plotting routine, or just fix 1-2 typos - your efforts are welcome!
There are three general coding paradigms that we believe in:
Make it intuitive. PyVista's goal is to create an intuitive and easy to use interface back to the VTK library. Any new features should have intuitive naming conventions and explicit keyword arguments for users to make the bulk of the library accessible to novice users.
Document everything! At the least, include a docstring for any method or class added. Do not describe what you are doing but why you are doing it and provide a simple example for the new features.
Keep it tested. We aim for a high test coverage. See testing for more details.
There are two important copyright guidelines:
Please do not include any data sets for which a license is not available or commercial use is prohibited. Those can undermine the license of the whole projects.
Do not use code snippets for which a license is not available (e.g. from stackoverflow) or commercial use is prohibited. Those can undermine the license of the whole projects.
Please also take a look at our Code of Conduct
Contributing to pyvista through GitHub
To submit new code to pyvista, first fork the pyvista GitHub Repo and then clone the forked repository to your computer. Then, create a new branch based on the Branch Naming Conventions Section in your local repository.
Next, add your new feature and commit it locally. Be sure to commit frequently as it is often helpful to revert to past commits, especially if your change is complex. Also, be sure to test often. See the Testing Section below for automating testing.
When you are ready to submit your code, create a pull request by following the steps in the Creating a New Pull Request section.
We adhere to PEP 8 wherever possible, except that line widths are permitted to go beyond 79 characters to a max of 99 characters for code. This should tend to be the exception rather than the norm.
As for docstrings, follow the guidelines specified in PEP 8 Maximum Line Length of limiting docstrings to 72 characters per line. This follows the directive:
Some teams strongly prefer a longer line length. For code maintained exclusively or primarily by a team that can reach agreement on this issue, it is okay to increase the line length limit up to 99 characters, provided that comments and docstrings are still wrapped at 72 characters.
Outside of PEP 8, when coding please consider PEP 20 -- The Zen of Python. When in doubt:
Branch Naming Conventions
To streamline development, we have the following requirements for naming branches. These requirements help the core developers know what kind of changes any given branch is introducing before looking at the code.
fix/: any bug fixes, patches, or experimental changes that are minor
feat/: any changes that introduce a new feature or significant addition
junk/: for any experimental changes that can be deleted if gone stale
maint/: for general maintenance of the repository or CI routines
doc/: for any changes only pertaining to documentation
no-ci/: for low impact activity that should NOT trigger the CI routines
testing/: improvements or changes to testing
release/: releases (see below)
After making changes, please test changes locally before creating a pull request. The following tests will be executed after any commit or pull request, so we ask that you perform the following sequence locally to track down any new issues from your changes.
To run our comprehensive suite of unit tests, install all the dependencies
pip install -r requirements_test.txt pip install -r requirements_docs.txt pip install -r requirements_style.txt
Then, if you have everything installed, you can run the various test suites.
Run the primary test suite and generate coverage report:
python -m pytest -v --cov pyvista
Unit testing can take some time, if you wish to speed it up, set the
number of processors with the
-n flag. This uses
to leverage multiple processes. Example usage:
python -m pytest -n <NUMCORE> --cov pyvista
Run all code examples in the docstrings. Be sure to export the
PYVISTA_OFF_SCREEN environmental variable to enable off-screen
export PYVISTA_OFF_SCREEN=True python -m pytest -v --doctest-modules pyvista
Run documentation testing by running:
If you are running windows and
make is unavailable, then run:
pydocstyle pyvista codespell pyvista/ examples/ tests/ -S "*.pyc,*.txt,*.gif,*.png,*.jpg,*.ply,*.vtk,*.vti,*.js,*.html,*.doctree,*.ttf,*.woff,*.woff2,*.eot,*.mp4,*.inv,*.pickle,*.ipynb,flycheck*" -I "ignore_words.txt"
And finally, test the documentation examples:
cd doc make clean make doctest make html -b linkcheck
The finished documentation can be found in the
Creating a New Pull Request
Once you have tested your branch locally, create a pull request on pyvista GitHub while merging to master. This will automatically run continuous integration (CI) testing and verify your changes will work across several platforms.
To ensure someone else reviews your code, at least one other member of the pyvista contributors group must review and verify your code meets our community's standards. Once approved, if you have write permission you may merge the branch. If you don't have write permission, the reviewer or someone else with write permission will merge the branch and delete the PR branch.
Since it may be necessary to merge your branch with the current
release branch (see below), please do not delete your branch if it
This project has a branching model that enables rapid development of features without sacrificing stability, and closely follows the Trunk Based Development approach.
The main features of our branching model are:
masterbranch is the main development branch. All features, patches, and other branches should be merged here. While all PRs should pass all applicable CI checks, this branch may be functionally unstable as changes might have introduced unintended side-effects or bugs that were not caught through unit testing.
- There will be one or many
release/branches based on minor releases (for example
release/0.24) which contain a stable version of the code base that is also reflected on PyPI/. Hotfixes from
fix/branches should be merged both to master and to these branches. When necessary to create a new patch release these release branches will have their
__version__.pyupdated and be tagged with a patched semantic version (e.g.
0.24.1). This triggers CI to push to PyPI, and allow us to rapidly push hotfixes for past versions of
pyvistawithout having to worry about untested features.
- When a minor release candidate is ready, a new
releasebranch will be created from
masterwith the next incremented minor version (e.g.
release/0.25), which will be thoroughly tested. When deemed stable, the release branch will be tagged with the version (
0.25.0in this case), and if necessary merged with master if any changes were pushed to it. Feature development then continues on
masterand any hotfixes will now be merged with this release. Older release branches should not be deleted so they can be patched as needed.
Minor Release Steps
Minor releases are feature and bug releases that improve the
functionality and stability of
pyvista. Before a minor release is
created the following will occur:
Create a new branch from the
masterbranch with name
Locally run all tests as outlined in the Testing Section and ensure all are passing.
Locally test and build the documentation with link checking to make sure no links are outdated. Be sure to run
make cleanto ensure no results are cached.
cd doc make clean # deletes the sphinx-gallery cache make doctest make html -b linkcheck
After building the documentation, open the local build and examine the examples gallery for any obvious issues.
Update the version numbers in
pyvista/_version.pyand commit it. Push the branch to GitHub and create a new PR for this release that merges it to master. Development to master should be limited at this point while effort is focused on the release.
It is now the responsibility of the
pyvistacommunity to functionally test the new release. It is best to locally install this branch and use it in production. Any bugs identified should have their hotfixes pushed to this release branch.
When the branch is deemed as stable for public release, the PR will be merged to master and the
masterbranch will be tagged with a
MAJOR.MINOR.0release. The release branch will not be deleted. Tag the release with:
git tag MAJOR.MINOR.0 git push origin --tags
Create a list of all changes for the release. It is often helpful to leverage GitHub's compare feature to see the differences from the last tag and the
masterbranch. Be sure to acknowledge new contributors by their GitHub username and place mentions where appropriate if a specific contributor is to thank for a new feature.
Place your release notes from step 8 in the description for the new release on GitHub
Announce the new release in the PyVista Slack workspace and celebrate!
Patch Release Steps
Patch releases are for critical and important bugfixes that can not or should not wait until a minor release. The steps for a patch release
Push the necessary bugfix(es) to the applicable release branch. This will generally be the latest release branch (e.g.
__version__.pywith the next patch increment (e.g.
0.25.1), commit it, and open a PR that merge with the release branch. This gives the
pyvistacommunity a chance to validate and approve the bugfix release. Any additional hotfixes should be outside of this PR.
When approved, merge with the release branch, but not
masteras there is no reason to increment the version of the
masterbranch. Then create a tag from the release branch with the applicable version number (see above for the correct steps).
If deemed necessary, create a release notes page. Also, open the PR from conda and follow the directions in step 10 in the minor release section.