Skip to content

Commit

Permalink
Merge branch 'main' into hq
Browse files Browse the repository at this point in the history
  • Loading branch information
unkcpz authored Sep 20, 2024
2 parents f251d71 + 95e8f4b commit 47b8526
Show file tree
Hide file tree
Showing 18 changed files with 441 additions and 89 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ concurrency:

env:
FORCE_COLOR: 1
UV_VERSION: 0.3.0

jobs:

Expand Down Expand Up @@ -45,7 +44,9 @@ jobs:
python-version: ${{ matrix.python-version }}

- name: Install uv
run: curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/uv/releases/download/${{ env.UV_VERSION }}/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 }}
Expand Down
5 changes: 2 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# syntax=docker/dockerfile:1
# TODO: change full-stack version to latest one when released with bc and late dameon start
ARG FULL_STACK_VER=edge
ARG UV_VER=0.2.27
ARG FULL_STACK_VER=2024.1023
ARG UV_VER=0.4.7
ARG QE_VER=7.2
ARG QE_DIR=/opt/conda/envs/quantum-espresso-${QE_VER}
ARG HQ_VER=0.19.0
Expand Down
6 changes: 5 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,16 @@ build-backend = "setuptools.build_meta"
[tool.pytest.ini_options]
addopts = '--strict-config --strict-markers --durations=30 --durations-min=1 -ra'
filterwarnings = [
'ignore:Object of type .* not in session, .* operation along .* will not proceed:',
# This is needed since SQLAlchemy 2.0, see
# https://github.com/aiidalab/aiidalab-widgets-base/issues/605
'ignore:Object of type.*not in session,.*operation along.*will not proceed:',
'ignore:Creating AiiDA configuration:UserWarning:',
'ignore:metadata.*traitlets.traitlets.Unicode object:DeprecationWarning:',
# For some reason we get this error, see
# https://github.com/aiidalab/aiidalab-widgets-base/issues/551
'ignore:Exception ignored in:pytest.PytestUnraisableExceptionWarning:_pytest',
# This popped up in spglib 2.5. Since we still try to support spglib v1,
"ignore:dict interface.*is deprecated.Use attribute interface:DeprecationWarning:",
]

[tool.ruff]
Expand Down
67 changes: 35 additions & 32 deletions qe.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -47,22 +47,24 @@
"\n",
" sys.modules[\"pybel\"] = __import__(\"openbabel\", globals(), locals(), [\"pybel\"]).pybel\n",
"except Exception:\n",
" pass\n",
" pass"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from IPython.display import display\n",
"\n",
"import urllib.parse as urlparse\n",
"from datetime import datetime\n",
"from aiidalab_qe.app.wrapper import AppWrapperContoller, AppWrapperModel, AppWrapperView\n",
"\n",
"import ipywidgets as ipw\n",
"from importlib_resources import files\n",
"from IPython.display import display\n",
"from jinja2 import Environment\n",
"model = AppWrapperModel()\n",
"view = AppWrapperView()\n",
"controller = AppWrapperContoller(model, view)\n",
"\n",
"from aiidalab_qe.app import App\n",
"from aiidalab_qe.app.static import styles, templates\n",
"from aiidalab_qe.version import __version__\n",
"from aiidalab_widgets_base.bug_report import (\n",
" install_create_github_issue_exception_handler,\n",
")"
"display(view)"
]
},
{
Expand All @@ -71,37 +73,38 @@
"metadata": {},
"outputs": [],
"source": [
"env = Environment()\n",
"import urllib.parse as urlparse\n",
"\n",
"from aiidalab_qe.app.main import App\n",
"from aiidalab_widgets_base.bug_report import (\n",
" install_create_github_issue_exception_handler,\n",
")\n",
"\n",
"template = files(templates).joinpath(\"welcome.jinja\").read_text()\n",
"style = files(styles).joinpath(\"style.css\").read_text()\n",
"welcome_message = ipw.HTML(env.from_string(template).render(style=style))\n",
"current_year = datetime.now().year\n",
"footer = ipw.HTML(\n",
" f'<p style=\"text-align:right;\">Copyright (c) {current_year} AiiDAlab team &#8195Version: {__version__}</p>'\n",
"install_create_github_issue_exception_handler(\n",
" view.output,\n",
" url=\"https://github.com/aiidalab/aiidalab-qe/issues/new\",\n",
" labels=(\"bug\", \"automated-report\"),\n",
")\n",
"\n",
"url = urlparse.urlsplit(jupyter_notebook_url) # noqa F821\n",
"query = urlparse.parse_qs(url.query)\n",
"\n",
"\n",
"app_with_work_chain_selector = App(qe_auto_setup=True)\n",
"# if a pk is provided in the query string, set it as the value of the work_chain_selector\n",
"if \"pk\" in query:\n",
" pk = int(query[\"pk\"][0])\n",
" app_with_work_chain_selector.work_chain_selector.value = pk\n",
"\n",
"output = ipw.Output()\n",
"install_create_github_issue_exception_handler(\n",
" output,\n",
" url=\"https://github.com/aiidalab/aiidalab-qe/issues/new\",\n",
" labels=(\"bug\", \"automated-report\"),\n",
")\n",
"\n",
"with output:\n",
" display(welcome_message, app_with_work_chain_selector, footer)\n",
"\n",
"display(output)"
"view.main.children = [app_with_work_chain_selector]"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"controller.enable_toggles()"
]
}
],
Expand Down
6 changes: 0 additions & 6 deletions src/aiidalab_qe/app/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1 @@
"""Package for the AiiDAlab QE app."""

from .main import App

__all__ = [
"App",
]
40 changes: 40 additions & 0 deletions src/aiidalab_qe/app/static/styles/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,43 @@
max-width: none !important;
}
/* end override */

.app-header {
margin-bottom: 1em;
}

.logo {
text-align: center;
}

#subtitle {
text-align: center;
font-style: italic;
}

.info-toggles {
margin: 0 auto;
}
.info-toggles button {
width: 100px;
margin: 1em 0.5em;
}
.info-toggles button:focus {
outline: none !important;
}

.guide ol {
list-style: none;
}
.guide p:not(:last-of-type) {
margin-bottom: 0.5em;
}

#loading {
text-align: center;
font-size: large;
}

footer {
text-align: right;
}
15 changes: 15 additions & 0 deletions src/aiidalab_qe/app/static/styles/infobox.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.info-box {
display: none;
margin: 2px;
padding: 1em;
border: 3px solid orangered;
background-color: #ffedcc;
border-radius: 1em;
-webkit-border-radius: 1em;
-moz-border-radius: 1em;
-ms-border-radius: 1em;
-o-border-radius: 1em;
}
.info-box p {
line-height: 24px;
}
10 changes: 10 additions & 0 deletions src/aiidalab_qe/app/static/templates/about.jinja
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<div class="about">
<p>
The <a href="https://www.quantum-espresso.org/" target="_blank">Quantum ESPRESSO</a> app
(or QE app for short) is a graphical front end for calculating materials properties using
Quantum ESPRESSO (QE). Each property is calculated by workflows powered by the
<a href="https://www.aiida.net/" target="_bland"> AiiDA engine</a>, and maintained in the
<a href="https://aiida-quantumespresso.readthedocs.io/en/latest/" target="_blank">aiida-quantumespresso plugin</a> and many other plugins developed by the community.
for AiiDA.
</p>
</div>
42 changes: 42 additions & 0 deletions src/aiidalab_qe/app/static/templates/guide.jinja
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<div class="guide">
<p>
The QE app allows you to calculate properties in a simple 4-step process:
</p>

<ol>
<li>
🔍 <strong>Step 1:</strong> Select the structure you want to run.
</li>
<li>
⚙️ <strong>Step 2:</strong> Select the properties you are interested in.
</li>
<li>
💻 <strong>Step 3:</strong> Choose the computational resources you want to run on.
</li>
<li>
🚀 <strong>Step 4:</strong> Submit your workflow.
</li>
</ol>

<p>
New users can go straight to the first step and select their structure.
</p>

<p>
Completed workflows can be selected at the top of the app.
</p>

<p>
You can also check out the
<a href="https://aiidalab-qe.readthedocs.io/tutorials/basic.html" target="_blank">basic</a> tutorial to get started
with the Quantum ESPRESSO app, or try out the
<a href="https://aiidalab-qe.readthedocs.io/tutorials/advanced.html" target="_blank">advanced</a> tutorial to learn
additional features offered by the app.
</p>

<p>
For a more in-depth dive into the app's features, please refer to the
<a href="https://aiidalab-qe.readthedocs.io/howto/index.html" target="_blank">how-to guides</a>.
</p>
</p>
</div>
28 changes: 0 additions & 28 deletions src/aiidalab_qe/app/static/templates/welcome.jinja

This file was deleted.

6 changes: 0 additions & 6 deletions src/aiidalab_qe/app/static/templates/workflow_failure.jinja
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
<head>
<style>
{{ style }}
</style>
</head>

<body>

<div class="alert alert-danger error-container">
Expand Down
6 changes: 0 additions & 6 deletions src/aiidalab_qe/app/static/templates/workflow_summary.jinja
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
<head>
<style>
{{ style }}
</style>
</head>

<body>

<div class="row">
Expand Down
Loading

0 comments on commit 47b8526

Please sign in to comment.