Skip to content

Commit a3e8636

Browse files
committed
update readme and contributing
1 parent 490fee9 commit a3e8636

File tree

2 files changed

+143
-6
lines changed

2 files changed

+143
-6
lines changed

CONTRIBUTING.md

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
# Contributing
2+
3+
<!-- TOC -->
4+
5+
- [Installation and Development](#install)
6+
- [Running Tests](#tests)
7+
- [Test Coverage](#test-coverage)
8+
- [Coding Style](#codestyle)
9+
- [PR Submission](#pr)
10+
- [Documentation](#documentation)
11+
12+
## Installation and Development<a name="install"></a>
13+
14+
Clone from github:
15+
```bash
16+
git clone https://github.com/aced-differentiate/auto_cat.git
17+
```
18+
19+
Create a virtual environment;
20+
one option is to use conda, but it is not required:
21+
```bash
22+
conda create -n <env_name> python=3.9
23+
conda activate <env_name>
24+
```
25+
26+
Then install requirements from within the cloned `AutoCat` directory:
27+
```bash
28+
pip install -U -r requirements.txt
29+
pip install -U -r test_requirements.txt
30+
pip install --no-deps -e .
31+
```
32+
33+
### Running tests<a name="tests"></a>
34+
We use [pytest](https://docs.pytest.org/en/stable/contents.html) to run tests.
35+
To run all tests:
36+
```bash
37+
pytest -svv
38+
```
39+
40+
### Test coverage<a name="test-coverage"></a>
41+
42+
We use [pytest-cov](https://pytest-cov.readthedocs.io/en/latest) to check
43+
code coverage.
44+
To run all tests and output a report of the coverage of the `src` directory:
45+
```bash
46+
pytest --cov=src/ --cov-report term-missing -svv
47+
```
48+
49+
## Coding Style<a name="codestyle"></a>
50+
51+
`AutoCat` follows [PEP8](https://www.python.org/dev/peps/pep-0008/), with
52+
several docstring rules relaxed.
53+
See `tox.ini` for a list of the ignored rules.
54+
Docstrings must follow the
55+
[Numpy style](https://numpydoc.readthedocs.io/en/latest/format.html).
56+
57+
We use [flake8](https://flake8.pycqa.org/en/latest/) as a linter.
58+
To run the linter on the `src` directory:
59+
```bash
60+
flake8 src
61+
```
62+
63+
A pre-commit hook is available to auto-format code with
64+
[black](https://black.readthedocs.io/en/stable) (recommended):
65+
66+
1. Make sure you are using a Python version >=3.9
67+
2. Install black: ``$ pip install black``
68+
3. Install pre-commit: ``$ pip install pre-commit``
69+
4. Intall git hooks in your ``.git`` directory: ``$ pre-commit install``
70+
71+
Names for functions, arguments, classes, and methods should be as descriptive as possible,
72+
even if it means making them a little longer. For example, `generate_surface_structures` is
73+
a preferred function name to `gen_surfs`.
74+
All class names should adhere to [upper CamelCase](https://en.wikipedia.org/wiki/Camel_case).
75+
76+
## PR Submission<a name="pr"></a>
77+
78+
All PRs must be submitted to the `develop` branch (either fork or clone).
79+
Releases will be from the `master` branch.
80+
81+
In order to be merged, a PR must be approved by one authorized user and the
82+
build must pass.
83+
A passing build requires the following:
84+
* All tests pass
85+
* The linter finds no violations of PEP8 style (not including the exceptions in `tox.ini`)
86+
* Every line of code is executed by a test (100% coverage)
87+
* Documentation has been updated or extended (as needed) and builds
88+
89+
PR descriptions should describe the motivation and context of the code changes in the PR,
90+
both for the reviewer and also for future developers. If there's a Github issue, the PR should
91+
be linked to the issue to provide that context.
92+
93+
## Documentation<a name="documentation"></a>
94+
`AutoCat` documentation is built using `mkdocs` via
95+
[`mkdocs-material`](https://squidfunk.github.io/mkdocs-material/)
96+
and
97+
[`mkdocstrings`](https://mkdocstrings.github.io/).
98+
All custom documentation should be written as `.md` files, appropriately placed within
99+
`docs/`, and referenced within the `mkdocs.yml` file.
100+
101+
With `mkdocs` the docs webpage can be hosted locally with the command:
102+
```bash
103+
mkdocs serve
104+
```
105+
which will give an `html` link that can be pasted in a web-browser.
106+
107+
API documentation is automatically generated with `mkdocstrings` which parses the docstrings.
108+
Please ensure that all docstrings follow the Numpy style.

README.md

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,38 @@
1-
# autocat
2-
Tools for automated structure generation of catalyst systems.
1+
# AutoCat
32

4-
Currently writes out all structures as ASE trajectory files which may be read using ASE as follows:
5-
```python
6-
from ase.io import read
3+
AutoCat is a suite of python tools for **sequential learning for materials applications**
4+
and **automating structure generation for DFT catalysis studies.**
75

8-
sys = read('name_of_traj.traj')
6+
Development of this package stems from [ACED](https://www.cmu.edu/aced/), as part of the
7+
ARPA-E DIFFERENTIATE program.
8+
9+
## Installation
10+
11+
There are two options for installation, either via `pip` or from the repo directly.
12+
13+
### `pip` (recommended)
14+
15+
If you are planning on strictly using AutoCat rather than contributing to development,
16+
we recommend using `pip` within a virtual environment (e.g.
17+
[`conda`](https://docs.conda.io/en/latest/)
18+
). This can be done
19+
as follows:
20+
21+
```
22+
pip install autocat
23+
```
24+
25+
### Github (for developers)
26+
27+
Alternatively, if you would like to contribute to the development of this software,
28+
AutoCat can be installed via a clone from Github. First, you'll need to clone the
29+
github repo to your local machine (or wherever you'd like to use AutoCat) using
30+
`git clone`. Once the repo has been cloned, you can install AutoCat as an editable
31+
package by changing into the created directory (the one with `setup.py`) and installing
32+
via:
33+
```
34+
pip install -e .
935
```
36+
## Contributing
37+
Contributions through issues, feature requests, and pull requests are welcome.
38+
Guidelines are provided [here](CONTRIBUTING.MD).

0 commit comments

Comments
 (0)