From 7c2dd38d2644ce7542687c15ad20d36001046f3e Mon Sep 17 00:00:00 2001 From: Aliaksandr Yakutovich Date: Thu, 14 Mar 2024 19:07:27 +0100 Subject: [PATCH 1/5] Bump version v2.0.0 -> v2.1.0b0. --- aiida_cp2k/__init__.py | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/aiida_cp2k/__init__.py b/aiida_cp2k/__init__.py index efc9d6b..631195d 100644 --- a/aiida_cp2k/__init__.py +++ b/aiida_cp2k/__init__.py @@ -6,6 +6,6 @@ ############################################################################### """The official AiiDA plugin for CP2K.""" -__version__ = "2.0.0" +__version__ = "2.1.0b0" # EOF diff --git a/pyproject.toml b/pyproject.toml index 316ebce..37dfdbf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -74,7 +74,7 @@ filterwarnings = [ ] [tool.bumpver] -current_version = "v2.0.0" +current_version = "v2.1.0b0" version_pattern = "vMAJOR.MINOR.PATCH[PYTAGNUM]" commit_message = "Bump version {old_version} -> {new_version}." commit = true From b4f4de58406c9932a79be1b66cded17afdd7ba7e Mon Sep 17 00:00:00 2001 From: Carlo Pignedoli Date: Sat, 16 Mar 2024 09:43:04 +0100 Subject: [PATCH 2/5] Use `orm.Dict.get_dict()` to get the Python dictionary (#211) In earlier versions of AiiDA (I guess <2.5) the `get()` method is not yet implemented for the `orm.Dict` object. To support a wider range of AiiDA versions, we convert an `omr.Dict` to the regular Python dictionary. --- aiida_cp2k/workchains/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aiida_cp2k/workchains/base.py b/aiida_cp2k/workchains/base.py index 1f26b78..3ed3cae 100644 --- a/aiida_cp2k/workchains/base.py +++ b/aiida_cp2k/workchains/base.py @@ -65,7 +65,7 @@ def results(self): trajectories = self._collect_all_trajetories() if trajectories: self.report("Work chain completed successfully, collecting all trajectories") - if self.ctx.inputs.parameters.get("GLOBAL", {}).get("RUN_TYPE") == "GEO_OPT": + if self.ctx.inputs.parameters.get_dict().get("GLOBAL", {}).get("RUN_TYPE") == "GEO_OPT": output_trajectory = utils.merge_trajectory_data_non_unique(*trajectories) else: output_trajectory = utils.merge_trajectory_data_unique(*trajectories) From 580021f885f447dd9676907205950531010d067f Mon Sep 17 00:00:00 2001 From: Carlo Pignedoli Date: Sat, 16 Mar 2024 10:07:09 +0100 Subject: [PATCH 3/5] `TrajectoryData` doesn't support numbers in atomic names (#212) --- aiida_cp2k/parsers/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/aiida_cp2k/parsers/__init__.py b/aiida_cp2k/parsers/__init__.py index 440231b..6045ef7 100644 --- a/aiida_cp2k/parsers/__init__.py +++ b/aiida_cp2k/parsers/__init__.py @@ -6,6 +6,8 @@ ############################################################################### """AiiDA-CP2K output parser.""" +import re + import ase import numpy as np from aiida import common, engine, orm, parsers, plugins @@ -128,7 +130,7 @@ def _read_stdout(self): def _parse_trajectory(self, structure): """CP2K trajectory parser.""" - symbols = [str(site.kind_name) for site in structure.sites] + symbols = [re.sub(r"\d+", "", str(site.kind_name)) for site in structure.sites] # Handle the positions trajectory xyz_traj_fname = self.node.process_class._DEFAULT_TRAJECT_XYZ_FILE_NAME From a2a6d971a576f1739edd022aea55a2e8ceec37c6 Mon Sep 17 00:00:00 2001 From: Aliaksandr Yakutovich Date: Sat, 16 Mar 2024 14:08:11 +0500 Subject: [PATCH 4/5] Bump version v2.1.0b0 -> v2.1.0b1. --- aiida_cp2k/__init__.py | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/aiida_cp2k/__init__.py b/aiida_cp2k/__init__.py index 631195d..31baffa 100644 --- a/aiida_cp2k/__init__.py +++ b/aiida_cp2k/__init__.py @@ -6,6 +6,6 @@ ############################################################################### """The official AiiDA plugin for CP2K.""" -__version__ = "2.1.0b0" +__version__ = "2.1.0b1" # EOF diff --git a/pyproject.toml b/pyproject.toml index 37dfdbf..95be358 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -74,7 +74,7 @@ filterwarnings = [ ] [tool.bumpver] -current_version = "v2.1.0b0" +current_version = "v2.1.0b1" version_pattern = "vMAJOR.MINOR.PATCH[PYTAGNUM]" commit_message = "Bump version {old_version} -> {new_version}." commit = true From 30adaa3dede7102060c991fae598c60eb4cdeb6d 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 22:23:45 +0600 Subject: [PATCH 5/5] Package management (#204) * Set min Python version to 3.9. * Remove the pre-commit run from the ci, as it is done by the pre-commit app. * Update pre-commit hooks. * Remove `load_documentation_profile` from docs builds to fix it. --- .github/workflows/ci.yml | 23 +---------------------- .pre-commit-config.yaml | 10 +++++----- docs/source/conf.py | 8 ++------ pyproject.toml | 4 ++-- 4 files changed, 10 insertions(+), 35 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9a5febf..e8586ce 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -52,33 +52,12 @@ jobs: docker exec --tty --user aiida $DOCKERID /bin/bash -l -c 'cd /home/aiida/aiida-cp2k/ && py.test --cov aiida_cp2k --cov-append .' - pre-commit: - runs-on: ubuntu-latest - timeout-minutes: 10 - strategy: - matrix: - python-version: [3.8] - steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - name: Install python dependencies - run: | - pip install --upgrade pip - pip install -e .[dev,docs] - - name: Run pre-commit - run: | - pre-commit install - pre-commit run --all-files || ( git status --short ; git diff ; exit 1 ) - docs: runs-on: ubuntu-latest timeout-minutes: 10 strategy: matrix: - python-version: [3.8] + python-version: [3.11] steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ba2854e..e274c7b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,7 +4,7 @@ ci: repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v4.5.0 hooks: - id: check-json @@ -19,7 +19,7 @@ repos: exclude: *exclude_pre_commit_hooks - repo: https://github.com/psf/black - rev: 23.9.1 + rev: 23.12.1 hooks: - id: black language_version: python3 # Should be a command that runs python3.6+ @@ -32,19 +32,19 @@ repos: args: [--count, --show-source, --statistics] - repo: https://github.com/pycqa/isort - rev: 5.12.0 + rev: 5.13.2 hooks: - id: isort args: [--profile, black, --filter-files] - repo: https://github.com/asottile/pyupgrade - rev: v3.14.0 + rev: v3.15.0 hooks: - id: pyupgrade args: [--py37-plus] - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.5.1 + rev: v1.8.0 hooks: - id: mypy additional_dependencies: diff --git a/docs/source/conf.py b/docs/source/conf.py index 4c169e5..deed168 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -15,13 +15,9 @@ import time from typing import Dict -from aiida.manage.configuration import load_documentation_profile +from aiida.manage.configuration import Profile, load_profile -# -- AiiDA-related setup -------------------------------------------------- - -# Load the dummy profile even if we are running locally, this way the documentation will succeed even if the current -# default profile of the AiiDA installation does not use a Django backend. -load_documentation_profile() +load_profile(Profile("docs", {"process_control": {}, "storage": {}})) # If we are not on READTHEDOCS load the Sphinx theme manually if not os.environ.get("READTHEDOCS", None): diff --git a/pyproject.toml b/pyproject.toml index 95be358..bb200c6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,7 +18,7 @@ classifiers = [ "Operating System :: MacOS :: MacOS X", "Programming Language :: Python :: 3", ] -requires-python = ">=3.8" +requires-python = ">=3.9" dependencies = [ "aiida-core>=2.0.0,<3.0.0", "aiida-gaussian-datatypes", @@ -40,7 +40,7 @@ dev = [ "pytest~=6.0", "pytest-cov~=2.11.1", "coverage", - "pre-commit~=2.19", + "pre-commit~=3.6", ] docs = [ "sphinx",