From 14fc9550ae9c29441ee0d7ccdae04cbe05777f6b Mon Sep 17 00:00:00 2001 From: Paul Saxe Date: Sat, 30 Jan 2021 13:06:26 -0500 Subject: [PATCH 1/6] Adapted to the new system classes. --- psi4_step/psi4.py | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/psi4_step/psi4.py b/psi4_step/psi4.py index 73927bc..4107c84 100644 --- a/psi4_step/psi4.py +++ b/psi4_step/psi4.py @@ -324,8 +324,9 @@ def run(self): printer.important(self.header) printer.important('') - system = self.get_variable('_system') - n_atoms = system.n_atoms() + system_db = self.get_variable('_system_db') + configuration = system_db.system.configuration + n_atoms = configuration.n_atoms if n_atoms == 0: self.logger.error('Psi4 run(): there is no structure!') raise RuntimeError('Psi4 run(): there is no structure!') @@ -525,7 +526,8 @@ def analyze(self, indent='', **kwargs): with structure_file.open(mode='r') as fd: structure = json.load(fd) if 'geom' in structure: - system = self.get_variable('_system') + system_db = self.get_variable('_system_db') + configuration = system_db.system.configuration xs = [] ys = [] zs = [] @@ -534,9 +536,9 @@ def analyze(self, indent='', **kwargs): xs.append(x) ys.append(next(it)) zs.append(next(it)) - system.atoms['x'][0:] = xs - system.atoms['y'][0:] = ys - system.atoms['z'][0:] = zs + configuration.atoms['x'][0:] = xs + configuration.atoms['y'][0:] = ys + configuration.atoms['z'][0:] = zs printer.important( self.indent + ' Updated the system with the structure from Psi4', @@ -546,7 +548,8 @@ def analyze(self, indent='', **kwargs): def _convert_structure(self, name=None): """Convert the structure to the input for Psi4.""" - system = self.get_variable('_system') + system_db = self.get_variable('_system_db') + configuration = system_db.system.configuration structure = [] if name is None: @@ -555,8 +558,8 @@ def _convert_structure(self, name=None): structure.append('molecule ' + name + ' {') # Charge and multiplicity - if 'extras' in system: - extras = system['extras'] + if False and 'extras' in configuration: + extras = configuration['extras'] if 'open' in extras and extras['open'] is not None: openshell = extras['open'] @@ -584,11 +587,11 @@ def _convert_structure(self, name=None): if 'net_charge' in extras and extras['net_charge'] is not None: structure.append(f" {extras['net_charge']} 1") - elements = system.atoms.symbols() - coordinates = system.atoms.coordinates() + elements = configuration.atoms.symbols + coordinates = configuration.atoms.coordinates - if 'freeze' in system.atoms: - freeze = system.atoms['freeze'] + if 'freeze' in configuration.atoms: + freeze = configuration.atoms['freeze'] else: freeze = [''] * len(elements) From 347a42e3b15f2b4d8de6d538138461d11ea3dc14 Mon Sep 17 00:00:00 2001 From: Paul Saxe Date: Thu, 4 Feb 2021 10:16:47 -0500 Subject: [PATCH 2/6] Updated pinned version numbers --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index dfefe80..7321219 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ psutil==5.7.2 -seamm==2020.12.4 +seamm==2021.2.2 From 75b8a335c554ebf998860cc7114170395df63a76 Mon Sep 17 00:00:00 2001 From: Paul Saxe Date: Thu, 4 Feb 2021 10:18:41 -0500 Subject: [PATCH 3/6] Split the documentation workflow out. --- .github/workflows/Docs.yaml | 40 +++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/Docs.yaml 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 From 67ece61d2a560f3f532fd2990c68f54cc351ff5b Mon Sep 17 00:00:00 2001 From: Paul Saxe Date: Thu, 4 Feb 2021 10:19:07 -0500 Subject: [PATCH 4/6] Split the documentation workflow out. --- .github/workflows/BranchCI.yaml | 8 +------- .github/workflows/CI.yaml | 19 ++++--------------- .github/workflows/Release.yaml | 18 ++++-------------- 3 files changed, 9 insertions(+), 36 deletions(-) diff --git a/.github/workflows/BranchCI.yaml b/.github/workflows/BranchCI.yaml index 42338b6..8442f74 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,5 @@ 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 1a49874..2911b91 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 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 psi4_step tests yapf --diff --recursive psi4_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/Release.yaml b/.github/workflows/Release.yaml index 943dd26..fc0c062 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 psi4_step tests yapf --diff --recursive psi4_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 8bc825c913fafa4861946ad90e7ad2a120f6daf5 Mon Sep 17 00:00:00 2001 From: Paul Saxe Date: Thu, 4 Feb 2021 10:20:26 -0500 Subject: [PATCH 5/6] Updated for the new locations of badges. --- README.rst | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/README.rst b/README.rst index e1e173b..3168ae0 100644 --- a/README.rst +++ b/README.rst @@ -2,30 +2,39 @@ Psi4 Step ========= +.. image:: https://img.shields.io/github/issues-pr-raw/molssi-seamm/psi4_step + :target: https://github.com/molssi-seamm/psi4_step/pulls + :alt: GitHub pull requests -.. image:: https://img.shields.io/travis/molssi-seamm/psi4_step.svg - :target: https://travis-ci.org/molssi-seamm/psi4_step -.. image:: https://pyup.io/repos/github/molssi-seamm/psi4_step/shield.svg - :target: https://pyup.io/repos/github/molssi-seamm/psi4_step/ - :alt: Updates - +.. image:: https://github.com/molssi-seamm/psi4_step/workflows/CI/badge.svg + :target: https://github.com/molssi-seamm/psi4_step/actions + :alt: Build Status .. image:: https://codecov.io/gh/molssi-seamm/psi4_step/branch/master/graph/badge.svg :target: https://codecov.io/gh/molssi-seamm/psi4_step + :alt: Code Coverage + +.. image:: https://img.shields.io/lgtm/grade/python/g/molssi-seamm/psi4_step.svg?logo=lgtm&logoWidth=18 + :target: https://lgtm.com/projects/g/molssi-seamm/psi4_step/context:python + :alt: Code Quality -.. image:: https://readthedocs.org/projects/psi4-step/badge/?version=latest - :target: https://psi4-step.readthedocs.io/en/latest/?badge=latest - :alt: Documentation Status +.. image:: https://github.com/molssi-seamm/psi4_step/workflows/Documentation/badge.svg + :target: https://molssi-seamm.github.io/psi4_step/index.html + :alt: Documentation Status + +.. image:: https://pyup.io/repos/github/molssi-seamm/psi4_step/shield.svg + :target: https://pyup.io/repos/github/molssi-seamm/psi4_step/ + :alt: Updates for Dependencies .. image:: https://img.shields.io/pypi/v/psi4_step.svg :target: https://pypi.python.org/pypi/psi4_step - + :alt: PyPi VERSION A step for Psi4 in a SEAMM flowchart * Free software: BSD-3-Clause -* Documentation: https://psi4-step.readthedocs.io. +* Documentation: https://molssi-seamm.github.io/psi4_step/index.html Features From dd0968e2e32cbfced47c1b75b7753ce614423c4d Mon Sep 17 00:00:00 2001 From: Paul Saxe Date: Thu, 4 Feb 2021 10:42:46 -0500 Subject: [PATCH 6/6] Fixed concerns raised by LGTM. --- psi4_step/psi4.py | 29 +---------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/psi4_step/psi4.py b/psi4_step/psi4.py index 4107c84..4c53179 100644 --- a/psi4_step/psi4.py +++ b/psi4_step/psi4.py @@ -558,34 +558,7 @@ def _convert_structure(self, name=None): structure.append('molecule ' + name + ' {') # Charge and multiplicity - if False and 'extras' in configuration: - extras = configuration['extras'] - - if 'open' in extras and extras['open'] is not None: - openshell = extras['open'] - if ( - ( - isinstance(openshell, tuple) or - isinstance(openshell, list) - ) and len(openshell) > 1 - ): - nopen = openshell[0] - norbitals = openshell[1] - if nopen != norbitals: - raise NotImplementedError( - f"Handling of open shell = '{openshell}'" - ) - else: - nopen = openshell - norbitals = nopen - - if 'net_charge' in extras and extras['net_charge'] is not None: - structure.append(f" {extras['net_charge']} {nopen}") - else: - structure.append(f' 0 {nopen}') - else: - if 'net_charge' in extras and extras['net_charge'] is not None: - structure.append(f" {extras['net_charge']} 1") + # not handled yet!!!! elements = configuration.atoms.symbols coordinates = configuration.atoms.coordinates