Skip to content

Commit

Permalink
Merge branch 'main' into bands_projwfn
Browse files Browse the repository at this point in the history
  • Loading branch information
AndresOrtegaGuerrero committed Sep 25, 2024
2 parents f8ad5f4 + 7e45607 commit 312cacc
Show file tree
Hide file tree
Showing 78 changed files with 1,481 additions and 860 deletions.
16 changes: 9 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@ jobs:

strategy:
matrix:
tag: [latest]
python-version: ['3.9', '3.10']
aiida-core-version: [2.3, 2.5]
python-version: ['3.9', '3.11']
aiida-core-version: ['2.3', '2.6']
fail-fast: false

runs-on: ubuntu-latest
Expand All @@ -45,15 +44,18 @@ jobs:
python-version: ${{ matrix.python-version }}

- name: Install uv
run: curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/uv/releases/download/0.2.13/uv-installer.sh | sh
uses: astral-sh/setup-uv@v1
with:
version: 0.4.7

- name: Install package
run: uv pip install --system -e .[dev] aiida-core==${{ matrix.aiida-core-version }}

- name: Run pytest
run: pytest -v tests --cov=aiidalab_qe
env:
TAG: ${{ matrix.tag }}
# Only collect code coverage with aiida-core=2.3, to speed up tests
# with higher aiida versions that for some reason run slower, see:
# https://github.com/aiidalab/aiidalab-qe/issues/766
run: pytest -v tests ${{ matrix.aiida-core-version == '2.3' && '--cov=aiidalab_qe' || '' }}

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
build/
export/
.do-not-setup-on-localhost

.mypy_cache/

# Sphinx documentation
docs/html
Expand Down
18 changes: 3 additions & 15 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,28 +24,16 @@ repos:
hooks:
- id: check-github-workflows

- repo: https://github.com/nbQA-dev/nbQA
rev: 1.8.5
hooks:
- id: nbqa-pyupgrade
args: [--py38-plus]
- id: nbqa-isort
args: [--profile=black]
- id: nbqa-ruff
# suppress E402
args: [--ignore=E402]

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

- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.5.0
rev: v0.6.1
hooks:
# Run the linter.
- id: ruff
types_or: [python, pyi, jupyter]
args: [--fix]
# Run the formatter.
- id: ruff-format
types_or: [python, pyi, jupyter]
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# syntax=docker/dockerfile:1
ARG FULL_STACK_VER=2024.1021
ARG UV_VER=0.2.27
ARG FULL_STACK_VER=2024.1022
ARG UV_VER=0.4.7
ARG QE_VER=7.2
ARG QE_DIR=/opt/conda/envs/quantum-espresso-${QE_VER}

Expand Down Expand Up @@ -86,7 +86,7 @@ COPY --from=qe_conda_env ${QE_DIR} ${QE_DIR}

USER root
COPY ./before-notebook.d/* /usr/local/bin/before-notebook.d/
RUN fix-permissions "${CONDA_DIR}"

# Remove content of $HOME
# '-mindepth=1' ensures that we do not remove the home directory itself.
RUN find /home/${NB_USER}/ -mindepth 1 -delete
Expand Down
18 changes: 14 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

## About

This is a early-development implementation of an AiiDAlab application for Quantum ESPRESSO workflow.
The app allows the execution of a workflow with Quantum ESPRESSO that includes the selection of an input structure, its relaxation, and the bands structure calculation.
This is an AiiDAlab application for Quantum ESPRESSO workflows.
The app allows the execution of a workflow with Quantum ESPRESSO that includes the selection of an input structure, its relaxation, the bands structure calculation, and more!

**The app is currently in an early development stage!**

Expand Down Expand Up @@ -41,6 +41,16 @@ Then, you can run the integration tests with:
pytest --driver Chrome tests_integration
```

### Published Docker images

Supported tags released on [Github Container Registry](https://ghcr.io/aiidalab):

- `edge` – the latest commit on the default branch (`main`)
- `latest` – the latest stable release
- `$version` – the version of a specific release (ex. `2022.1001`)

Pull requests into the default branch are further released on ghcr.io with the `pr-###` tag to simplify the testing of development versions.

## For maintainers

To create a new release, clone the repository, install development dependencies with `pip install '.[dev]'`, and then execute `bumpver update`.
Expand All @@ -61,9 +71,9 @@ Additional notes:
## Acknowledgements
We acknowledge support from:
* the European Union\'s Horizon 2020 research and innovation programme (Grant No. 957189, [project BIG-MAP](https://www.big-map.eu)).
* the [MARVEL National Centre for Competency in Research](<http://nccr-marvel.ch>) funded by the [Swiss National Science Foundation](<http://www.snf.ch/en>).
* the [MARVEL National Centre for Competency in Research](https://nccr-marvel.ch/) funded by the [Swiss National Science Foundation](https://www.snf.ch/en).
* the MARKETPLACE project funded by [Horizon 2020](https://ec.europa.eu/programmes/horizon2020/) under the H2020-NMBP-25-2017 call (Grant No. 760173).
* the [MaX European Centre of Excellence](<http://www.max-centre.eu/>) funded by the Horizon 2020 EINFRA-5 program (Grant No. 676598).
* the [MaX European Centre of Excellence](https://www.max-centre.eu/) funded by the Horizon 2020 EINFRA-5 program (Grant No. 676598).

<div style="text-align:left">
<img src="miscellaneous/logos/MARVEL.png" alt="MARVEL" height="75px">
Expand Down
48 changes: 29 additions & 19 deletions delete.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,19 @@
"import urllib.parse as urlparse\n",
"\n",
"import ipywidgets as widgets\n",
"from IPython.display import Markdown, display\n",
"\n",
"from aiida import load_profile\n",
"from aiida.orm import load_node\n",
"from aiida.tools import delete_nodes\n",
"from IPython.display import Markdown, display\n",
"\n",
"# Load AiiDA profile\n",
"load_profile()\n",
"\n",
"# Parse the primary key from the Jupyter notebook URL\n",
"url = urlparse.urlsplit(jupyter_notebook_url) # noqa F821\n",
"url = urlparse.urlsplit(jupyter_notebook_url) # noqa F821\n",
"query = urlparse.parse_qs(url.query)\n",
"pk = int(query['pk'][0])\n",
"pk = int(query[\"pk\"][0])\n",
"\n",
"\n",
"def display_node_details(pk):\n",
Expand All @@ -41,7 +42,7 @@
" print(f\"Description: {node.description}\")\n",
" print(f\"Creation Time: {node.ctime}\")\n",
" except Exception as e:\n",
" print(f\"Error loading node: {str(e)}\")\n",
" print(f\"Error loading node: {e!s}\")\n",
" return False\n",
" return True\n",
"\n",
Expand All @@ -50,31 +51,36 @@
" if dry_run:\n",
" _, was_deleted = delete_nodes([pk], dry_run=True)\n",
" if was_deleted:\n",
" print(f'Dry run: Node {pk} can be deleted.')\n",
" print(f\"Dry run: Node {pk} can be deleted.\")\n",
" return\n",
" \n",
"\n",
" _, was_deleted = delete_nodes([pk], dry_run=False)\n",
" if was_deleted:\n",
" print(f'Node {pk} deleted successfully.')\n",
" print(f\"Node {pk} deleted successfully.\")\n",
"\n",
"\n",
"def confirm_deletion(b):\n",
" if delete_confirmation.value.lower() in ['y', 'yes']:\n",
"def confirm_deletion(_):\n",
" if delete_confirmation.value.lower() in (\"y\", \"yes\"):\n",
" delete_node(pk, dry_run=False)\n",
" else:\n",
" print('Deletion aborted.')\n",
" print(\"Deletion aborted.\")\n",
"\n",
"\n",
"def find_linked_qeapp_jobs(root_node_pk, process_label='QeAppWorkChain'):\n",
"def find_linked_qeapp_jobs(root_node_pk, process_label=\"QeAppWorkChain\"):\n",
" \"\"\"Query all linked node with process_label = QeAppWorkChain.\"\"\"\n",
" from aiida.orm import Node, QueryBuilder\n",
" from aiida.orm.nodes.process.workflow.workchain import WorkChainNode\n",
"\n",
" qb = QueryBuilder()\n",
" qb.append(WorkChainNode, filters={'id': root_node_pk}, tag='root')\n",
" qb.append(Node, with_incoming='root', tag='calcjob')\n",
" qb.append(WorkChainNode, filters={\"id\": root_node_pk}, tag=\"root\")\n",
" qb.append(Node, with_incoming=\"root\", tag=\"calcjob\")\n",
" # There are seems a bug with `with_ancestors` in the QueryBuilder, so we have to use `with_incoming` instead.\n",
" # For the moment, it's safe to use `with_incoming` since we check it very time we delete a QEApp \n",
" qb.append(WorkChainNode, filters={'attributes.process_label': 'QeAppWorkChain'}, with_incoming='calcjob')\n",
" # For the moment, it's safe to use `with_incoming` since we check it very time we delete a QEApp\n",
" qb.append(\n",
" WorkChainNode,\n",
" filters={\"attributes.process_label\": process_label},\n",
" with_incoming=\"calcjob\",\n",
" )\n",
" results = qb.all()\n",
" if len(results) == 0:\n",
" return None\n",
Expand All @@ -96,12 +102,16 @@
" else:\n",
" # Ask for confirmation\n",
" nodes, _ = delete_nodes([pk], dry_run=True)\n",
" display(Markdown(f'**YOU ARE ABOUT TO DELETE `{len(nodes)}` NODES! THIS CANNOT BE UNDONE!**'))\n",
" display(\n",
" Markdown(\n",
" f\"**YOU ARE ABOUT TO DELETE `{len(nodes)}` NODES! THIS CANNOT BE UNDONE!**\"\n",
" )\n",
" )\n",
" delete_confirmation = widgets.Text(\n",
" value='',\n",
" value=\"\",\n",
" placeholder='Type \"yes\" to confirm',\n",
" description='Confirm:',\n",
" disabled=False\n",
" description=\"Confirm:\",\n",
" disabled=False,\n",
" )\n",
" confirm_button = widgets.Button(description=\"Delete Node\")\n",
" confirm_button.on_click(confirm_deletion)\n",
Expand Down
2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ sphinxcontrib-serializinghtml==1.1.5
# via sphinx
typing-extensions==4.8.0
# via pydata-sphinx-theme
urllib3==2.0.7
urllib3==2.2.2
# via requests
zipp==3.19.1
# via importlib-metadata
9 changes: 1 addition & 8 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,8 @@
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
# import os
# import sys
import time

# sys.path.insert(0, os.path.abspath('.'))

# -- Project information -----------------------------------------------------

version = "v24.10.0a1"
Expand All @@ -30,9 +25,7 @@
if current_year == copyright_first_year
else f"{copyright_first_year}-{current_year}"
)
copyright = "{}, {}. All rights reserved".format(
copyright_year_string, copyright_owners
)
copyright = f"{copyright_year_string}, {copyright_owners}. All rights reserved" # noqa: A001

# If true, sectionauthor and moduleauthor directives will be shown in the
# output. They are ignored by default.
Expand Down
Loading

0 comments on commit 312cacc

Please sign in to comment.