Skip to content

Commit

Permalink
Merge pull request #7 from ltalirz/release_v1.0.0a1
Browse files Browse the repository at this point in the history
Release v1.0.0a1
  • Loading branch information
ltalirz committed Apr 10, 2019
2 parents db6a836 + 85a8b37 commit 0f10bf2
Show file tree
Hide file tree
Showing 24 changed files with 616 additions and 617 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -9,3 +9,5 @@
.coverage
dist/
build/
.vscode
.pytest_cache/
7 changes: 7 additions & 0 deletions .travis-data/install_aiida_github.sh
@@ -0,0 +1,7 @@
#!/bin/bash
# don't want aiida-core to mess with folders in the repo
git clone https://github.com/aiidateam/aiida_core ../aiida_core
cd ../aiida_core
git checkout $AIIDA_DEVELOP_GIT_HASH
pip install -e .[docs,pre-commit,testing]
cd ${TRAVIS_BUILD_DIR}
86 changes: 62 additions & 24 deletions .travis.yml
@@ -1,31 +1,23 @@
language: python
python:
- "3.6"
- "2.7"

cache: pip

services:
- postgresql
- postgresql
- rabbitmq

addons:
postgresql: "9.5"

before_install:
# Upgrade pip setuptools and wheel
- pip install -U pip wheel setuptools

install:
- pip install -e .[testing,docs,pre-commit]
- reentry scan -r aiida
- pip install coveralls
# add fake eqeq & egulp executables
- cat "#!/bin/bash\necho 'eqeq'" > eqeq; chmod +x eqeq
- cat "#!/bin/bash\necho 'egulp'" > egulp; chmod +x egulp
postgresql: "10"

env:
global:
# add eqeq executable to PATH
- PATH=${PATH}:${TRAVIS_BUILD_DIR}
- AIIDA_VERSION: develop
- AIIDA_DEVELOP_GIT_HASH: 409a90d7c8ac8f26792c0f0fbc1f8567f2feb89a
# add network executable to PATH
#- PATH=${PATH}:${TRAVIS_BUILD_DIR}
# add fake executables to path
- PATH: "${PATH}:${TRAVIS_BUILD_DIR}/.travis-data"
matrix:
- TEST_AIIDA_BACKEND: django
TEST_TYPE: tests
Expand All @@ -36,17 +28,63 @@ env:
READTHEDOCS: 'True'
- TEST_AIIDA_BACKEND: django
TEST_TYPE: pre-commit

# Remove this to enforce the AiiDA coding style
allow_failures:
- TEST_AIIDA_BACKEND: django
TEST_TYPE: pre-commit

before_install:
# Upgrade pip setuptools and wheel
- pip install -U wheel setuptools coveralls
- pip install pip==18.1
# add fake eqeq & egulp executables
- cat "#!/bin/bash\necho 'eqeq'" > eqeq; chmod +x eqeq
- cat "#!/bin/bash\necho 'egulp'" > egulp; chmod +x egulp

install:
- if [ "$AIIDA_VERSION" == "develop" ]; then .travis-data/install_aiida_github.sh ; fi # installs develop branch
- pip install -e .[testing,pre-commit]
- reentry scan -r aiida

script:
- if [ "$TEST_TYPE" == "tests" ] ; then coverage run --append manage.py; fi # runs unit tests
- if [ "$TEST_TYPE" == "docs" ] ; then cd docs; make; fi # creates documentation
# runs precommit checks but doesn't fail if they don't pass
- if [ "$TEST_TYPE" == "pre-commit" ] ; then pre-commit install; pre-commit run --all-files || ( git status --short; git diff ; exit 1 ); fi
- if [ "$TEST_TYPE" == "tests" ] ; then py.test --cov aiida_qeq --cov-append . ; fi # runs unit tests
- if [ "$TEST_TYPE" == "pre-commit" ] ; then pre-commit install; pre-commit run --all-files || ( git status --short; git diff ; exit 1 ); fi
- if [ "$TEST_TYPE" == "docs" ] ; then cd docs; make; fi # creates documentation

after_success:
- coveralls
- coveralls

jobs:
include:
- stage: deploy
# Make sure the tag is valid semver
if: "tag =~ ^v[0-9]+\\.[0-9]+\\.[0-9]+(a|b|rc)?[0-9]*$"
services: ignore
addons: skip
python: 3.6
before_install: skip
install: skip
before_script: skip
script: skip
env: ignore
before_deploy:
- echo "About to deploy $TRAVIS_TAG to PyPI"
after_deploy:
- echo "Deployed $TRAVIS_TAG to PyPI"
deploy: &pypi
provider: pypi
skip_existing: true
username: aiida-bot
password:
# Instructions:
# - create deploy bot account on PyPI
# - add bot account to your PyPI project
# - Install travis cli tool, see https://docs.travis-ci.com/user/encryption-keys/
# - cd to your git repository; travis login --org
# - travis encrypt <pw of bot account>
secure: "H4X2KnMOSsfu7arD7k/VCoJiSeIRnjikup23M0A200vckbDnlE57meNz3q8eCK5Ljch9uKEBiPIMH1E+tFdzbvGgtAcPc+yr1vFa3jOcQqIKxerXBcvU44X8PP83VhZT+MRBA2EP4UlWeNnSBE8Z5EGkwBRBXJDYj0W9sk8y9p0e29n0P9uqlzCr6V/13z5qymkjbrunvj3PAlIuwmtixelWWaWVDN4rT1EI8Ep0kR5l7M4H4rdnUhivLJKOSZGFjR0RMi/URoED/ar85BKCzUCxOPuKJ2X0519LS1Bjb0w4CnbwOsIVJ187iq/cPH+vEQhsrStdoo/qrHzLu3RzfcXrJ6JOq6jtPi2r+P8/dlrqJHEtZsklY22eYGNDl9oiVERrc64Va2L8RO1cQjo7pSAPb2xSomVQi8ickXpuOcuciu8YeXsVsN2MPkGirTTKFmwDVWZ1NM+RRNlf1RuEqRohtziKsSMR6tbkh4UEWRN36JDFXRjEJGMIsm2U/SZVbVjCHWjZ5YZ6B1QUXPVkonIa/BojrNHSdNUi8hcG3cfgDcZnstQ48wHTDJQljBbmd+0iAH2DBZzWpqjlmV+2JO+gbYtyYe9GQvnMC77tnqVl0evI8X6SyDkRg15A1WkmxoGcTx4aQgB8blkK5XTxDJOOBTj3WDiCv3+JEiCYnrk="
on:
repo: ltalirz/aiida-qeq
branch: master
tags: true
84 changes: 70 additions & 14 deletions README.md
@@ -1,6 +1,6 @@
[![Build Status](https://travis-ci.org/ltalirz/aiida-qeq.svg?branch=master)](https://travis-ci.org/ltalirz/aiida-qeq)
[![Coverage Status](https://coveralls.io/repos/github/ltalirz/aiida-qeq/badge.svg?branch=master)](https://coveralls.io/github/ltalirz/aiida-qeq?branch=master)
[![Docs status](https://readthedocs.org/projects/aiida-qeq/badge)](http://aiida-qeq.readthedocs.io/)
[![Build Status](https://travis-ci.org/ltalirz/aiida-qeq.svg?branch=master)](https://travis-ci.org/ltalirz/aiida-qeq)
[![Coverage Status](https://coveralls.io/repos/github/ltalirz/aiida-qeq/badge.svg?branch=master)](https://coveralls.io/github/ltalirz/aiida-qeq?branch=master)
[![Docs status](https://readthedocs.org/projects/aiida-qeq/badge)](http://aiida-qeq.readthedocs.io/)
[![PyPI version](https://badge.fury.io/py/aiida-qeq.svg)](https://badge.fury.io/py/aiida-qeq)

# aiida-qeq
Expand All @@ -9,14 +9,69 @@ AiiDA plugin for computing electronic charges on atoms using equilibration-type

Templated using the [AiiDA plugin cutter](https://github.com/aiidateam/aiida-plugin-cutter).

## Features

### QeQ charges
* Add input structure in CIF format
```python
CifData = DataFactory('cif')
inputs['structure'] = CifData(file='/path/to/file')
```

* Add parameters for electronegativity and Idempotential data of the elements.
```python
SinglefileData = DataFactory('singlefile')
inputs['parameters'] = SinglefileData(file='/path/to/file')
```

* (optional) Specify `configure.input` options using a python dictionary and `QeqParameters`
```python
QeqParameters = DataFactory('qeq.qeq')
inputs['configure'] = QeqParameters(dict={'save_grid': [True, 'grid.cube']})
```

* `QeqParameters` validates the command line options using [voluptuous](https://github.com/alecthomas/voluptuous).
```python
QeqParameters = DataFactory('qeq.qeq')
print(QeqParameters.schema) # shows supported options
```

### EQeQ charges
* Add input structure in CIF format
```python
CifData = DataFactory('cif')
inputs['structure'] = CifData(file='/path/to/file')
```

* Add parameters for ionization data of the elements.
```python
SinglefileData = DataFactory('singlefile')
inputs['ionization_data'] = SinglefileData(file='/path/to/file')
```

* Add parameters for common oxidation states of the elements.
```python
SinglefileData = DataFactory('singlefile')
inputs['charge_data'] = SinglefileData(file='/path/to/file')
```

* Specify command line options using a python dictionary and `EQeqParameters`
```python
EQeqParameters = DataFactory('qeq.eqeq')
inputs['parameters'] = EQeqParameters(dict={'method': 'ewald'})
```

* `EQeqParameters` validates the command line options using [voluptuous](https://github.com/alecthomas/voluptuous).
```python
QeqParameters = DataFactory('qeq.eqeq')
print(EQeqParameters.schema) # show supported options
```

## Installation

```shell
git clone https://github.com/ltalirz/aiida-qeq .
cd aiida-qeq
pip install -e . # also installs aiida, if missing (but not postgres)
#pip install -e .[pre-commit,testing] # install extras for more features
verdi quicksetup # better to set up a new profile
pip install aiida-qeq
verdi quicksetup # set up a new profile
verdi calculation plugins # should now show your calclulation plugins
```

Expand All @@ -30,15 +85,17 @@ verdi daemon start # make sure the daemon is running
cd examples
verdi run submit_qeq.py # submit qeq test calculation
verdi run submit_eqeq.py # submit eqeq test calculation
verdi calculation list -a # check status of calculation
verdi process list -a # check status of calculation
```

## Tests
## Development

The following will discover and run all unit test:
```shell
pip install -e .[testing]
python manage.py
git clone https://github.com/ltalirz/aiida-qeq .
cd aiida-qeq
pip install -e .[pre-commit,testing]
pre-commit install # enable pre-commit hooks
pytest # run unit tests
```

## License
Expand All @@ -49,4 +106,3 @@ MIT
## Contact

leopold.talirz@gmail.com

2 changes: 1 addition & 1 deletion aiida_qeq/__init__.py
Expand Up @@ -4,4 +4,4 @@
AiiDA plugin for computing electronic charges on atoms using equilibration-type models (QEq, EQEq, ...).
"""

__version__ = "0.1.0"
__version__ = "1.0.0a1"

0 comments on commit 0f10bf2

Please sign in to comment.