From 866cdb58da851b0c7e635e5f68dc8b33c5c7fe6e Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 12 Feb 2024 21:28:19 +0000 Subject: [PATCH 01/43] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/psf/black: 24.1.1 → 24.2.0](https://github.com/psf/black/compare/24.1.1...24.2.0) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9035f09..8366b81 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,7 +6,7 @@ repos: - id: end-of-file-fixer - id: trailing-whitespace - repo: https://github.com/psf/black - rev: 24.1.1 + rev: 24.2.0 hooks: - id: black args: [--line-length=80] From c791c351663e69e8e38721ef2881c49040cc5edb Mon Sep 17 00:00:00 2001 From: Marjan Albooyeh Date: Tue, 27 Feb 2024 12:12:21 -0700 Subject: [PATCH 02/43] pin freud version --- environment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/environment.yml b/environment.yml index 8973c9e..0f2a500 100644 --- a/environment.yml +++ b/environment.yml @@ -5,7 +5,7 @@ dependencies: - python=3.10 - numpy - ele - - freud>=2.13.1 + - freud =2.13.2 - gsd>=3.0 - jupyterlab - mbuild From 48b6006085a2d982e623d0a38b373b53190439ae Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 18 Mar 2024 19:22:09 +0000 Subject: [PATCH 03/43] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/psf/black: 24.2.0 → 24.3.0](https://github.com/psf/black/compare/24.2.0...24.3.0) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8366b81..8907bd1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,7 +6,7 @@ repos: - id: end-of-file-fixer - id: trailing-whitespace - repo: https://github.com/psf/black - rev: 24.2.0 + rev: 24.3.0 hooks: - id: black args: [--line-length=80] From 8034d736e4d01cb0c94215e799fd2d78e2fdba2e Mon Sep 17 00:00:00 2001 From: chrisjonesBSU Date: Wed, 27 Mar 2024 12:27:47 -0600 Subject: [PATCH 04/43] change param name for showing ports --- grits/coarsegrain.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/grits/coarsegrain.py b/grits/coarsegrain.py index 28e3d72..8ff2847 100644 --- a/grits/coarsegrain.py +++ b/grits/coarsegrain.py @@ -362,7 +362,7 @@ def visualize( if atom_names: atomistic.save( os.path.join(tmp_dir, "atomistic_tmp.mol2"), - show_ports=show_ports, + include_ports=show_ports, overwrite=True, ) @@ -397,7 +397,7 @@ def visualize( simplefilter("ignore") coarse.save( os.path.join(tmp_dir, "coarse_tmp.mol2"), - show_ports=show_ports, + include_ports=show_ports, overwrite=True, ) with open(os.path.join(tmp_dir, "coarse_tmp.mol2"), "r") as f: From 8f1a9c58d02b1b2de36461b8cc2c08c2c441372b Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 8 Apr 2024 19:33:02 +0000 Subject: [PATCH 05/43] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/pre-commit-hooks: v4.5.0 → v4.6.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.5.0...v4.6.0) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8907bd1..b2b4258 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 + rev: v4.6.0 hooks: - id: check-yaml - id: end-of-file-fixer From c8d57aac5178faaa9483611ca7b6acc92862f21b Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 15 Apr 2024 19:28:12 +0000 Subject: [PATCH 06/43] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/psf/black: 24.3.0 → 24.4.0](https://github.com/psf/black/compare/24.3.0...24.4.0) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b2b4258..db2ad02 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,7 +6,7 @@ repos: - id: end-of-file-fixer - id: trailing-whitespace - repo: https://github.com/psf/black - rev: 24.3.0 + rev: 24.4.0 hooks: - id: black args: [--line-length=80] From 0b0cd0ff796c7da73a5d84affb7d1ca2510e07f6 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 29 Apr 2024 19:32:07 +0000 Subject: [PATCH 07/43] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/psf/black: 24.4.0 → 24.4.2](https://github.com/psf/black/compare/24.4.0...24.4.2) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index db2ad02..f9c9a32 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,7 +6,7 @@ repos: - id: end-of-file-fixer - id: trailing-whitespace - repo: https://github.com/psf/black - rev: 24.4.0 + rev: 24.4.2 hooks: - id: black args: [--line-length=80] From 552fdc9563c63d9ca672ca984f2390da4f2f26dc Mon Sep 17 00:00:00 2001 From: chrisjonesbsu Date: Wed, 1 May 2024 09:31:12 -0600 Subject: [PATCH 08/43] add stride parameter when saving a CG trajectory --- grits/coarsegrain.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/grits/coarsegrain.py b/grits/coarsegrain.py index 8ff2847..d43718e 100644 --- a/grits/coarsegrain.py +++ b/grits/coarsegrain.py @@ -667,7 +667,7 @@ def save_mapping(self, filename): json.dump(self.mapping, f, cls=NumpyEncoder) print(f"Mapping saved to {filename}") - def save(self, cg_gsdfile, start=0, stop=None): + def save(self, cg_gsdfile, start=0, stop=None, stride=1): """Save the coarse-grain system to a gsd file. Does not calculate the image of the coarse-grain bead. @@ -688,6 +688,8 @@ def save(self, cg_gsdfile, start=0, stop=None): stop : int, default None Where to stop reading the gsd trajectory the system was created with. If None, will stop at the last frame. + stride : int, default 1 + The step size to use when iterating through start:stop """ typeid = [] types = [i.split("...")[0] for i in self.mapping] @@ -722,7 +724,7 @@ def save(self, cg_gsdfile, start=0, stop=None): ) as old: # stop being None is fine; slicing [0:None] gives whole array, # even in edge case where there's only one or two frames - for s in old[start:stop]: + for s in old[start:stop:stride]: new_snap = gsd.hoomd.Frame() position = [] mass = [] From c3ba3cc99b3de30b00bf700561815e0a7916f0f7 Mon Sep 17 00:00:00 2001 From: chrisjonesBSU Date: Wed, 1 May 2024 10:37:02 -0600 Subject: [PATCH 09/43] add test for stride --- grits/tests/test_coarsegrain.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/grits/tests/test_coarsegrain.py b/grits/tests/test_coarsegrain.py index cfd34b6..bfaad63 100644 --- a/grits/tests/test_coarsegrain.py +++ b/grits/tests/test_coarsegrain.py @@ -213,6 +213,22 @@ def test_benzene(self, tmp_path): cg_json = tmp_path / "cg-benzene.json" system.save_mapping(cg_json) + def test_stride(self, tmp_path): + gsdfile = path.join(asset_dir, "benzene-aa.gsd") + system = CG_System( + gsdfile, + beads={"_B": "c1ccccc1"}, + conversion_dict=amber_dict, + mass_scale=12.011, + ) + assert isinstance(system.mapping, dict) + assert len(system.mapping["_B...c1ccccc1"]) == 20 + + cg_gsd = tmp_path / "cg-benzene.gsd" + system.save(cg_gsdfile=cg_gsd, start=0, stop=-1, stride=2) + with gsd.hoomd.open(cg_gsd) as f: + assert len(f) == 3 + def test_anisobenzene(self, tmp_path): gsdfile = path.join(asset_dir, "benzene-aa.gsd") system = CG_System( From 95b1fc34209def527122b7208b94211ae495bf30 Mon Sep 17 00:00:00 2001 From: chrisjonesBSU Date: Wed, 1 May 2024 10:44:08 -0600 Subject: [PATCH 10/43] remove copied over stuff from another unit test --- grits/tests/test_coarsegrain.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/grits/tests/test_coarsegrain.py b/grits/tests/test_coarsegrain.py index bfaad63..534f471 100644 --- a/grits/tests/test_coarsegrain.py +++ b/grits/tests/test_coarsegrain.py @@ -221,9 +221,6 @@ def test_stride(self, tmp_path): conversion_dict=amber_dict, mass_scale=12.011, ) - assert isinstance(system.mapping, dict) - assert len(system.mapping["_B...c1ccccc1"]) == 20 - cg_gsd = tmp_path / "cg-benzene.gsd" system.save(cg_gsdfile=cg_gsd, start=0, stop=-1, stride=2) with gsd.hoomd.open(cg_gsd) as f: From 374a1debce2c07bb9b040b73b80f806ce5ef4b85 Mon Sep 17 00:00:00 2001 From: Jenny Fothergill Date: Wed, 1 May 2024 11:30:30 -0600 Subject: [PATCH 11/43] Add cmeutils to docs env --- docs/environment-docs.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/environment-docs.yml b/docs/environment-docs.yml index 6659b67..9348d11 100644 --- a/docs/environment-docs.yml +++ b/docs/environment-docs.yml @@ -7,6 +7,7 @@ dependencies: - numpydoc - sphinx - sphinx_rtd_theme + - cmeutils - ele - freud - gsd From 9e536512001d844d233da37501ebbb0e913d2cd5 Mon Sep 17 00:00:00 2001 From: Jenny Fothergill Date: Wed, 1 May 2024 11:43:41 -0600 Subject: [PATCH 12/43] Pin mbuild version --- docs/environment-docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/environment-docs.yml b/docs/environment-docs.yml index 9348d11..4cb83ae 100644 --- a/docs/environment-docs.yml +++ b/docs/environment-docs.yml @@ -11,6 +11,6 @@ dependencies: - ele - freud - gsd - - mbuild + - mbuild>=0.17 - numpy - openbabel From d0c581691f93e77d2831228527ca82738d42ef0b Mon Sep 17 00:00:00 2001 From: Jenny <39961845+jennyfothergill@users.noreply.github.com> Date: Wed, 1 May 2024 11:56:57 -0600 Subject: [PATCH 13/43] Add docs badge --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 75a7e30..4669fa6 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ [![Docker Repository on Quay](https://quay.io/repository/cmelab/grits/status "Docker Repository on Quay")](https://quay.io/repository/cmelab/grits) [![pytest](https://github.com/cmelab/grits/actions/workflows/pytest.yml/badge.svg)](https://github.com/cmelab/grits/actions/workflows/pytest.yml) [![codecov](https://codecov.io/gh/cmelab/grits/branch/main/graph/badge.svg?token=lGG8Zf65HP)](https://codecov.io/gh/cmelab/grits) +[![Documentation Status](https://readthedocs.org/projects/grits/badge/?version=latest)](https://grits.readthedocs.io/en/latest/?badge=latest) ![GRiTS workflow](/.github/grits.png) From dbb141bb1daae182b415028fd2520e327ab6d02f Mon Sep 17 00:00:00 2001 From: Jenny Fothergill Date: Fri, 3 May 2024 11:14:02 -0600 Subject: [PATCH 14/43] Add docker builder shoutout to @mikemhenry and using https://github.com/OpenFreeEnergy/openfe/blob/main/.github/workflows/docker.yaml as example --- .github/workflows/build.yml | 78 +++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..88f9775 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,78 @@ +name: build + +env: + REGISTRY: ghcr.io + IMAGE_NAME: cmelab/grits + DOCKERFILE: containers/dockerfile_cpu + +on: + push: + branches: [ main ] + # Run when container or environment is changed + paths: + - ${{ env.DOCKERFILE }} + # Allows workflow to be manually triggered + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@main + with: + fetch-depth: 0 + + - name: Get Latest Version + id: latest-version + run: | + LATEST_TAG=$(git describe --tags $(git rev-list --tags --max-count=1)) + echo $LATEST_TAG + echo "LATEST_TAG=$LATEST_TAG" >> $GITHUB_OUTPUT + # slice off the v, ie v0.7.2 -> 0.7.2 + VERSION=${LATEST_TAG:1} + echo $VERSION + echo "VERSION=$VERSION" >> $GITHUB_OUTPUT + + - name: Print Latest Version + run: echo ${{ steps.latest-version.outputs.VERSION }} + + - name: Create fully qualified image registry path + id: fqirp + run: | + FQIRP=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.latest-version.outputs.VERSION }} + echo "FQIRP=$FQIRP" >> $GITHUB_OUTPUT + + - name: Print FQIRP + run: echo ${{ steps.fqirp.outputs.FQIRP }} + + - name: Login to GitHub Container Registry + uses: docker/login-action@v1 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and export to Docker + uses: docker/build-push-action@v4 + with: + context: . + file: production/Dockerfile + load: true + push: false + build-args: | + VERSION=${{ steps.latest-version.outputs.VERSION }} + + - name: Test image + run: | + docker run --rm ${{ steps.fqirp.outputs.FQIRP }} python -c "import grits; print(grits.__version__)" + + - name: Push Docker image + uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc + with: + context: . + file: ${{ env.DOCKERFILE }} + push: true + build-args: | + VERSION=${{ steps.latest-version.outputs.VERSION }} From a9a381e3e4f68ed8c1d3d1ee2e9785d03669cb03 Mon Sep 17 00:00:00 2001 From: Jenny Fothergill Date: Fri, 3 May 2024 11:16:50 -0600 Subject: [PATCH 15/43] Remove quay badge --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 75a7e30..358ff14 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,5 @@ # GRiTS : Grits Reduces/Restores Topology with SMILES [![Anaconda-Server Badge](https://anaconda.org/conda-forge/grits/badges/version.svg)](https://anaconda.org/conda-forge/grits) -[![Docker Repository on Quay](https://quay.io/repository/cmelab/grits/status "Docker Repository on Quay")](https://quay.io/repository/cmelab/grits) [![pytest](https://github.com/cmelab/grits/actions/workflows/pytest.yml/badge.svg)](https://github.com/cmelab/grits/actions/workflows/pytest.yml) [![codecov](https://codecov.io/gh/cmelab/grits/branch/main/graph/badge.svg?token=lGG8Zf65HP)](https://codecov.io/gh/cmelab/grits) From 7ee4915b4556772e6720df5bd17019d119a8fdd5 Mon Sep 17 00:00:00 2001 From: Jenny <39961845+jennyfothergill@users.noreply.github.com> Date: Fri, 3 May 2024 11:24:52 -0600 Subject: [PATCH 16/43] Move env later --- .github/workflows/build.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 88f9775..c0c76c3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,19 +1,19 @@ name: build -env: - REGISTRY: ghcr.io - IMAGE_NAME: cmelab/grits - DOCKERFILE: containers/dockerfile_cpu - on: push: branches: [ main ] # Run when container or environment is changed paths: - - ${{ env.DOCKERFILE }} + - containers/dockerfile_cpu # Allows workflow to be manually triggered workflow_dispatch: +env: + REGISTRY: ghcr.io + IMAGE_NAME: cmelab/grits + DOCKERFILE: containers/dockerfile_cpu + jobs: build: runs-on: ubuntu-latest From 948255158f2ccf87824684bd54ad806bb0c4e18c Mon Sep 17 00:00:00 2001 From: Jenny <39961845+jennyfothergill@users.noreply.github.com> Date: Fri, 3 May 2024 11:27:39 -0600 Subject: [PATCH 17/43] Update dockerfile --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c0c76c3..fcdd06c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -58,7 +58,7 @@ jobs: uses: docker/build-push-action@v4 with: context: . - file: production/Dockerfile + file: ${{ env.DOCKERFILE }} load: true push: false build-args: | From e592026b81b3aeaf7a3688883cb4b63d7a2ad158 Mon Sep 17 00:00:00 2001 From: Jenny <39961845+jennyfothergill@users.noreply.github.com> Date: Fri, 3 May 2024 11:33:19 -0600 Subject: [PATCH 18/43] Update dockerfile_cpu --- containers/dockerfile_cpu | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/containers/dockerfile_cpu b/containers/dockerfile_cpu index c54c092..e07c06c 100644 --- a/containers/dockerfile_cpu +++ b/containers/dockerfile_cpu @@ -7,11 +7,9 @@ RUN micromamba install -y -n base -f /tmp/env.yml && \ COPY grits/ /tmp/grits/ -COPY setup.py /tmp/ - RUN ls -la /tmp -RUN python -m pip install /tmp +RUN python -m pip install /tmp/grits RUN pytest -vx From 717730a62b1bc5122c9d17212a9405d2e9ab15a1 Mon Sep 17 00:00:00 2001 From: Jenny <39961845+jennyfothergill@users.noreply.github.com> Date: Fri, 3 May 2024 11:35:16 -0600 Subject: [PATCH 19/43] Remove testing tests are done during the docker build --- .github/workflows/build.yml | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fcdd06c..b269ce1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -54,22 +54,8 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Build and export to Docker + - name: Build and Push to Docker uses: docker/build-push-action@v4 - with: - context: . - file: ${{ env.DOCKERFILE }} - load: true - push: false - build-args: | - VERSION=${{ steps.latest-version.outputs.VERSION }} - - - name: Test image - run: | - docker run --rm ${{ steps.fqirp.outputs.FQIRP }} python -c "import grits; print(grits.__version__)" - - - name: Push Docker image - uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc with: context: . file: ${{ env.DOCKERFILE }} From 642bb6201b018ed55a899fafd207803aafa39a8e Mon Sep 17 00:00:00 2001 From: Jenny <39961845+jennyfothergill@users.noreply.github.com> Date: Fri, 3 May 2024 11:41:36 -0600 Subject: [PATCH 20/43] Update dockerfile_cpu --- containers/dockerfile_cpu | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/containers/dockerfile_cpu b/containers/dockerfile_cpu index e07c06c..9d0210e 100644 --- a/containers/dockerfile_cpu +++ b/containers/dockerfile_cpu @@ -5,11 +5,11 @@ COPY --chown=micromamba:micromamba environment.yml /tmp/env.yml RUN micromamba install -y -n base -f /tmp/env.yml && \ micromamba clean --all --yes -COPY grits/ /tmp/grits/ +COPY grits setup.py README /tmp/ RUN ls -la /tmp -RUN python -m pip install /tmp/grits +RUN python -m pip install /tmp/ RUN pytest -vx From db6eda2c16de1471f000325f647bc888166b14e9 Mon Sep 17 00:00:00 2001 From: Jenny <39961845+jennyfothergill@users.noreply.github.com> Date: Fri, 3 May 2024 11:46:04 -0600 Subject: [PATCH 21/43] Update build.yml --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b269ce1..286a50e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -60,5 +60,6 @@ jobs: context: . file: ${{ env.DOCKERFILE }} push: true + tags: ${{ steps.latest-version.outputs.VERSION }} build-args: | VERSION=${{ steps.latest-version.outputs.VERSION }} From 5c1c7bad670455e1c9365576df5af7e66a7a5c9d Mon Sep 17 00:00:00 2001 From: Jenny <39961845+jennyfothergill@users.noreply.github.com> Date: Fri, 3 May 2024 11:47:19 -0600 Subject: [PATCH 22/43] Update dockerfile_cpu --- containers/dockerfile_cpu | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/containers/dockerfile_cpu b/containers/dockerfile_cpu index 9d0210e..b88d3cf 100644 --- a/containers/dockerfile_cpu +++ b/containers/dockerfile_cpu @@ -5,7 +5,7 @@ COPY --chown=micromamba:micromamba environment.yml /tmp/env.yml RUN micromamba install -y -n base -f /tmp/env.yml && \ micromamba clean --all --yes -COPY grits setup.py README /tmp/ +COPY grits setup.py README.md /tmp/ RUN ls -la /tmp From ab99ed59001b8202c4901325a854bb774570181a Mon Sep 17 00:00:00 2001 From: Jenny <39961845+jennyfothergill@users.noreply.github.com> Date: Fri, 3 May 2024 11:58:31 -0600 Subject: [PATCH 23/43] Update build.yml --- .github/workflows/build.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 286a50e..c783d49 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,6 +6,7 @@ on: # Run when container or environment is changed paths: - containers/dockerfile_cpu + - environment.yml # Allows workflow to be manually triggered workflow_dispatch: @@ -56,6 +57,21 @@ jobs: - name: Build and Push to Docker uses: docker/build-push-action@v4 + with: + context: . + file: ${{ env.DOCKERFILE }} + load: true + push: false + tags: ${{ steps.latest-version.outputs.VERSION }} + build-args: | + VERSION=${{ steps.latest-version.outputs.VERSION }} + + - name: Test image + run: | + docker run --rm ${{ steps.fqirp.outputs.FQIRP }} python -c "import grits; print(grits.__version__)" + + - name: Push Docker image + uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc with: context: . file: ${{ env.DOCKERFILE }} From a28c825a0cad0811b394538d8d76f58961021eba Mon Sep 17 00:00:00 2001 From: Jenny <39961845+jennyfothergill@users.noreply.github.com> Date: Fri, 3 May 2024 12:00:57 -0600 Subject: [PATCH 24/43] Update dockerfile_cpu --- containers/dockerfile_cpu | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/containers/dockerfile_cpu b/containers/dockerfile_cpu index b88d3cf..8f98301 100644 --- a/containers/dockerfile_cpu +++ b/containers/dockerfile_cpu @@ -3,18 +3,5 @@ FROM mambaorg/micromamba:0.15.2 COPY --chown=micromamba:micromamba environment.yml /tmp/env.yml RUN micromamba install -y -n base -f /tmp/env.yml && \ + micromamba install -y -n base -c conda-forge grits && \ micromamba clean --all --yes - -COPY grits setup.py README.md /tmp/ - -RUN ls -la /tmp - -RUN python -m pip install /tmp/ - -RUN pytest -vx - -USER root - -RUN rm -r /tmp/* - -RUN python -c "import grits" From 34c572b78295540e25537255050107326a4b5951 Mon Sep 17 00:00:00 2001 From: Jenny <39961845+jennyfothergill@users.noreply.github.com> Date: Fri, 3 May 2024 12:07:29 -0600 Subject: [PATCH 25/43] Update build.yml --- .github/workflows/build.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c783d49..63f35de 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -55,7 +55,7 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Build and Push to Docker + - name: Build Docker Image uses: docker/build-push-action@v4 with: context: . @@ -63,6 +63,7 @@ jobs: load: true push: false tags: ${{ steps.latest-version.outputs.VERSION }} + labels: ${{ steps.latest-version.outputs.VERSION }} build-args: | VERSION=${{ steps.latest-version.outputs.VERSION }} @@ -77,5 +78,6 @@ jobs: file: ${{ env.DOCKERFILE }} push: true tags: ${{ steps.latest-version.outputs.VERSION }} + labels: ${{ steps.latest-version.outputs.VERSION }} build-args: | VERSION=${{ steps.latest-version.outputs.VERSION }} From 8c29526cf796907fa3564c276a50acb151765efd Mon Sep 17 00:00:00 2001 From: Jenny <39961845+jennyfothergill@users.noreply.github.com> Date: Fri, 3 May 2024 12:53:31 -0600 Subject: [PATCH 26/43] Update build.yml --- .github/workflows/build.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 63f35de..362e129 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,6 +10,10 @@ on: # Allows workflow to be manually triggered workflow_dispatch: +defaults: + run: + shell: bash -l {0} + env: REGISTRY: ghcr.io IMAGE_NAME: cmelab/grits @@ -18,6 +22,9 @@ env: jobs: build: runs-on: ubuntu-latest + permissions: + contents: read + packages: write steps: - name: Checkout @@ -69,6 +76,7 @@ jobs: - name: Test image run: | + docker ls docker run --rm ${{ steps.fqirp.outputs.FQIRP }} python -c "import grits; print(grits.__version__)" - name: Push Docker image From 11aa31b1b838a97b92adab73e19ae3d766b16750 Mon Sep 17 00:00:00 2001 From: Jenny <39961845+jennyfothergill@users.noreply.github.com> Date: Fri, 3 May 2024 12:55:54 -0600 Subject: [PATCH 27/43] Update dockerfile_cpu --- containers/dockerfile_cpu | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/containers/dockerfile_cpu b/containers/dockerfile_cpu index 8f98301..5cb63ef 100644 --- a/containers/dockerfile_cpu +++ b/containers/dockerfile_cpu @@ -1,7 +1,12 @@ -FROM mambaorg/micromamba:0.15.2 +FROM mambaorg/micromamba:1.4.1 -COPY --chown=micromamba:micromamba environment.yml /tmp/env.yml +ARG VERSION -RUN micromamba install -y -n base -f /tmp/env.yml && \ - micromamba install -y -n base -c conda-forge grits && \ +ENV PYTHONUNBUFFERED=1 + +COPY --chown=$MAMBA_USER:$MAMBA_USER environment.yml /tmp/env.yml + +RUN micromamba install -y -n base "grits==$VERSION" -f /tmp/env.yml && \ micromamba clean --all --yes + +ARG MAMBA_DOCKERFILE_ACTIVATE=1 From c93305dcc16ce8d686ed643ab1103b1e5c4139ce Mon Sep 17 00:00:00 2001 From: Jenny <39961845+jennyfothergill@users.noreply.github.com> Date: Fri, 3 May 2024 13:13:25 -0600 Subject: [PATCH 28/43] Update build.yml --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 362e129..bc9a21f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -76,7 +76,7 @@ jobs: - name: Test image run: | - docker ls + docker ps docker run --rm ${{ steps.fqirp.outputs.FQIRP }} python -c "import grits; print(grits.__version__)" - name: Push Docker image From e436f858c974daab07b2c34e416727cc5ffeeda3 Mon Sep 17 00:00:00 2001 From: Jenny <39961845+jennyfothergill@users.noreply.github.com> Date: Fri, 3 May 2024 13:37:11 -0600 Subject: [PATCH 29/43] Update build.yml --- .github/workflows/build.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bc9a21f..cb11556 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -62,6 +62,14 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tags: | + ${{ steps.latest-version.outputs.VERSION }} + - name: Build Docker Image uses: docker/build-push-action@v4 with: From c872fb71d135098e4d1a355e84a67b07ff61ab58 Mon Sep 17 00:00:00 2001 From: Jenny <39961845+jennyfothergill@users.noreply.github.com> Date: Fri, 3 May 2024 13:41:46 -0600 Subject: [PATCH 30/43] Update build.yml --- .github/workflows/build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cb11556..3579591 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -77,8 +77,8 @@ jobs: file: ${{ env.DOCKERFILE }} load: true push: false - tags: ${{ steps.latest-version.outputs.VERSION }} - labels: ${{ steps.latest-version.outputs.VERSION }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} build-args: | VERSION=${{ steps.latest-version.outputs.VERSION }} @@ -93,7 +93,7 @@ jobs: context: . file: ${{ env.DOCKERFILE }} push: true - tags: ${{ steps.latest-version.outputs.VERSION }} - labels: ${{ steps.latest-version.outputs.VERSION }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} build-args: | VERSION=${{ steps.latest-version.outputs.VERSION }} From 44f6a02cf2482d1af274ab5041e1a109b6dedd10 Mon Sep 17 00:00:00 2001 From: Jenny Fothergill Date: Fri, 3 May 2024 13:53:45 -0600 Subject: [PATCH 31/43] Fix precommit --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3579591..78c71c4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -81,12 +81,12 @@ jobs: labels: ${{ steps.meta.outputs.labels }} build-args: | VERSION=${{ steps.latest-version.outputs.VERSION }} - + - name: Test image run: | docker ps docker run --rm ${{ steps.fqirp.outputs.FQIRP }} python -c "import grits; print(grits.__version__)" - + - name: Push Docker image uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc with: From 4de362634716daf091e0db8a04d16f7a0bdde1a7 Mon Sep 17 00:00:00 2001 From: Jenny <39961845+jennyfothergill@users.noreply.github.com> Date: Fri, 3 May 2024 14:00:41 -0600 Subject: [PATCH 32/43] Update README.md --- README.md | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 0c06a77..6be2c41 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ [![pytest](https://github.com/cmelab/grits/actions/workflows/pytest.yml/badge.svg)](https://github.com/cmelab/grits/actions/workflows/pytest.yml) [![codecov](https://codecov.io/gh/cmelab/grits/branch/main/graph/badge.svg?token=lGG8Zf65HP)](https://codecov.io/gh/cmelab/grits) [![Documentation Status](https://readthedocs.org/projects/grits/badge/?version=latest)](https://grits.readthedocs.io/en/latest/?badge=latest) +[![Docker build](https://github.com/cmelab/grits/actions/workflows/build.yml/badge.svg)](https://github.com/cmelab/grits/actions/workflows/build.yml) ![GRiTS workflow](/.github/grits.png) @@ -13,21 +14,21 @@ GRiTS is a toolkit for working with coarse-grain systems. It uses [mBuild](https To use GRiTS in a prebuilt container (using [Singularity](https://singularity.lbl.gov/)), run: ```bash -singularity pull docker://quay.io/cmelab/grits:latest -singularity exec grits_latest.sif bash +singularity pull docker://ghcr.io/cmelab/grits:0.4.1 +singularity exec grits_0.4.1.sif bash ``` **Or** using [Docker](https://docs.docker.com/), run: ```bash -docker pull quay.io/cmelab/grits:latest -docker run -it cmelab/grits:latest +docker pull ghcr.io/cmelab/grits:0.4.1 +docker run -it cmelab/grits:0.4.1 ``` #### Custom install -To create a local environment with [conda](https://docs.conda.io/en/latest/miniconda.html), run: +To create a local environment with [micromamba](https://mamba.readthedocs.io/en/latest/user_guide/micromamba.html)), run: ```bash -conda env create -f environment.yml -conda activate grits +micromamba create -f environment.yml +micromamba activate grits ``` With the `grits` environment active, install the package with pip: ``` From 81827a3593e016bf9256d7167642bf7455ba70a4 Mon Sep 17 00:00:00 2001 From: Jenny Fothergill Date: Fri, 3 May 2024 15:41:47 -0600 Subject: [PATCH 33/43] Switch to pyproject exclusively trying to fix versioning on conda-forge --- pyproject.toml | 42 +++++++++++++++++++++++++++++++++--- setup.py | 58 -------------------------------------------------- 2 files changed, 39 insertions(+), 61 deletions(-) delete mode 100644 setup.py diff --git a/pyproject.toml b/pyproject.toml index 2758df1..c19b306 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,42 @@ [build-system] -requires = ["setuptools>=45", "setuptools_scm[toml]>=6.2"] +requires = ["setuptools>=61.2", "versioningit"] build-backend = "setuptools.build_meta" -[tool.setuptools_scm] -write_to = "grits/__version__.py" +[project] +name = "grits" +description = "A toolkit for working with coarse-grained systems" +readme = "README.md" +authors = [{name = "Jenny Fothergill", email = "jennyfothergill@boisestate.edu"}] +license= {text = "GPLv3"} +classifiers=[ + "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", + "Programming Language :: Python", + "Programming Language :: Python :: 3", +] +urls = {Homepage = "https://github.com/cmelab/grits"} +requires-python = ">=3.8" +dynamic = ["version"] + +[tool.setuptools] +zip-safe = false +include-package-data = true +license-files = ["LICENSE"] + +[tool.setuptools.packages] +find = {namespaces = false} + +[tool.setuptools.package-data] +grits = ['"./compounds/*"'] + +[tool.versioningit] +default-version = "1+unknown" + +[tool.versioningit.format] +distance = "{base_version}+{distance}.{vcs}{rev}" +dirty = "{base_version}+{distance}.{vcs}{rev}.dirty" +distance-dirty = "{base_version}+{distance}.{vcs}{rev}.dirty" + +[tool.versioningit.vcs] +method = "git" +match = ["*"] +default-tag = "0.0.0" diff --git a/setup.py b/setup.py deleted file mode 100644 index a762818..0000000 --- a/setup.py +++ /dev/null @@ -1,58 +0,0 @@ -from codecs import open -from os import path - -from setuptools import find_packages, setup - -# Package meta-data. -NAME = "grits" -DESCRIPTION = "A toolkit for working with coarse-grained systems" -URL = "https://github.com/cmelab/grits" -EMAIL = "jennyfothergill@boisestate.edu" -AUTHOR = "Jenny Fothergill" -REQUIRES_PYTHON = ">=3.8" - -# What packages are required for this module to be executed? -REQUIRED = [] - -here = path.abspath(path.dirname(__file__)) - -with open("README.md", "r", encoding="utf-8") as f: - long_description = f.read() - - -def myversion(): - from setuptools_scm.version import get_local_dirty_tag - - def clean_scheme(version): - return get_local_dirty_tag(version) if version.dirty else "+clean" - - return {"local_scheme": clean_scheme} - - -setup( - name=NAME, - use_scm_version=myversion, - author=AUTHOR, - author_email=EMAIL, - description=DESCRIPTION, - long_description=long_description, - long_description_content_type="text/markdown", - url=URL, - license="GPLv3", - project_urls={ - "Bug Tracker": f"{URL}/issues", - }, - python_requires=REQUIRES_PYTHON, - packages=find_packages(exclude=("tests", "docs", "examples")), - package_data={"grits": ["compounds/*"]}, - install_requires=REQUIRED, - include_package_data=True, - classifiers=[ - # Trove classifiers - # Full list: https://pypi.python.org/pypi?%3Aaction=list_classifiers - "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", - "Programming Language :: Python", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", - ], -) From 969ff02dcf1eef3c4b59ddd967f9112ea20bc1c7 Mon Sep 17 00:00:00 2001 From: Jenny <39961845+jennyfothergill@users.noreply.github.com> Date: Fri, 3 May 2024 15:51:09 -0600 Subject: [PATCH 34/43] Update build.yml --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 78c71c4..fb4b8cc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -68,6 +68,7 @@ jobs: with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} tags: | + type=raw,value=latest,enable={{ is_default_branch }} ${{ steps.latest-version.outputs.VERSION }} - name: Build Docker Image From b428541d97a7cc4ced3912d15cfcadd796c8960c Mon Sep 17 00:00:00 2001 From: Jenny Fothergill Date: Fri, 3 May 2024 15:57:05 -0600 Subject: [PATCH 35/43] Update install instructions --- README.md | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 6be2c41..94f006e 100644 --- a/README.md +++ b/README.md @@ -12,29 +12,21 @@ GRiTS is a toolkit for working with coarse-grain systems. It uses [mBuild](https ### Installation #### Using a container -To use GRiTS in a prebuilt container (using [Singularity](https://singularity.lbl.gov/)), run: +To use GRiTS in a prebuilt container (using [Apptainer](https://apptainer.org/)), run: ```bash -singularity pull docker://ghcr.io/cmelab/grits:0.4.1 -singularity exec grits_0.4.1.sif bash +apptainer pull docker://ghcr.io/cmelab/grits:latest +apptainer run grits_latest.sif python ``` **Or** using [Docker](https://docs.docker.com/), run: ```bash -docker pull ghcr.io/cmelab/grits:0.4.1 -docker run -it cmelab/grits:0.4.1 +docker pull ghcr.io/cmelab/grits:latest +docker run -it cmelab/grits:latest ``` -#### Custom install +#### Micromamba install To create a local environment with [micromamba](https://mamba.readthedocs.io/en/latest/user_guide/micromamba.html)), run: ```bash -micromamba create -f environment.yml +micromamba create grits -f environment.yml micromamba activate grits ``` -With the `grits` environment active, install the package with pip: -``` -pip install . -``` -And to test your installation, run: -``` -pytest -``` From 304d9e4437c59de19a0a6352ad521de4d552cd1b Mon Sep 17 00:00:00 2001 From: Jenny <39961845+jennyfothergill@users.noreply.github.com> Date: Fri, 3 May 2024 16:02:58 -0600 Subject: [PATCH 36/43] Update build.yml --- .github/workflows/build.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fb4b8cc..e66421c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -68,7 +68,7 @@ jobs: with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} tags: | - type=raw,value=latest,enable={{ is_default_branch }} + type=ref,enable=true,priority=600,event=tag ${{ steps.latest-version.outputs.VERSION }} - name: Build Docker Image @@ -85,7 +85,6 @@ jobs: - name: Test image run: | - docker ps docker run --rm ${{ steps.fqirp.outputs.FQIRP }} python -c "import grits; print(grits.__version__)" - name: Push Docker image From aa0605601a3e4264f6604f4d8d457dbee39c453c Mon Sep 17 00:00:00 2001 From: Jenny <39961845+jennyfothergill@users.noreply.github.com> Date: Fri, 3 May 2024 16:27:56 -0600 Subject: [PATCH 37/43] Update build.yml --- .github/workflows/build.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e66421c..bf3afd5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -68,7 +68,10 @@ jobs: with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} tags: | - type=ref,enable=true,priority=600,event=tag + type=ref,event=tag,enable=true,priority=600 + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{version}} + type=sha ${{ steps.latest-version.outputs.VERSION }} - name: Build Docker Image From ae22a57955cc40ce2dd61c5213583de7b3774a29 Mon Sep 17 00:00:00 2001 From: Jenny <39961845+jennyfothergill@users.noreply.github.com> Date: Fri, 3 May 2024 16:49:15 -0600 Subject: [PATCH 38/43] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 94f006e..ead8e37 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ docker run -it cmelab/grits:latest ``` #### Micromamba install -To create a local environment with [micromamba](https://mamba.readthedocs.io/en/latest/user_guide/micromamba.html)), run: +To create a local environment with [micromamba](https://mamba.readthedocs.io/en/latest/user_guide/micromamba.html), run: ```bash micromamba create grits -f environment.yml micromamba activate grits From 8a181002f9e74e691735ac48e0ff111c682b666b Mon Sep 17 00:00:00 2001 From: Jenny Fothergill Date: Mon, 6 May 2024 11:32:54 -0600 Subject: [PATCH 39/43] Remove rdkit, sort dependencies --- environment.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/environment.yml b/environment.yml index 0f2a500..37c34a1 100644 --- a/environment.yml +++ b/environment.yml @@ -2,20 +2,19 @@ name: grits channels: - conda-forge dependencies: - - python=3.10 - - numpy + - cmeutils >= 1.2.0 - ele - - freud =2.13.2 - - gsd>=3.0 + - freud = 2.13.2 + - gsd >= 3.0 - jupyterlab - mbuild - ele - freud + - numpy - openbabel - pip - pre-commit - py3Dmol - pytest - pytest-cov - - rdkit - - cmeutils >= 1.2.0 + - python = 3.10 From ff72e3e5af36c105325dc2310ca46fb820ee842e Mon Sep 17 00:00:00 2001 From: Jenny Fothergill Date: Mon, 6 May 2024 15:19:48 -0600 Subject: [PATCH 40/43] Only push on manual trigger --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bf3afd5..0a0a4ec 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -95,7 +95,7 @@ jobs: with: context: . file: ${{ env.DOCKERFILE }} - push: true + push: ${{ github.event_name == 'workflow_dispatch' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} build-args: | From d5d5bffa0e87a9a1158f763cd1b63c42b998189c Mon Sep 17 00:00:00 2001 From: Jenny Fothergill Date: Mon, 6 May 2024 15:25:59 -0600 Subject: [PATCH 41/43] Add v prefix to tags Hopefully this will trigger latest? --- .github/workflows/build.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0a0a4ec..15f1299 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -68,10 +68,7 @@ jobs: with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} tags: | - type=ref,event=tag,enable=true,priority=600 - type=semver,pattern={{major}}.{{minor}} - type=semver,pattern={{version}} - type=sha + type=semver,pattern={{version}},prefix=v ${{ steps.latest-version.outputs.VERSION }} - name: Build Docker Image From 5ee91d6aef38bc1a8ec2cb9111fa6b6c475ef200 Mon Sep 17 00:00:00 2001 From: chrisjonesBSU Date: Tue, 18 Jun 2024 23:46:47 -0600 Subject: [PATCH 42/43] update env file, use snap mol cluster func from cmeutils instead of internal one --- environment.yml | 11 +++++------ grits/coarsegrain.py | 5 ++--- grits/utils.py | 17 ----------------- 3 files changed, 7 insertions(+), 26 deletions(-) diff --git a/environment.yml b/environment.yml index 37c34a1..9bb7ef1 100644 --- a/environment.yml +++ b/environment.yml @@ -2,14 +2,13 @@ name: grits channels: - conda-forge dependencies: - - cmeutils >= 1.2.0 + - cmeutils >=1.2.0 - ele - - freud = 2.13.2 - - gsd >= 3.0 + - freud >=3.0 + - gsd >=3.0 - jupyterlab - - mbuild + - mbuild >=0.17.1 - ele - - freud - numpy - openbabel - pip @@ -17,4 +16,4 @@ dependencies: - py3Dmol - pytest - pytest-cov - - python = 3.10 + - python >=3.10 diff --git a/grits/coarsegrain.py b/grits/coarsegrain.py index d43718e..7d7fd2f 100644 --- a/grits/coarsegrain.py +++ b/grits/coarsegrain.py @@ -10,7 +10,7 @@ import freud import gsd.hoomd import numpy as np -from cmeutils.gsd_utils import identify_snapshot_connections +from cmeutils.gsd_utils import get_molecule_cluster, identify_snapshot_connections from ele import element_from_symbol from mbuild import Compound, clone from mbuild.utils.io import run_from_ipython @@ -24,7 +24,6 @@ get_quaternion, has_common_member, has_number, - snap_molecules, ) __all__ = ["CG_Compound", "CG_System", "Bead"] @@ -574,7 +573,7 @@ def _get_compounds( conversion_dict[i].symbol for i in snap.particles.types ] # Break apart the snapshot into separate molecules - molecules = snap_molecules(snap) + molecules = get_molecule_cluster(snap=snap) mol_inds = [] for i in range(max(molecules) + 1): mol_inds.append(np.where(molecules == i)[0]) diff --git a/grits/utils.py b/grits/utils.py index ce3487b..e5898ce 100644 --- a/grits/utils.py +++ b/grits/utils.py @@ -82,23 +82,6 @@ def comp_from_snapshot(snapshot, indices, length_scale=1.0, mass_scale=1.0): return comp -def snap_molecules(snap): - """Get the molecule indices based on bonding in a gsd.hoomd.Frame.""" - system = freud.AABBQuery.from_system(snap) - n_query_points = n_points = snap.particles.N - query_point_indices = snap.bonds.group[:, 0] - point_indices = snap.bonds.group[:, 1] - distances = system.box.compute_distances( - system.points[query_point_indices], system.points[point_indices] - ) - nlist = freud.NeighborList.from_arrays( - n_query_points, n_points, query_point_indices, point_indices, distances - ) - cluster = freud.cluster.Cluster() - cluster.compute(system=system, neighbors=nlist) - return cluster.cluster_idx - - def align(compound, particle, towards_compound, around=None): """Spin a compound such that particle points at towards_compound. From f40c005f9c230e2b6a4dbff5cb984f83e236a2e5 Mon Sep 17 00:00:00 2001 From: chrisjonesBSU Date: Wed, 19 Jun 2024 07:53:52 -0600 Subject: [PATCH 43/43] use latest cmeutils version --- environment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/environment.yml b/environment.yml index 9bb7ef1..ef7f34f 100644 --- a/environment.yml +++ b/environment.yml @@ -2,7 +2,7 @@ name: grits channels: - conda-forge dependencies: - - cmeutils >=1.2.0 + - cmeutils >=1.3.0 - ele - freud >=3.0 - gsd >=3.0