Skip to content

Commit

Permalink
Merge pull request #16 from molssi-seamm/system2
Browse files Browse the repository at this point in the history
Updated to be compatible with the new system classes.
  • Loading branch information
paulsaxe authored Feb 4, 2021
2 parents 8bb5854 + 002e6db commit afa442c
Show file tree
Hide file tree
Showing 7 changed files with 76 additions and 56 deletions.
8 changes: 0 additions & 8 deletions .github/workflows/BranchCI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
branches-ignore:
- 'main'
- 'master'

jobs:
light-ci:
Expand Down Expand Up @@ -51,10 +50,3 @@ jobs:
file: ./coverage.xml
flags: unittests
name: codecov-ubuntu-latest-py3.8
- name: Build documentation
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash -l {0}
run: |
docs/buildDocs.sh
19 changes: 4 additions & 15 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
@@ -1,26 +1,21 @@
name: CI

on:
# GitHub has started calling new repo's first branch "main" https://github.com/github/renaming
# Existing codes likely still have "master" as the primary branch
# Both are tracked here to keep legacy and new codes working
push:
branches:
- "master"
- "main"
pull_request:
branches:
- "master"
- "main"
schedule:
# Run on master by default Sunday morning at 3:30:
# Run on main by default Sunday morning at 3:30:
# Scheduled workflows run on the latest commit on the default or base branch.
# (from https://help.github.com/en/actions/reference/events-that-trigger-workflows#scheduled-events-schedule)
- cron: "30 3 * * 0"

jobs:
lint-docs:
name: Lint-Docs ubuntu-latest Py3.8
lint:
name: Lint ubuntu-latest Py3.8
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
Expand Down Expand Up @@ -53,17 +48,11 @@ jobs:
run: |
flake8 loop_step tests
yapf --diff --recursive loop_step tests
- name: Build documentation
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash -l {0}
run: |
docs/buildDocs.sh
test:
name: Test ${{ matrix.os }} Py${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
needs: lint-docs
needs: lint
strategy:
matrix:
os: [macOS-latest, ubuntu-latest, windows-latest]
Expand Down
40 changes: 40 additions & 0 deletions .github/workflows/Docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Documentation

on: push

jobs:
docs:
name: Docs ubuntu-latest Py3.8
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
with:
# This gets all branches (1 = only current branch)
fetch-depth: 0
- name: Additional info about the build
shell: bash
run: |
uname -a
df -h
ulimit -a
# More info on options: https://github.com/conda-incubator/setup-miniconda
- uses: conda-incubator/setup-miniconda@v2
with:
python-version: 3.8
environment-file: devtools/conda-envs/test_env.yaml
activate-environment: test
auto-update-conda: false
auto-activate-base: false
show-channel-urls: true
- name: Install package
# conda setup requires this special shell
shell: bash -l {0}
run: |
python -m pip install . --no-deps
conda list
- name: Build documentation
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash -l {0}
run: |
docs/buildDocs.sh
18 changes: 4 additions & 14 deletions .github/workflows/Release.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
name: Release

on:
# GitHub has started calling new repo's first branch "main" https://github.com/github/renaming
# Existing codes likely still have "master" as the primary branch
# Both are tracked here to keep legacy and new codes working
release:
types: [published]
branches:
- "master"
- "main"

jobs:
lint-docs:
name: Lint-Docs ubuntu-latest Py3.8
lint:
name: Lint ubuntu-latest Py3.8
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
Expand Down Expand Up @@ -45,17 +41,11 @@ jobs:
run: |
flake8 loop_step tests
yapf --diff --recursive loop_step tests
- name: Build documentation
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash -l {0}
run: |
docs/buildDocs.sh
test:
name: Test ${{ matrix.os }} Py${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
needs: lint-docs
needs: lint
strategy:
matrix:
os: [macOS-latest, ubuntu-latest, windows-latest]
Expand Down Expand Up @@ -98,7 +88,7 @@ jobs:
# only to test.pypi, otherwise to both it and the main pypi.
if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags')
runs-on: ubuntu-latest
needs: [lint-docs, test]
needs: [lint, test]
steps:
- uses: actions/checkout@v1
- name: Set up Python 3.8
Expand Down
33 changes: 21 additions & 12 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,33 @@
Loop Step
=========

.. image:: https://img.shields.io/github/issues-pr-raw/molssi-seamm/loop_step
:target: https://github.com/molssi-seamm/loop_step/pulls
:alt: GitHub pull requests

.. image:: https://img.shields.io/pypi/v/loop_step.svg
:target: https://pypi.python.org/pypi/loop_step
.. image:: https://github.com/molssi-seamm/loop_step/workflows/CI/badge.svg
:target: https://github.com/molssi-seamm/loop_step/actions
:alt: Build Status

.. image:: https://img.shields.io/travis/molssi-seamm/loop_step.svg
:target: https://travis-ci.org/molssi-seamm/loop_step
.. image:: https://codecov.io/gh/molssi-seamm/loop_step/branch/master/graph/badge.svg
:target: https://codecov.io/gh/molssi-seamm/loop_step
:alt: Code Coverage

.. image:: https://readthedocs.org/projects/loop-step/badge/?version=latest
:target: https://loop-step.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status
.. image:: https://img.shields.io/lgtm/grade/python/g/molssi-seamm/loop_step.svg?logo=lgtm&logoWidth=18
:target: https://lgtm.com/projects/g/molssi-seamm/loop_step/context:python
:alt: Code Quality

.. image:: https://pyup.io/repos/github/molssi-seamm/loop_step/shield.svg
:target: https://pyup.io/repos/github/molssi-seamm/loop_step/
:alt: Updates
.. image:: https://github.com/molssi-seamm/loop_step/workflows/Documentation/badge.svg
:target: https://molssi-seamm.github.io/loop_step/index.html
:alt: Documentation Status

.. image:: https://codecov.io/gh/molssi-seamm/loop_step/branch/master/graph/badge.svg
:target: https://codecov.io/gh/molssi-seamm/loop_step
.. image:: https://pyup.io/repos/github/molssi-seamm/loop_step/shield.svg
:target: https://pyup.io/repos/github/molssi-seamm/loop_step/
:alt: Updates for Dependencies

.. image:: https://img.shields.io/pypi/v/loop_step.svg
:target: https://pypi.python.org/pypi/loop_step
:alt: PyPi VERSION

Handle various type of loops in a SEAMM Flowchart

Expand Down
12 changes: 6 additions & 6 deletions loop_step/loop.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import loop_step
import seamm
from seamm_util import ureg, Q_, units_class # noqa: F401
import seamm_util.printing as printing
from seamm_util.printing import FormattedText as __

Expand Down Expand Up @@ -349,16 +348,17 @@ def run(self):

def write_final_structure(self):
"""Write the final structure"""
system = self.get_variable('_system')
if system.n_atoms() > 0:
system_db = self.get_variable('_system_db')
configuration = system_db.system.configuration
if configuration.n_atoms > 0:
# MMCIF file has bonds
filename = os.path.join(
self.directory, f'iter_{self._loop_value}',
'final_structure.mmcif'
)
text = None
try:
text = system.to_mmcif_text()
text = configuration.to_mmcif_text()
except Exception:
message = (
'Error creating the mmcif file at the end of the loop\n\n'
Expand All @@ -371,14 +371,14 @@ def write_final_structure(self):
print(text, file=fd)

# CIF file has cell
if system.periodicity == 3:
if configuration.periodicity == 3:
filename = os.path.join(
self.directory, f'iter_{self._loop_value}',
'final_structure.cif'
)
text = None
try:
text = system.to_cif_text()
text = configuration.to_cif_text()
except Exception:
message = (
'Error creating the cif file at the end of the loop'
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
seamm==2020.12.4
seamm==2021.2.2

0 comments on commit afa442c

Please sign in to comment.