-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #214 from pybop-team/185-add-pull-request-template
Adds PR Template
- Loading branch information
Showing
7 changed files
with
169 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Description | ||
|
||
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. | ||
|
||
## Issue reference | ||
Fixes # (issue-number) | ||
|
||
## Review | ||
Before you mark your PR as ready for review, please ensure that you've considered the following: | ||
- Updated the [CHANGELOG.md](https://github.com/pybop-team/PyBOP/blob/develop/CHANGELOG.md) in reverse chronological order (newest at the top) with a concise description of the changes, including the PR number. | ||
- Noted any breaking changes, including details on how it might impact existing functionality. | ||
|
||
## Type of change | ||
- [ ] New Feature: A non-breaking change that adds new functionality. | ||
- [ ] Optimization: A code change that improves performance. | ||
- [ ] Bug Fix: A non-breaking change that addresses an issue. | ||
- [ ] Documentation: Updates to documentation or new documentation for new features. | ||
- [ ] Refactoring: Non-functional changes that improve the codebase. | ||
- [ ] Style: Non-functional changes related to code style (formatting, naming, etc). | ||
- [ ] Testing: Additional tests to improve coverage or confirm functionality. | ||
- [ ] Other: (Insert description of change) | ||
|
||
# Key checklist: | ||
|
||
- [ ] No style issues: `$ pre-commit run` (or `$ nox -s pre-commit`) (see [CONTRIBUTING.md](https://github.com/pybop-team/PyBOP/blob/develop/CONTRIBUTING.md#installing-and-using-pre-commit) for how to set this up to run automatically when committing locally, in just two lines of code) | ||
- [ ] All unit tests pass: `$ nox -s tests` | ||
- [ ] The documentation builds: `$ nox -s docs` | ||
|
||
You can run integration tests, unit tests, and doctests together at once, using `$ nox -s quick`. | ||
|
||
## Further checks: | ||
- [ ] Code is well-commented, especially in complex or unclear areas. | ||
- [ ] Added tests that prove my fix is effective or that my feature works. | ||
- [ ] Checked that coverage remains or improves, and added tests if necessary to maintain or increase coverage. | ||
|
||
Thank you for contributing to our project! Your efforts help us to deliver great software. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import sys | ||
import pytest | ||
import shutil | ||
import subprocess | ||
from pathlib import Path | ||
|
||
|
||
class TestDocs: | ||
"""A class to test the PyBOP documentation.""" | ||
|
||
@pytest.mark.docs | ||
def test_docs(self): | ||
""" | ||
Check if the documentation can be built and run any doctests (currently not used). | ||
Credit: PyBaMM Team | ||
""" | ||
print("Checking if docs can be built.") | ||
docs_path = Path("docs") | ||
build_path = docs_path / "_build" / "html" | ||
|
||
try: | ||
subprocess.run( | ||
[ | ||
"sphinx-build", | ||
"-j", | ||
"auto", | ||
"-b", | ||
"html", | ||
str(docs_path), | ||
str(build_path), | ||
"--keep-going", | ||
], | ||
check=True, | ||
capture_output=True, | ||
) | ||
except subprocess.CalledProcessError as e: | ||
print(f"FAILED with exit code {e.returncode}") | ||
print(f"stdout: {e.stdout.decode()}") | ||
print(f"stderr: {e.stderr.decode()}") | ||
sys.exit(e.returncode) | ||
finally: | ||
# Regardless of whether the doctests pass or fail, attempt to remove the built files. | ||
print("Deleting built files.") | ||
try: | ||
shutil.rmtree(build_path) | ||
except Exception as e: | ||
print(f"Error deleting built files: {e}") |