-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update contributing and developer guide
- Loading branch information
1 parent
6393a7b
commit 3437c09
Showing
3 changed files
with
56 additions
and
2 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
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,53 @@ | ||
# Developer Installation | ||
|
||
Install Lobsterpy from source, by cloning the repository from [github](https://github.com/JaGeo/LobsterPy.git) | ||
|
||
```bash | ||
git clone https://github.com/JaGeo/LobsterPy.git | ||
cd LobsterPy | ||
pip install -e .[featurizer,docs,tests,dev] | ||
``` | ||
This will install LobsterPy will all dependencies for tests, pre-commit and docs building. | ||
|
||
## Running unit tests | ||
|
||
Unit tests can be run from the source folder using `pytest`. | ||
|
||
```bash | ||
pytest | ||
``` | ||
This will run all the tests. | ||
|
||
To get a detailed report of test coverage you can use following command | ||
```bash | ||
pytest --cov=lobsterpy --cov-report term-missing --cov-append | ||
``` | ||
|
||
If you feel test execution takes too long locally, you can speedup the execution using [pytest-xdist](https://pypi.org/project/pytest-xdist/). Install this in library in your environment using | ||
|
||
```bash | ||
pip install pytest-xdist | ||
``` | ||
|
||
Once installed, you can now use multiple processors to run your tests. For example, if you want to use 8 processors to run tests in parallel, run | ||
|
||
```bash | ||
pytest -n 8 | ||
``` | ||
|
||
We rely on pytest-split to run tests in parallel on github workflow, thus it is necessary to update the test-durations files in the repo, incase you add new tests. To generate this file, use | ||
|
||
```bash | ||
pytest --cov=lobsterpy --cov-append --splits 1 --group 1 --durations-path ./tests/test_data/.pytest-split-durations --store-durations | ||
``` | ||
|
||
## Building the documentation locally | ||
|
||
The atomate2 documentation can be built using the sphinx package. | ||
|
||
The docs can be built to the `_build` directory: | ||
|
||
```bash | ||
sphinx-build -W docs _build | ||
``` | ||
|
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