Skip to content

Commit 142c137

Browse files
authored
Refactoring on the running and tidy up the repo (#238)
* 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
1 parent 7d2ad2d commit 142c137

File tree

1,254 files changed

+102393
-266551
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,254 files changed

+102393
-266551
lines changed

.coveragerc

Lines changed: 0 additions & 2 deletions
This file was deleted.

.docker/tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

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

1010

1111
@pytest.fixture(scope="session")

.github/dependabot.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
version: 2
3+
updates:
4+
# Maintain dependencies for GitHub Actions
5+
- package-ecosystem: github-actions
6+
directory: /
7+
schedule:
8+
interval: monthly
9+
groups:
10+
gha-dependencies:
11+
patterns:
12+
- '*'

.github/workflows/ci-nightly.yml

Lines changed: 0 additions & 71 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 77 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,106 @@
11
---
22
# Run basic tests for this app on the latest aiidalab-docker image.
33

4-
name: continuous-integration
4+
name: CI unit test
55

66
on: [push, pull_request]
77

88
jobs:
99

10-
pre-commit:
10+
11+
fast-tests:
1112
runs-on: ubuntu-latest
13+
timeout-minutes: 10
14+
15+
services:
16+
rabbitmq:
17+
image: rabbitmq:3.8.14-management
18+
ports:
19+
- 5672:5672
20+
- 15672:15672
1221

1322
steps:
14-
- uses: actions/checkout@v2
23+
- uses: actions/checkout@v4
1524

16-
- name: Setup Python
17-
uses: actions/setup-python@v2
25+
- name: Set up Python 3.10
26+
uses: actions/setup-python@v5
1827
with:
19-
python-version: '3.10'
28+
python-version: "3.10"
2029

21-
- name: Install dependencies
22-
run: pip install -U pre-commit==2.10.0
30+
- name: Install dependencies for test
31+
run: |
32+
pip install .[dev]
2333
24-
- name: Run pre-commit
25-
run: pre-commit run --all-files || ( git status --short ; git diff ; exit 1 )
34+
- name: Run pytest
35+
run: |
36+
pytest -s tests -m "not slow"
2637
27-
test:
28-
needs: [pre-commit]
38+
slow-tests:
2939

30-
strategy:
31-
matrix:
32-
python-version: ['3.9', '3.10']
40+
runs-on: ubuntu-latest
41+
timeout-minutes: 30
3342

3443
services:
35-
rabbitmq:
36-
image: rabbitmq:3.8.14-management
37-
ports:
38-
- 5672:5672
39-
- 15672:15672
40-
41-
runs-on: ubuntu-latest
42-
timeout-minutes: 40
44+
rabbitmq:
45+
image: rabbitmq:3.8.14-management
46+
ports:
47+
- 5672:5672
48+
- 15672:15672
4349

4450
steps:
45-
- uses: actions/checkout@v2
51+
- uses: actions/checkout@v4
4652

47-
- name: Cache Python dependencies
48-
uses: actions/cache@v1
53+
- name: Set up Python 3.10
54+
uses: actions/setup-python@v5
4955
with:
50-
path: ~/.cache/pip
51-
key: pip-${{ matrix.python-version }}-tests-${{ hashFiles('**/setup.json') }}
52-
restore-keys: pip-${{ matrix.python-version }}-tests
56+
python-version: "3.10"
57+
58+
- name: Install dependencies for test
59+
run: |
60+
pip install .[dev]
5361
54-
- name: Set up Python ${{ matrix.python-version }}
55-
uses: actions/setup-python@v2
62+
- name: Run pytest
63+
run: |
64+
pytest -s tests -m "slow"
65+
66+
edge-aiida-core-tests:
67+
# This is to test the plugin is compatible with the main branch of aiida-core
68+
69+
needs: [slow-tests]
70+
runs-on: ubuntu-latest
71+
timeout-minutes: 30
72+
73+
services:
74+
rabbitmq:
75+
image: rabbitmq:3.8.14-management
76+
ports:
77+
- 5672:5672
78+
- 15672:15672
79+
80+
steps:
81+
- uses: actions/checkout@v4
82+
83+
- name: Set up Python 3.10
84+
uses: actions/setup-python@v5
5685
with:
57-
python-version: ${{ matrix.python-version }}
86+
python-version: "3.10"
5887

59-
- name: Install dependencies for test
88+
- name: Install dependencies and edge aiida-core for test
6089
run: |
61-
pip install -U pip==22.3.1
62-
pip install -U .[tests]
90+
pip install .[dev]
91+
pip uninstall --yes aiida-core
92+
git clone --depth 1 https://github.com/aiidateam/aiida-core.git
93+
pip install ./aiida-core
6394
64-
- name: Pull the image and Run pytest
95+
- name: Check aiida-core version is the edget ('post' in version tag)
96+
run: |
97+
if verdi --version | grep -q "post"; then
98+
echo $(verdi --version)
99+
else
100+
echo $(verdi --version)
101+
exit 1
102+
fi
103+
104+
- name: Run pytest
65105
run: |
66-
pytest -sv tests
106+
pytest -s tests

.pre-commit-config.yaml

Lines changed: 13 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -9,48 +9,24 @@ repos:
99
- id: end-of-file-fixer
1010
exclude: &exclude_pre_commit_hooks >
1111
(?x)^(
12-
run_script/_static/.*/.*|
12+
tests/_statics/upf/.*|
1313
)$
1414
- id: trailing-whitespace
1515
exclude: *exclude_pre_commit_hooks
1616

17-
- repo: https://github.com/ikamensh/flynt/
18-
rev: '0.76'
19-
hooks:
20-
- id: flynt
21-
22-
- repo: https://github.com/psf/black
23-
rev: 23.3.0
24-
hooks:
25-
- id: black
26-
language_version: python3 # Should be a command that runs python3.6+
27-
28-
- repo: https://github.com/PyCQA/flake8
29-
rev: 4.0.1
30-
hooks:
31-
- id: flake8
32-
args: [--count, --show-source, --statistics]
33-
additional_dependencies:
34-
- flake8-bugbear==21.3.1
35-
exclude: |
36-
(?x)(
37-
^tests/ |
38-
^examples/ |
39-
^docs/ |
40-
)
41-
42-
- repo: https://github.com/pycqa/isort
43-
rev: 5.12.0
44-
hooks:
45-
- id: isort
46-
args: [--profile, black, --filter-files]
47-
48-
- repo: https://github.com/sirosen/check-jsonschema
49-
rev: 0.14.0
50-
hooks:
51-
- id: check-github-workflows
52-
5317
- repo: https://github.com/kynan/nbstripout
5418
rev: 0.6.1
5519
hooks:
5620
- id: nbstripout
21+
22+
- repo: https://github.com/astral-sh/ruff-pre-commit
23+
rev: v0.4.1
24+
hooks:
25+
- id: ruff-format
26+
exclude: &exclude_ruff >
27+
(?x)^(
28+
examples/.*|
29+
)$
30+
- id: ruff
31+
exclude: *exclude_ruff
32+
args: [--fix, --exit-non-zero-on-fix, --show-fixes]

MANIFEST.in

Lines changed: 0 additions & 2 deletions
This file was deleted.

aiida_sssp_workflow/__init__.py

Lines changed: 0 additions & 8 deletions
This file was deleted.

aiida_sssp_workflow/cli/tools/__init__.py

Lines changed: 0 additions & 4 deletions
This file was deleted.

aiida_sssp_workflow/cli/tools/dump.py

Lines changed: 0 additions & 77 deletions
This file was deleted.

0 commit comments

Comments
 (0)