Skip to content

Commit

Permalink
fix: update use of openbabel (#39)
Browse files Browse the repository at this point in the history
* fix: update use of openbabel

* Update push.yml

* Update tox.ini

* Update tox.ini
  • Loading branch information
njzjz authored Jan 3, 2020
1 parent 4c74c81 commit 3d76bb2
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 20 deletions.
18 changes: 15 additions & 3 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,21 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Tox
uses: njzjz/actions/tox-conda@master
- uses: actions/setup-python@v1
with:
python-version: '3.7'
architecture: 'x64'
- run: pip install tox-conda
- run: git clone --depth 1 https://github.com/circulosmeos/gdown.pl
working-directory: /home/runner/work
- run: ./gdown.pl/gdown.pl $GAUSSIANURL "g16.tgz">/dev/null 2>&1
env:
GAUSSIANURL: ${{ secrets.GAUSSIANURL }}
working-directory: /home/runner/work
- run: tar -xzvf g16.tgz
working-directory: /home/runner/work
- run: tox
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
GAUSSIANURL: ${{ secrets.GAUSSIANURL }}
g16root: /home/runner/work
10 changes: 5 additions & 5 deletions aimdfragmentation/frag.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,12 @@ def _readpdb(self):
conv.SetInAndOutFormats('xyz', 'pdb')
mol = openbabel.OBMol()
conv.ReadFile(mol, self.xyzfilename)
pdbstring = conv.WriteString(mol)
bond = [[] for x in range(self._natom)]
for line in pdbstring.split('\n'):
if line.startswith("CONECT"):
s = line.split()
bond[int(s[1])-1] += [int(x)-1 for x in s[2:]]
for b in openbabel.OBMolBondIter(mol):
s1 = b.GetBeginAtom().GetId()
s2 = b.GetEndAtom().GetId()
bond[s1].append(s2)
bond[s2].append(s1)
# connect molecules
self._mols = connectmolecule(bond)

Expand Down
11 changes: 3 additions & 8 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,18 @@
# Automated Fragmentation AIMD Calculation

[![DOI:10.26434/chemrxiv.11462160](https://zenodo.org/badge/DOI/10.1039/C9CP05091D.svg)](https://doi.org/10.26434/chemrxiv.11462160)
[![python version](https://img.shields.io/pypi/pyversions/aimdfragmentation.svg?logo=python&logoColor=white)](https://pypi.org/project/aimdfragmentation)
[![PyPI](https://img.shields.io/pypi/v/aimdfragmentation.svg)](https://pypi.org/project/aimdfragmentation)
[![Build Status](https://travis-ci.com/njzjz/aimdfragmentation.svg?branch=master)](https://travis-ci.com/njzjz/aimdfragmentation)
[![Coverage Status](https://coveralls.io/repos/github/njzjz/aimdfragmentation/badge.svg?branch=master)](https://coveralls.io/github/njzjz/aimdfragmentation?branch=master)
[![codecov](https://codecov.io/gh/njzjz/aimdfragmentation/branch/master/graph/badge.svg)](https://codecov.io/gh/njzjz/aimdfragmentation)

A automated fragmentation method for Ab Initio Molecular Dynamics (AIMD).

Combustion Driven by Fragment-based Ab Initio Molecular Dynamics Simulation, DOI: 10.26434/chemrxiv.11462160

**Author**: Jinzhe Zeng

**Email**: [email protected]

## Requirements
* [OpenBabel](https://github.com/openbabel/openbabel)
* [numpy](https://github.com/numpy/numpy)
* [ASE](https://gitlab.com/ase/ase)
* [GaussianRunner](https://github.com/njzjz/GaussianRunner)

## Installation

### Using pip
Expand Down
8 changes: 4 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ envlist = py37

[testenv]
extras = test
passenv = GAUSS_* CI TRAVIS TRAVIS_* CODECOV_* *_TOKEN
passenv = GAUSS_* CI TRAVIS TRAVIS_* CODECOV_* *_TOKEN g16root
deps =
coveralls
codecov>=1.4.0
codacy-coverage
conda_deps=
openbabel
c-compiler
cxx-compiler
conda_channels=
conda-forge
whitelist_externals =
bash
commands =
pytest --pyargs aimdfragmentation --cov {envsitepackagesdir}/aimdfragmentation -s
bash -c "source $g16root/g16/bsd/g16.profile; pytest --pyargs aimdfragmentation --cov {envsitepackagesdir}/aimdfragmentation -s"
- coveralls
- codecov
- python-codacy-coverage -r coverage.xml

0 comments on commit 3d76bb2

Please sign in to comment.