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 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 diff --git a/loop_step/loop.py b/loop_step/loop.py index acf23dd..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 __ @@ -349,8 +348,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 +358,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 +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' 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