Skip to content

Commit

Permalink
update contributing and developer guide
Browse files Browse the repository at this point in the history
  • Loading branch information
naik-aakash committed Dec 3, 2023
1 parent 6393a7b commit 3437c09
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Contributing to lobsterpy
# Contributing to LobsterPy

We would love your input to further extend and improve our code. Contribution of any kind are welcome, for example it can be:

Expand Down
53 changes: 53 additions & 0 deletions docs/dev/dev_installation.md
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
```

3 changes: 2 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ reference/cli
```{toctree}
:caption: Contributing Guide
:hidden:
dev/dev_installation
dev/contributing
```

Expand Down Expand Up @@ -72,7 +73,7 @@ LOBSTER and Lobsterpy via atomate2.


:::{grid-item-card}
:link: dev/contributing
:link: dev/dev_installation
:link-type: doc
:class-header: bg-light
**Developer guide**
Expand Down

0 comments on commit 3437c09

Please sign in to comment.