Skip to content

Commit

Permalink
Merge branch 'main' into fix/916/handle_failed_check
Browse files Browse the repository at this point in the history
  • Loading branch information
superstar54 authored Jan 14, 2025
2 parents 3b654d1 + 2aba67e commit e2800c0
Show file tree
Hide file tree
Showing 185 changed files with 15,945 additions and 8,464 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
# 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' || '' }}
run: pytest -v tests ${{ matrix.aiida-core-version == '2.3' && '--cov=aiidalab_qe' || '' }} --skip-slow

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
Expand Down
3 changes: 3 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
# Required
version: 2

sphinx:
configuration: docs/source/conf.py

# Set the OS, Python version and other tools you might need
build:
os: ubuntu-22.04
Expand Down
8 changes: 7 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# syntax=docker/dockerfile:1
ARG FULL_STACK_VER=2024.1023
ARG FULL_STACK_VER=2025.1025
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 @@ -58,6 +58,12 @@ RUN wget -c -O hq.tar.gz https://github.com/It4innovations/hyperqueue/releases/d
tar xf hq.tar.gz -C /opt/conda/

ENV PSEUDO_FOLDER=/tmp/pseudo
# temporary solution to install aiida-pseudos from repo to avoid downloading issues
RUN --mount=from=uv,source=/uv,target=/bin/uv \
--mount=from=build_deps,source=${UV_CACHE_DIR},target=${UV_CACHE_DIR},rw \
uv pip install --system --strict --cache-dir=${UV_CACHE_DIR} \
"aiida-pseudo@git+https://github.com/aiidateam/aiida-pseudo"

RUN mkdir -p ${PSEUDO_FOLDER} && \
python -m aiidalab_qe download-pseudos --dest ${PSEUDO_FOLDER}

Expand Down
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,18 @@ 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](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](https://www.max-centre.eu/) funded by the Horizon 2020 EINFRA-5 program (Grant No. 676598).
* [MARVEL National Centre for Competency in Research](https://nccr-marvel.ch/) funded by the [Swiss National Science Foundation](https://www.snf.ch/en).
* [BIG-MAP project](https://www.big-map.eu) funded by the Horizon 2020 research and innovation programme (Grant No. 957189).
* [MARKETPLACE project](https://www.the-marketplace-project.eu/) funded by Horizon 2020 under the H2020-NMBP-25-2017 call (Grant No. 760173).
* [MaX European Centre of Excellence](https://www.max-centre.eu/) funded by the Horizon 2020 EINFRA-5 program (Grant No. 676598).
* [DOME 4.0 project](https://dome40.eu/) funded by the EU Horizon 2020 Research and Innovation Programme (Grant No. 953163)

<div style="text-align:left">

<div style="display: flex; flex-wrap: wrap; justify-content: space-around; align-items: center; gap: 50px; text-align: center;">
<img src="miscellaneous/logos/MARVEL.png" alt="MARVEL" height="75px">
<img src="miscellaneous/logos/MaX.png" alt="MaX" height="75px">
<img src="miscellaneous/logos/MarketPlace.png" alt="MarketPlace" height="75px">
</div>
<div style="text-align:left">
<img src="miscellaneous/logos/bigmap_logo.png" alt="BIG-MAP" height="75px">
<img src="miscellaneous/logos/EU_flag.png" alt="EU" height="75px">
<img src="miscellaneous/logos/DOME_4.0.png" alt="DOME 4.0" height="75px">
</div>
138 changes: 138 additions & 0 deletions calculation_history.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"%%javascript\n",
"IPython.OutputArea.prototype._should_scroll = function(lines) {\n",
" return false;\n",
"}\n",
"document.title='AiiDAlab QE app calculation history'"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"%%capture\n",
"from aiida import load_profile\n",
"\n",
"load_profile()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from aiidalab_widgets_base.utils.loaders import load_css\n",
"\n",
"load_css(css_path=\"src/aiidalab_qe/app/static/styles\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import ipywidgets as ipw\n",
"from importlib_resources import files\n",
"from jinja2 import Environment\n",
"\n",
"from aiidalab_qe.app.static import templates\n",
"from aiidalab_qe.common.infobox import InfoBox\n",
"\n",
"title = ipw.HTML(\n",
" \"<h1> Calculation history</h1>\", layout=ipw.Layout(margin=\"0 0 15px 0\")\n",
")\n",
"env = Environment()\n",
"guide_template = (\n",
" files(templates).joinpath(\"calculation_history_guide.jinja\").read_text()\n",
")\n",
"guide = ipw.HTML(env.from_string(guide_template).render())\n",
"\n",
"\n",
"info_container = InfoBox(layout=ipw.Layout(margin=\"14px 2px 0\"))\n",
"guide_toggle = ipw.ToggleButton(\n",
" layout=ipw.Layout(width=\"150px\"),\n",
" button_style=\"\",\n",
" icon=\"book\",\n",
" value=False,\n",
" description=\"Page guide\",\n",
" tooltip=\"Learn how to use the app\",\n",
" disabled=False,\n",
")\n",
"\n",
"\n",
"def _on_guide_toggle(change: dict):\n",
" \"\"\"Toggle the guide section.\"\"\"\n",
" if change[\"new\"]:\n",
" info_container.children = [\n",
" guide,\n",
" ]\n",
" info_container.layout.display = \"flex\"\n",
" else:\n",
" info_container.children = []\n",
" info_container.layout.display = \"none\"\n",
"\n",
"\n",
"guide_toggle.observe(\n",
" _on_guide_toggle,\n",
" \"value\",\n",
")\n",
"\n",
"controls = ipw.VBox(children=[title, guide_toggle, info_container])\n",
"controls"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from aiidalab_qe.app.utils.search_jobs import CalculationHistory\n",
"\n",
"calculation_history = CalculationHistory()\n",
"calculation_history.main"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"calculation_history.load_table()"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "base",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.13"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
8 changes: 4 additions & 4 deletions delete.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# AiiDAlab QuantumESPRESSO App\n",
"# AiiDAlab Quantum ESPRESSO app\n",
"\n",
"<font color=\"red\"><b>Caution!</b></font> Deleting this job will also remove <b>all associated nodes</b>, including every calculation initiated by this job and their respective results. This action is <b>irreversible</b>.\n"
]
Expand Down Expand Up @@ -37,10 +37,10 @@
" try:\n",
" node = load_node(pk)\n",
" print(f\"Node ID: {node.pk}\")\n",
" print(f\"Node Type: {node.process_label}\")\n",
" print(f\"Node type: {node.process_label}\")\n",
" print(f\"Label: {node.label}\")\n",
" print(f\"Description: {node.description}\")\n",
" print(f\"Creation Time: {node.ctime}\")\n",
" print(f\"Creation time: {node.ctime}\")\n",
" except Exception as e:\n",
" print(f\"Error loading node: {e!s}\")\n",
" return False\n",
Expand Down Expand Up @@ -113,7 +113,7 @@
" description=\"Confirm:\",\n",
" disabled=False,\n",
" )\n",
" confirm_button = widgets.Button(description=\"Delete Node\")\n",
" confirm_button = widgets.Button(description=\"Delete node\")\n",
" confirm_button.on_click(confirm_deletion)\n",
" display(delete_confirmation, confirm_button)\n",
"else:\n",
Expand Down
16 changes: 15 additions & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

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

version = "v24.10.0a3"
version = "v24.10.0a6"
release = f"{version}-dev"
project = "Quantum ESPRESSO App"
copyright_first_year = "2023"
Expand Down Expand Up @@ -82,6 +82,20 @@
"image_light": "logo.png",
"image_dark": "logo_dark.png",
},
"icon_links": [
{
"name": "AiiDAlab",
"url": "http://aiidalab.net",
"icon": "fa-solid fa-globe",
"type": "fontawesome",
},
{
"name": "GitHub",
"url": "https://www.github.com/aiidalab/aiidalab-qe",
"icon": "fa-brands fa-square-github",
"type": "fontawesome",
},
],
}

# If true, links to the reST sources are added to the pages.
Expand Down
72 changes: 72 additions & 0 deletions docs/source/development/guides.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
.. _develop:guides:

******
Guides
******

Throughout the app, instances of ``aiidalab_qe.common.infobox.InAppGuide`` have been dropped to provide users with helpful information in the form of toggleable tutorials.
These guide section widgets observe a global instance of ``aiidalab_qe.common.guide_manager.GuideManager`` to obtain their content and toggle their visibility.
The guide manager is initialized at app startup and scans the local codebase, as well as entry-point-based plugins, for defined guides.
The discovered guides are then made available as a nested radio button widget of the form ``category`` -> ``guide``.
This allows both built-in ``general/<guide-name>`` guides and external ``<plugin-identifier>/<guide-name>`` guides, ensuring guide uniqueness.

Developers have two options when using the ``InAppGuide`` widget:

#. **Widget-based guide sections**: Developers can define the guide content directly in the widget's constructor using ``ipywidgets`` widgets.
When using this approach, the developer may provide a ``guide_id`` in the constructor to associate the guide section with a specific guide.
Otherwise, if no ``guide_id`` is provided, the guide section will be displayed for any active guide.

.. code:: python
InAppGuide(
guide_id="general/basic",
children=[
ipw.HTML("Some basic information."),
],
)
#. **HTML-based guide sections**: Developers can define the guide content in an HTML document, tagging the various sections using the HTML ``id`` attribute.
The guide manager will load the HTML document associated with the selected guide and parse it using ``BeautifulSoup``.

.. code:: html

<div id="structure-step">
<p>Some basic information regarding the structure.</p>
</div>

<div id="configuration-step">
<p>Some basic information regarding the configuration.</p>
</div>

...

HTML-based ``InAppGuide`` widgets are instantiated without children (or a guide id), but instead with an ``identifier`` corresponding to the relevant HTML ``id`` attribute.

.. code:: python
InAppGuide(identifier="structure-step")
A decent amount of ``InAppGuide(identifier=<identifier>)`` instances have been placed strategically throughout the app.
Developers may suggest additional core guide sections via GitHub pull requests.
For plugin developers, additional instances of either flavor are recommended to be added in any component of the plugin in conjunction with dedicated plugin-specific guides.

Plugin guides
-------------

Plugin developers can enhance user experience while using the app by introducing custom guides.
To do so, add the following key/value entry in your plugin's ``__init__.py`` file:

.. code:: python
my_plugin = {
...
"guides": <path-to-guide>,
}
where ``path-to-guide`` is the path (``Path`` object or absolute string path) to the directory containing the guide HTML files.
On app start, the guide manager will scan the plugin entry points for the ``guides`` key and load the guides accordingly.

Guide order
-----------

When naming your guide HTML documents, prefix the file name with ``#_``. The number ``#`` will determine the order in which the guides are displayed in the list.
1 change: 1 addition & 0 deletions docs/source/development/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ This guide explains the architecture of the application and how to extend the fu
architecture
plugin
plugin_registry
guides
2 changes: 1 addition & 1 deletion docs/source/development/plugin.rst
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ feed the `metadata` of each Calcjob which is submitted in the workchain. For exa

.. code-block:: python
from aiidalab_qe.plugins.utils import set_component_resources
from aiidalab_qe.utils import set_component_resources
def update_resources(builder, codes):
set_component_resources(builder.pw, codes.get("pw"))
Expand Down
14 changes: 7 additions & 7 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -161,19 +161,19 @@ We acknowledge the `AiiDAlab`_ team for the development of the Quantum ESPRESSO

We also 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 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).
- `BIG-MAP project <https://www.big-map.eu>`_ funded by the Horizon 2020 research and innovation programme (Grant No. 957189).
- `MARVEL National Centre for Competency in Research <http://nccr-marvel.ch>`_ funded by the `Swiss National Science Foundation <http://www.snf.ch/en>`_.
- `MARKETPLACE project <https://www.the-marketplace-project.eu/>`_ funded by Horizon 2020 under the H2020-NMBP-25-2017 call (Grant No. 760173).
- `MaX European Centre of Excellence <http://www.max-centre.eu/>`_ funded by the Horizon 2020 EINFRA-5 program (Grant No. 676598).
- `DOME 4.0 project <https://dome40.eu/>`_ funded by the EU Horizon 2020 Research and Innovation Programme (Grant No. 953163).

.. raw:: html

<div style="text-align:left">
<div style="display: flex; flex-wrap: wrap; justify-content: space-around; align-items: center; gap: 50px; text-align: center;">
<img src="../_static/logos/MARVEL.png" alt="MARVEL" height="75px">
<img src="../_static/logos/MaX.png" alt="MaX" height="75px">
<img src="../_static/logos/MarketPlace.png" alt="MarketPlace" height="75px">
</div>
<div style="text-align:left">
<img src="../_static/logos/bigmap_logo.png" alt="BIG-MAP" height="75px">
<img src="../_static/logos/EU_flag.png" alt="EU" height="75px">
<img src="../_static/logos/DOME_4.0.png" alt="DOME 4.0" height="75px">
</div>
Loading

0 comments on commit e2800c0

Please sign in to comment.