Skip to content

Commit

Permalink
Merge pull request #40 from naik-aakash/main
Browse files Browse the repository at this point in the history
Update general guidelines
  • Loading branch information
JaGeo authored Feb 24, 2024
2 parents 53beb88 + 07dba3e commit c13e744
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,29 @@

Software for automated fitting and benchmarking of ML potentials.

Contributions are welcome. Please raise a pull request for contributions first. At least one person has to review the code. At the beginning, Janine will take care of the reviews.
Contributions are welcome. Please raise a pull request for contributions first. At least one person has to review the code. In the beginning, Janine will take care of the reviews.

# General Code Structure
- We are currently aiming to follow the code structure below for each submodule (This is an initial idea; of course, this could change depending on the needs in the future)
- autoplex/submodule/job.py (any jobs defined will be inside this module)
- autoplex/submodule/flows.py (workflows defined will be hosted in this module)
- autoplex/submodule/utils.py (all functions that act as utilities for defining flow or job, for example, a small subtask to calculate some metric or plotting, will be hosted in this module)

# General guidelines
- variable names should be descriptive and should use snake case.
- please use numpy docstrings (use an IDE and switch on thise docstring type; you can check examples in our code base; the doctring should be useful for other people)
- please write unit tests (testing will be performed with pytest; please look into tests for examples)
- If you define a Maker use python class naming convention (eg: PhononMaker, RssMaker)
- please use numpy docstrings (use an IDE and switch on this docstring type; you can check examples in our code base; the doctring should be useful for other people)
- ensure type hints are added for each variable, function, class, and method (helps code readability)
- write the code in a way that users can also have control to change parameters (mainly applicable, for example, fitting protocols/ flows. In other words, avoid hardcoding. Defaults should be set, but with the possibility to modify them where required.)
- please write unit tests. (testing will be performed with pytest; please look into tests for examples)
- please ensure high coverage of the code based on the tests (you can test this with `coverage`)

# Commit guidelines
1. `pip install pre-commit`.
2. Next, run `pre-commit install` (this will install all the hooks from pre-commit-config.yaml)
3. Step 1 and 2, needs to be done only once in the local repository
4. Procced with modifying the code and add commits as usual.
3. Step 1 and 2 needs to be done only once in the local repository
4. Procced with modifying the code and adding commits as usual. This should automatically run the linters.
5. To manually run the pre-commit hooks on all files, just use `pre-commit run --all-files`
6. To run pre-commit on a specific file, use `pre-commit run --files path/to/your/modified/module/`

Please check out atomate2 for example code (https://github.com/materialsproject/atomate2)

0 comments on commit c13e744

Please sign in to comment.