Skip to content

Commit

Permalink
Refactoring on the running and tidy up the repo (#238)
Browse files Browse the repository at this point in the history
* Extract pseudo info from name and text function

* Use pyproject.toml only with flit as build backend

* Use ruff for precommit lint

* Add more source to test pseudo info extraction

* Renew structure mapping using a script

* Use src path for modules and delete unused legacy modules

* Standardize the structure for each type of verification

* Base and Caching Convergence refactoring

* eos convergence refactoring

* Accept UpfData to contruct builder

* Cohesive energe convergence workflow refac

* Refactor convergence pressure workflow

* Refactoring Band convergence workflow

* Add an element list UNSUPPERTED_ELEMENTS for elements where nat.phys.rev has no structures

* Refactoring phonon convergence test

* Having robust tests for tricky caching cases of bands and phonon frequecies

* Refactoring transferibility verification workflow

* Band structure verification workflow and tidy standard structure collecting function

* Update CI to do unit tests

* Remove parse_pseudo as package move it into aiida_sssp_workflow

* More sophisticate pytest running option.

* Delete computer setup yaml files delete examples

* Test on the main branche of aiida-core

* Compute and write down the success rate to the convergence test output

* Full verification workchain

- Rename measure to transferability and separate bands and eos

* Convergence parser for properties

* More parser

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
  • Loading branch information
unkcpz authored Jul 19, 2024
1 parent 7d2ad2d commit 142c137
Show file tree
Hide file tree
Showing 1,254 changed files with 102,393 additions and 266,551 deletions.
2 changes: 0 additions & 2 deletions .coveragerc

This file was deleted.

2 changes: 1 addition & 1 deletion .docker/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

@pytest.fixture(scope="session")
def docker_compose_file(pytestconfig): # pylint: disable=unused-argument
return f"docker-compose.aiida-sssp-workflow.yml"
return "docker-compose.aiida-sssp-workflow.yml"


@pytest.fixture(scope="session")
Expand Down
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
version: 2
updates:
# Maintain dependencies for GitHub Actions
- package-ecosystem: github-actions
directory: /
schedule:
interval: monthly
groups:
gha-dependencies:
patterns:
- '*'
71 changes: 0 additions & 71 deletions .github/workflows/ci-nightly.yml

This file was deleted.

114 changes: 77 additions & 37 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,66 +1,106 @@
---
# Run basic tests for this app on the latest aiidalab-docker image.

name: continuous-integration
name: CI unit test

on: [push, pull_request]

jobs:

pre-commit:

fast-tests:
runs-on: ubuntu-latest
timeout-minutes: 10

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

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v2
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: "3.10"

- name: Install dependencies
run: pip install -U pre-commit==2.10.0
- name: Install dependencies for test
run: |
pip install .[dev]
- name: Run pre-commit
run: pre-commit run --all-files || ( git status --short ; git diff ; exit 1 )
- name: Run pytest
run: |
pytest -s tests -m "not slow"
test:
needs: [pre-commit]
slow-tests:

strategy:
matrix:
python-version: ['3.9', '3.10']
runs-on: ubuntu-latest
timeout-minutes: 30

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

runs-on: ubuntu-latest
timeout-minutes: 40
rabbitmq:
image: rabbitmq:3.8.14-management
ports:
- 5672:5672
- 15672:15672

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

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

- name: Install dependencies for test
run: |
pip install .[dev]
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
- name: Run pytest
run: |
pytest -s tests -m "slow"
edge-aiida-core-tests:
# This is to test the plugin is compatible with the main branch of aiida-core

needs: [slow-tests]
runs-on: ubuntu-latest
timeout-minutes: 30

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

steps:
- uses: actions/checkout@v4

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

- name: Install dependencies for test
- name: Install dependencies and edge aiida-core for test
run: |
pip install -U pip==22.3.1
pip install -U .[tests]
pip install .[dev]
pip uninstall --yes aiida-core
git clone --depth 1 https://github.com/aiidateam/aiida-core.git
pip install ./aiida-core
- name: Pull the image and Run pytest
- name: Check aiida-core version is the edget ('post' in version tag)
run: |
if verdi --version | grep -q "post"; then
echo $(verdi --version)
else
echo $(verdi --version)
exit 1
fi
- name: Run pytest
run: |
pytest -sv tests
pytest -s tests
50 changes: 13 additions & 37 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,48 +9,24 @@ repos:
- id: end-of-file-fixer
exclude: &exclude_pre_commit_hooks >
(?x)^(
run_script/_static/.*/.*|
tests/_statics/upf/.*|
)$
- id: trailing-whitespace
exclude: *exclude_pre_commit_hooks

- repo: https://github.com/ikamensh/flynt/
rev: '0.76'
hooks:
- id: flynt

- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
- id: black
language_version: python3 # Should be a command that runs python3.6+

- repo: https://github.com/PyCQA/flake8
rev: 4.0.1
hooks:
- id: flake8
args: [--count, --show-source, --statistics]
additional_dependencies:
- flake8-bugbear==21.3.1
exclude: |
(?x)(
^tests/ |
^examples/ |
^docs/ |
)
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
args: [--profile, black, --filter-files]

- repo: https://github.com/sirosen/check-jsonschema
rev: 0.14.0
hooks:
- id: check-github-workflows

- repo: https://github.com/kynan/nbstripout
rev: 0.6.1
hooks:
- id: nbstripout

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.1
hooks:
- id: ruff-format
exclude: &exclude_ruff >
(?x)^(
examples/.*|
)$
- id: ruff
exclude: *exclude_ruff
args: [--fix, --exit-non-zero-on-fix, --show-fixes]
2 changes: 0 additions & 2 deletions MANIFEST.in

This file was deleted.

8 changes: 0 additions & 8 deletions aiida_sssp_workflow/__init__.py

This file was deleted.

4 changes: 0 additions & 4 deletions aiida_sssp_workflow/cli/tools/__init__.py

This file was deleted.

77 changes: 0 additions & 77 deletions aiida_sssp_workflow/cli/tools/dump.py

This file was deleted.

Loading

0 comments on commit 142c137

Please sign in to comment.