-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update repo config against
aiida-core v2.5
- Loading branch information
1 parent
c9d6962
commit 7466b79
Showing
38 changed files
with
353 additions
and
1,137 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
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 |
---|---|---|
@@ -1,39 +1,67 @@ | ||
# Install pre-commit hooks via: | ||
# pre-commit install | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.4.0 | ||
hooks: | ||
- id: end-of-file-fixer | ||
- id: mixed-line-ending | ||
- id: trailing-whitespace | ||
- id: check-json | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.5.0 | ||
hooks: | ||
- id: end-of-file-fixer | ||
- id: trailing-whitespace | ||
- id: check-merge-conflict | ||
- id: check-yaml | ||
- id: check-json | ||
- id: fix-encoding-pragma | ||
args: [--remove] | ||
- id: mixed-line-ending | ||
args: [--fix=lf] | ||
|
||
- repo: https://github.com/asottile/pyupgrade | ||
rev: v3.3.1 | ||
hooks: | ||
- id: pyupgrade | ||
args: ["--py37-plus"] | ||
- repo: https://github.com/asottile/pyupgrade | ||
rev: v3.15.0 | ||
hooks: | ||
- id: pyupgrade | ||
args: [--py37-plus] | ||
|
||
- repo: https://github.com/PyCQA/isort | ||
rev: 5.12.0 | ||
hooks: | ||
- id: isort | ||
- repo: https://github.com/ikamensh/flynt/ | ||
rev: 1.0.1 | ||
hooks: | ||
- id: flynt | ||
args: [--line-length=120, --fail-on-change] | ||
|
||
- repo: https://github.com/psf/black | ||
rev: 22.12.0 | ||
hooks: | ||
- id: black | ||
- repo: https://github.com/executablebooks/mdformat | ||
rev: "0.7.16" | ||
hooks: | ||
- id: mdformat | ||
|
||
- repo: local | ||
hooks: | ||
- id: pylint | ||
language: system | ||
types: [file, python] | ||
name: pylint | ||
description: "This hook runs the pylint static code analyzer" | ||
exclude: &exclude_files > | ||
(?x)^( | ||
docs/.*| | ||
)$ | ||
entry: pylint | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.1.13 | ||
hooks: | ||
- id: ruff-format | ||
- id: ruff | ||
args: [--fix, --exit-non-zero-on-fix, --show-fixes] | ||
|
||
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks | ||
rev: v2.12.0 | ||
hooks: | ||
- id: pretty-format-toml | ||
args: [--autofix] | ||
exclude: >- | ||
(?x)^( | ||
pyproject.toml | ||
)$ | ||
- id: pretty-format-yaml | ||
args: [--autofix, --preserve-quotes, --offset, "2"] | ||
exclude: >- | ||
(?x)^( | ||
tests/.*| | ||
environment.yml | ||
)$ | ||
- repo: https://github.com/pre-commit/mirrors-mypy | ||
rev: v1.8.0 | ||
hooks: | ||
- id: mypy | ||
args: [--config-file=pyproject.toml] | ||
exclude: &exclude_files > | ||
(?x)^( | ||
docs/.*| | ||
tests/.*(?<!\.py)$ | ||
)$ |
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 |
---|---|---|
@@ -1,7 +1,6 @@ | ||
version: 2 | ||
|
||
python: | ||
version: "3.8" | ||
install: | ||
- method: pip | ||
path: . | ||
|
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 |
---|---|---|
|
@@ -13,91 +13,50 @@ intended to help developers get started with their AiiDA plugins. | |
|
||
## Repository contents | ||
|
||
* [`.github/`](.github/): [Github Actions](https://github.com/features/actions) configuration | ||
* [`ci.yml`](.github/workflows/ci.yml): runs tests, checks test coverage and builds documentation at every new commit | ||
* [`publish-on-pypi.yml`](.github/workflows/publish-on-pypi.yml): automatically deploy git tags to PyPI - just generate a [PyPI API token](https://pypi.org/help/#apitoken) for your PyPI account and add it to the `pypi_token` secret of your github repository | ||
* [`aiida_quantum_transport/`](aiida_quantum_transport/): The main source code of the plugin package | ||
* [`data/`](aiida_quantum_transport/data/): A new `DiffParameters` data class, used as input to the `DiffCalculation` `CalcJob` class | ||
* [`calculations.py`](aiida_quantum_transport/calculations.py): A new `DiffCalculation` `CalcJob` class | ||
* [`cli.py`](aiida_quantum_transport/cli.py): Extensions of the `verdi data` command line interface for the `DiffParameters` class | ||
* [`helpers.py`](aiida_quantum_transport/helpers.py): Helpers for setting up an AiiDA code for `diff` automatically | ||
* [`parsers.py`](aiida_quantum_transport/parsers.py): A new `Parser` for the `DiffCalculation` | ||
* [`docs/`](docs/): A documentation template ready for publication on [Read the Docs](http://aiida-diff.readthedocs.io/en/latest/) | ||
* [`examples/`](examples/): An example of how to submit a calculation using this plugin | ||
* [`tests/`](tests/): Basic regression tests using the [pytest](https://docs.pytest.org/en/latest/) framework (submitting a calculation, ...). Install `pip install -e .[testing]` and run `pytest`. | ||
* [`.gitignore`](.gitignore): Telling git which files to ignore | ||
* [`.pre-commit-config.yaml`](.pre-commit-config.yaml): Configuration of [pre-commit hooks](https://pre-commit.com/) that sanitize coding style and check for syntax errors. Enable via `pip install -e .[pre-commit] && pre-commit install` | ||
* [`.readthedocs.yml`](.readthedocs.yml): Configuration of documentation build for [Read the Docs](https://readthedocs.org/) | ||
* [`LICENSE`](LICENSE): License for your plugin | ||
* [`README.md`](README.md): This file | ||
* [`conftest.py`](conftest.py): Configuration of fixtures for [pytest](https://docs.pytest.org/en/latest/) | ||
* [`pyproject.toml`](setup.json): Python package metadata for registration on [PyPI](https://pypi.org/) and the [AiiDA plugin registry](https://aiidateam.github.io/aiida-registry/) (including entry points) | ||
|
||
See also the following video sequences from the 2019-05 AiiDA tutorial: | ||
|
||
* [run aiida-diff example calculation](https://www.youtube.com/watch?v=2CxiuiA1uVs&t=403s) | ||
* [aiida-diff CalcJob plugin](https://www.youtube.com/watch?v=2CxiuiA1uVs&t=685s) | ||
* [aiida-diff Parser plugin](https://www.youtube.com/watch?v=2CxiuiA1uVs&t=936s) | ||
* [aiida-diff computer/code helpers](https://www.youtube.com/watch?v=2CxiuiA1uVs&t=1238s) | ||
* [aiida-diff input data (with validation)](https://www.youtube.com/watch?v=2CxiuiA1uVs&t=1353s) | ||
* [aiida-diff cli](https://www.youtube.com/watch?v=2CxiuiA1uVs&t=1621s) | ||
* [aiida-diff tests](https://www.youtube.com/watch?v=2CxiuiA1uVs&t=1931s) | ||
* [Adding your plugin to the registry](https://www.youtube.com/watch?v=760O2lDB-TM&t=112s) | ||
* [pre-commit hooks](https://www.youtube.com/watch?v=760O2lDB-TM&t=333s) | ||
|
||
For more information, see the [developer guide](https://aiida-diff.readthedocs.io/en/latest/developer_guide) of your plugin. | ||
|
||
- [`.github/`](.github/): [Github Actions](https://github.com/features/actions) configuration | ||
- [`ci.yml`](.github/workflows/ci.yml): runs tests, checks test coverage and builds documentation at every new commit | ||
- [`publish-on-pypi.yml`](.github/workflows/publish-on-pypi.yml): automatically deploy git tags to PyPI - just generate a [PyPI API token](https://pypi.org/help/#apitoken) for your PyPI account and add it to the `pypi_token` secret of your github repository | ||
- [`src/aiida_quantum_transport/`](src/aiida_quantum_transport/): The main source code of the plugin package | ||
- [`data/`](src/aiida_quantum_transport/data/): Custom data classes | ||
- [`calculations.py`](src/aiida_quantum_transport/calculations.py): Quantum Transport AiiDA calculation classes | ||
- [`cli.py`](src/aiida_quantum_transport/cli.py): Custom `verdi` CLI commands | ||
- [`helpers.py`](src/aiida_quantum_transport/helpers.py): Helpers for setting up an AiiDA code | ||
- [`parsers.py`](src/aiida_quantum_transport/parsers.py): Custom parser classes | ||
- [`docs/`](docs/): The documentation of the plugin | ||
- [`tests/`](tests/): Basic regression tests using the [pytest](https://docs.pytest.org/en/latest/) framework (submitting a calculation, ...). Install `pip install -e .[testing]` and run `pytest`. | ||
- [`conftest.py`](tests/conftest.py): Configuration of fixtures for [pytest](https://docs.pytest.org/en/latest/) | ||
- [`.gitignore`](.gitignore): Telling git which files to ignore | ||
- [`.pre-commit-config.yaml`](.pre-commit-config.yaml): Configuration of [pre-commit hooks](https://pre-commit.com/) that sanitize coding style and check for syntax errors. Enable via `pip install -e .[pre-commit] && pre-commit install` | ||
- [`.readthedocs.yml`](.readthedocs.yml): Configuration of documentation build for [Read the Docs](https://readthedocs.org/) | ||
- [`LICENSE`](LICENSE): License for your plugin | ||
- [`README.md`](README.md): This file | ||
- [`pyproject.toml`](setup.json): Python package metadata for registration on [PyPI](https://pypi.org/) and the [AiiDA plugin registry](https://aiidateam.github.io/aiida-registry/) (including entry points) | ||
|
||
## Features | ||
|
||
* Add input files using `SinglefileData`: | ||
```python | ||
SinglefileData = DataFactory('singlefile') | ||
inputs['file1'] = SinglefileData(file='/path/to/file1') | ||
inputs['file2'] = SinglefileData(file='/path/to/file2') | ||
``` | ||
|
||
* Specify command line options via a python dictionary and `DiffParameters`: | ||
```python | ||
d = { 'ignore-case': True } | ||
DiffParameters = DataFactory('quantum_transport') | ||
inputs['parameters'] = DiffParameters(dict=d) | ||
``` | ||
|
||
* `DiffParameters` dictionaries are validated using [voluptuous](https://github.com/alecthomas/voluptuous). | ||
Find out about supported options: | ||
```python | ||
DiffParameters = DataFactory('quantum_transport') | ||
print(DiffParameters.schema.schema) | ||
``` | ||
Under development | ||
|
||
## Installation | ||
|
||
```shell | ||
pip install aiida-quantum-transport | ||
verdi quicksetup # better to set up a new profile | ||
verdi plugin list aiida.calculations # should now show your calclulation plugins | ||
verdi quicksetup | ||
verdi plugin list aiida.calculations | ||
``` | ||
|
||
|
||
## Usage | ||
|
||
Here goes a complete example of how to submit a test calculation using this plugin. | ||
|
||
A quick demo of how to submit a calculation: | ||
|
||
```shell | ||
verdi daemon start # make sure the daemon is running | ||
cd examples | ||
./example_01.py # run test calculation | ||
verdi process list -a # check record of calculation | ||
``` | ||
|
||
The plugin also includes verdi commands to inspect its data types: | ||
```shell | ||
verdi data quantum_transport list | ||
verdi data quantum_transport export <PK> | ||
``` | ||
|
||
## Development | ||
|
||
```shell | ||
|
@@ -114,11 +73,11 @@ See the [developer guide](http://aiida-quantum-transport.readthedocs.io/en/lates | |
## License | ||
|
||
MIT | ||
|
||
## Contact | ||
|
||
[email protected] | ||
|
||
|
||
[ci-badge]: https://github.com/edan-bainglass/aiida-quantum-transport/workflows/ci/badge.svg?branch=master | ||
[ci-link]: https://github.com/edan-bainglass/aiida-quantum-transport/actions | ||
[cov-badge]: https://coveralls.io/repos/github/edan-bainglass/aiida-quantum-transport/badge.svg?branch=master | ||
|
Oops, something went wrong.