Skip to content

Commit

Permalink
Mig/2.x (#172)
Browse files Browse the repository at this point in the history
- Add CLI to run
- migrate to support AiiDA 2.x
- new YAML to setup pw/ph executables
  • Loading branch information
unkcpz authored Feb 13, 2023
1 parent 9a6622f commit aef6cc1
Show file tree
Hide file tree
Showing 30 changed files with 513 additions and 449 deletions.
4 changes: 0 additions & 4 deletions .aiida-testing-config.yml

This file was deleted.

55 changes: 49 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ on: [push, pull_request]
jobs:

pre-commit:
# Adapted from: https://github.com/CasperWA/voila-optimade-client

runs-on: ubuntu-latest

steps:
Expand All @@ -18,11 +16,56 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.9
python-version: '3.10'

- name: Install dependencies
run: |
python -m pip install pre-commit==2.11.1
python -m pip install virtualenv==20.0.33
run: pip install -U pre-commit==2.10.0

- name: Run pre-commit
run: pre-commit run --all-files || ( git status --short ; git diff ; exit 1 )

test:
needs: [pre-commit]

strategy:
matrix:
python-version: ['3.9']

services:
rabbitmq:
image: rabbitmq:3.8.14-management
ports:
- 5672:5672
- 15672:15672

runs-on: ubuntu-latest
timeout-minutes: 40

steps:
- uses: eWaterCycle/setup-singularity@v7 # for containerized code test
with:
singularity-version: 3.8.7

- uses: actions/checkout@v2

- name: Cache Python dependencies
uses: actions/cache@v1
with:
path: ~/.cache/pip
key: pip-${{ matrix.python-version }}-tests-${{ hashFiles('**/setup.json') }}
restore-keys: pip-${{ matrix.python-version }}-tests

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies for test
run: |
pip install -U pip==22.3.1
pip install -U .[tests]
# - name: Pull the image and Run pytest
# run: |
# singularity run docker://containers4hpc/qe-mpich314:0.1.0 which pw.x
# pytest -v tests/test_nightly.py -s
18 changes: 1 addition & 17 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@ repos:
- id: trailing-whitespace
exclude: *exclude_pre_commit_hooks

- repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt
rev: 0.1.0
hooks:
- id: yamlfmt

- repo: https://github.com/ikamensh/flynt/
rev: '0.76'
hooks:
Expand Down Expand Up @@ -55,23 +50,12 @@ repos:
^docs/ |
)
- repo: https://github.com/hadialqattan/pycln
rev: v1.2.5
hooks:
- id: pycln
args: [--config=pyproject.toml]

- repo: https://github.com/pycqa/isort
rev: 5.10.1
rev: 5.12.0
hooks:
- id: isort
args: [--profile, black, --filter-files]

- repo: https://github.com/asottile/setup-cfg-fmt
rev: v1.20.0
hooks:
- id: setup-cfg-fmt

- repo: https://github.com/sirosen/check-jsonschema
rev: 0.14.0
hooks:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Initial dual (E_rho/E_wfc) for convergence test

For NC psp we use dual start from 4, PAW/US use dual from 8 for most of elements but 18 for high dual elements which we found usually high charge density cutoff are needed.
For NC psp we use dual start from 4, PAW/US use dual from 8 for most of elements but 18 for high dual elements which we found usually high charge density cutoff are needed.
They are O,Fe,Hf, Mn, Co, Ni, Cr.

## Logic of convergence test on different criteria protocol
Expand Down
6 changes: 3 additions & 3 deletions aiida_sssp_workflow/calculations/calculate_delta.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,9 @@ def delta_analyze(element, configuration, V0, B0, B1, natoms) -> orm.Dict:
B0,
B1,
config_string=None,
prefact=400, # XXX: re-inspect this value and set it in protocol
weight_b0=1 / 8,
weight_b1=1 / 64,
prefact=1,
weight_b0=1 / 20,
weight_b1=1 / 400,
)

return orm.Dict(
Expand Down
18 changes: 8 additions & 10 deletions aiida_sssp_workflow/cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,18 @@
# pylint: disable=wrong-import-position,wildcard-import
"""Module for the command line interface."""
import click
import click_completion
from aiida.cmdline.params import options as options_core
from aiida.cmdline.params import types

# Activate the completion of parameter types provided by the click_completion package
click_completion.init()
from aiida.cmdline.groups import VerdiCommandGroup
from aiida.cmdline.params import options, types


@click.group(
"aiida-sssp-workflow", context_settings={"help_option_names": ["-h", "--help"]}
"aiida-sssp-workfloww",
cls=VerdiCommandGroup,
context_settings={"help_option_names": ["-h", "--help"]},
)
@options_core.PROFILE(type=types.ProfileParamType(load_profile=True))
def cmd_root(profile): # pylint: disable=unused-argument
@options.PROFILE(type=types.ProfileParamType(load_profile=True), expose_value=False)
def cmd_root():
"""CLI for the `aiida-sssp-workflow` plugin."""


from aiida_sssp_workflow.cli.tools import dump_output
from .run import launch
74 changes: 0 additions & 74 deletions aiida_sssp_workflow/cli/launch.py

This file was deleted.

Loading

0 comments on commit aef6cc1

Please sign in to comment.