From 3505d251c39c66189f24f74914ef92e84a3333a5 Mon Sep 17 00:00:00 2001 From: Paul Saxe Date: Sat, 30 Jan 2021 13:02:29 -0500 Subject: [PATCH 1/5] Adapted to the new system classes. --- loop_step/loop.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/loop_step/loop.py b/loop_step/loop.py index acf23dd..66e1c58 100644 --- a/loop_step/loop.py +++ b/loop_step/loop.py @@ -349,8 +349,9 @@ 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}', @@ -358,7 +359,7 @@ def write_final_structure(self): ) 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' @@ -371,14 +372,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' From 2754b58896f7552531a20b6b4d222ff87b26c868 Mon Sep 17 00:00:00 2001 From: Paul Saxe Date: Thu, 4 Feb 2021 09:17:10 -0500 Subject: [PATCH 2/5] Updated pinned version numbers --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 4cd9794..f2a6725 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ -seamm==2020.12.4 +seamm==2021.2.2 From 2abb47e3d579940d2c3351d95950c8a7390fa765 Mon Sep 17 00:00:00 2001 From: Paul Saxe Date: Thu, 4 Feb 2021 09:20:14 -0500 Subject: [PATCH 3/5] Split the documentation workflow out. --- .github/workflows/BranchCI.yaml | 8 ------- .github/workflows/CI.yaml | 19 ++++------------ .github/workflows/Docs.yaml | 40 +++++++++++++++++++++++++++++++++ .github/workflows/Release.yaml | 18 ++++----------- 4 files changed, 48 insertions(+), 37 deletions(-) create mode 100644 .github/workflows/Docs.yaml diff --git a/.github/workflows/BranchCI.yaml b/.github/workflows/BranchCI.yaml index c562e15..df641a4 100644 --- a/.github/workflows/BranchCI.yaml +++ b/.github/workflows/BranchCI.yaml @@ -4,7 +4,6 @@ on: push: branches-ignore: - 'main' - - 'master' jobs: light-ci: @@ -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 - diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index 5f7c135..a393b89 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -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 @@ -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] diff --git a/.github/workflows/Docs.yaml b/.github/workflows/Docs.yaml new file mode 100644 index 0000000..6929b4f --- /dev/null +++ b/.github/workflows/Docs.yaml @@ -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 diff --git a/.github/workflows/Release.yaml b/.github/workflows/Release.yaml index f47d7ee..17ae21b 100644 --- a/.github/workflows/Release.yaml +++ b/.github/workflows/Release.yaml @@ -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 @@ -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] @@ -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 From 1df62decd43dc6b3632bfae20f7e877f38604e13 Mon Sep 17 00:00:00 2001 From: Paul Saxe Date: Thu, 4 Feb 2021 09:21:19 -0500 Subject: [PATCH 4/5] Updated for the new locations of badges. --- README.rst | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/README.rst b/README.rst index 8739808..c75536a 100644 --- a/README.rst +++ b/README.rst @@ -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 From 002e6db5426122c7e3ca370518a45c6d777daff8 Mon Sep 17 00:00:00 2001 From: Paul Saxe Date: Thu, 4 Feb 2021 09:22:20 -0500 Subject: [PATCH 5/5] Fixed concerns raised by LGTM. --- loop_step/loop.py | 1 - 1 file changed, 1 deletion(-) diff --git a/loop_step/loop.py b/loop_step/loop.py index 66e1c58..dd86c6e 100644 --- a/loop_step/loop.py +++ b/loop_step/loop.py @@ -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 __