Skip to content

Commit

Permalink
Bump awb to 2.1.0a0
Browse files Browse the repository at this point in the history
  • Loading branch information
unkcpz committed Oct 21, 2023
1 parent 0006ac2 commit 2fd4ab5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 19 deletions.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ install_requires =
aiida-core~=2.2,<3
Jinja2~=3.0
aiida-quantumespresso~=4.3.0
aiidalab-widgets-base~=2.0.2
aiidalab-widgets-base==2.1.0a0
filelock~=3.8
importlib-resources~=5.2
widget-bandsplot~=0.5.1
Expand Down
30 changes: 13 additions & 17 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import io
import pathlib
import tempfile
Expand Down Expand Up @@ -301,15 +303,10 @@ def app(pw_code, dos_code, projwfc_code):
app.submit_step.pw_code.refresh()
app.submit_step.codes["dos"].refresh()
app.submit_step.codes["projwfc"].refresh()
app.submit_step.pw_code.value = (
app.submit_step.pw_code.code_select_dropdown.options[pw_code.full_label]
)
app.submit_step.codes["dos"].value = app.submit_step.codes[
"dos"
].code_select_dropdown.options[dos_code.full_label]
app.submit_step.codes["projwfc"].value = app.submit_step.codes[
"projwfc"
].code_select_dropdown.options[projwfc_code.full_label]

app.submit_step.pw_code.value = pw_code.uuid
app.submit_step.codes["dos"].value = dos_code.uuid
app.submit_step.codes["projwfc"].value = projwfc_code.uuid

yield app

Expand Down Expand Up @@ -558,12 +555,15 @@ def _generate_bands_workchain(structure):

@pytest.fixture
def generate_qeapp_workchain(
app, generate_workchain, generate_pdos_workchain, generate_bands_workchain
app,
generate_workchain,
generate_pdos_workchain,
generate_bands_workchain,
):
"""Generate an instance of the WorkChain."""

def _generate_qeapp_workchain(
structure=None,
structure: orm.StructureData | None = None,
relax_type="positions_cell",
run_bands=True,
run_pdos=True,
Expand All @@ -580,17 +580,13 @@ def _generate_qeapp_workchain(
s1 = app.structure_step
if structure is None:
from_example = s1.manager.children[0].children[3]
# TODO: (unkpcz) using options to set value in test is cranky, instead, use fixture which will make the test more static and robust.
from_example.children[0].value = from_example.children[0].options[1][1]
else:
structure.store()
aiida_database = s1.manager.children[0].children[2]
aiida_database.search()
key = [
key
for key in aiida_database.results.options
if key.startswith(f"PK: {structure.pk}")
][0]
aiida_database.results.value = aiida_database.results.options[key]
aiida_database.results.value = structure
s1.confirm()
structure = s1.confirmed_structure
# step 2 configure
Expand Down
1 change: 0 additions & 1 deletion tests/test_plugins_bands.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ def test_result(generate_qeapp_workchain):
from aiidalab_qe.plugins.bands.result import Result, export_bands_data

wkchain = generate_qeapp_workchain()
#
data = export_bands_data(wkchain.node.outputs.bands)
assert data is not None
# generate structure for scf calculation
Expand Down

0 comments on commit 2fd4ab5

Please sign in to comment.