Skip to content

Commit

Permalink
Updating examples to work with new version of aiida-wannier90.
Browse files Browse the repository at this point in the history
ToDo: update also the structure loading and codes.
  • Loading branch information
Miki Bonacci committed Jan 21, 2024
1 parent afc059c commit 696c6c2
Show file tree
Hide file tree
Showing 16 changed files with 727 additions and 95 deletions.
5 changes: 3 additions & 2 deletions aiida_yambo_wannier90/workflows/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -800,8 +800,9 @@ def setup_kmesh(self) -> None:
def should_run_yambo_commensurate(self) -> bool:
"""Whether to run again yambo on the commensurate kmesh."""

if "GW_mesh" in self.inputs and not 'parent_folder' in self.inputs["yambo_qp"]:
return True
if "yambo_qp" in self.inputs.keys():
if "GW_mesh" in self.inputs and not 'parent_folder' in self.inputs["yambo_qp"]:
return True

if not self.should_run_yambo_convergence():
return False
Expand Down
1 change: 0 additions & 1 deletion examples/README.tct

This file was deleted.

13 changes: 4 additions & 9 deletions examples/example_01.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,11 @@
from aiida import cmdline, orm

from aiida_wannier90_workflows.cli.params import RUN
from aiida_wannier90_workflows.common.types import WannierProjectionType
from aiida_wannier90_workflows.utils.workflows.builder.serializer import print_builder
from aiida_wannier90_workflows.utils.kpoints import get_explicit_kpoints_from_mesh
from aiida_wannier90_workflows.utils.structure import read_structure
from aiida_wannier90_workflows.utils.workflows.builder import (
print_builder,
set_kpoints,
set_num_bands,
set_parallelization,
submit_and_add_group,
)
from aiida_wannier90_workflows.utils.workflows.builder.setter import set_parallelization, set_num_bands
from aiida_wannier90_workflows.utils.workflows.builder.submit import submit_and_add_group
from aiida_wannier90_workflows.common.types import WannierProjectionType
from aiida_wannier90_workflows.workflows import Wannier90BandsWorkChain

INPUT_DIR = pathlib.Path(__file__).absolute().parent / "input_files" / "example_01"
Expand Down
12 changes: 4 additions & 8 deletions examples/example_02.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,10 @@
from aiida_quantumespresso.workflows.pw.base import PwBaseWorkChain

from aiida_wannier90_workflows.cli.params import RUN, FilteredWorkflowParamType
from aiida_wannier90_workflows.utils.workflows.builder import (
print_builder,
set_parallelization,
submit_and_add_group,
)
from aiida_wannier90_workflows.utils.workflows.builder.generator import (
get_pwbands_builder,
)
from aiida_wannier90_workflows.utils.workflows.builder.serializer import print_builder
from aiida_wannier90_workflows.utils.workflows.builder.setter import set_parallelization, set_num_bands
from aiida_wannier90_workflows.utils.workflows.builder.submit import submit_and_add_group
from aiida_wannier90_workflows.utils.workflows.builder.generator import get_pwbands_builder
from aiida_wannier90_workflows.workflows import Wannier90BandsWorkChain


Expand Down
9 changes: 3 additions & 6 deletions examples/example_03.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,9 @@

from aiida_wannier90_workflows.cli.params import RUN
from aiida_wannier90_workflows.utils.kpoints import create_kpoints_from_mesh
from aiida_wannier90_workflows.utils.workflows.builder import (
print_builder,
set_kpoints,
set_parallelization,
submit_and_add_group,
)
from aiida_wannier90_workflows.utils.workflows.builder.serializer import print_builder
from aiida_wannier90_workflows.utils.workflows.builder.setter import set_parallelization, set_kpoints, set_num_bands
from aiida_wannier90_workflows.utils.workflows.builder.submit import submit_and_add_group


def submit(group: orm.Group = None, run: bool = False):
Expand Down
7 changes: 3 additions & 4 deletions examples/example_04.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@
from aiida import cmdline, orm

from aiida_wannier90_workflows.cli.params import RUN
from aiida_wannier90_workflows.utils.workflows.builder import (
print_builder,
submit_and_add_group,
)
from aiida_wannier90_workflows.utils.workflows.builder.serializer import print_builder
from aiida_wannier90_workflows.utils.workflows.builder.setter import set_parallelization, set_num_bands
from aiida_wannier90_workflows.utils.workflows.builder.submit import submit_and_add_group


def submit(group: orm.Group = None, run: bool = False):
Expand Down
7 changes: 3 additions & 4 deletions examples/example_05.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@
from aiida import cmdline, orm

from aiida_wannier90_workflows.cli.params import RUN
from aiida_wannier90_workflows.utils.workflows.builder import (
print_builder,
submit_and_add_group,
)
from aiida_wannier90_workflows.utils.workflows.builder.serializer import print_builder
from aiida_wannier90_workflows.utils.workflows.builder.setter import set_parallelization, set_num_bands
from aiida_wannier90_workflows.utils.workflows.builder.submit import submit_and_add_group

from aiida_yambo_wannier90.calculations.gw2wannier90 import Gw2wannier90Calculation

Expand Down
14 changes: 6 additions & 8 deletions examples/example_06.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,12 @@
get_explicit_kpoints_from_mesh,
get_kpoints_from_bands,
)
from aiida_wannier90_workflows.utils.workflows.builder import (
get_metadata,
print_builder,
set_kpoints,
set_num_bands,
set_parallelization,
submit_and_add_group,
)
from aiida_wannier90_workflows.utils.pseudo.data import get_metadata
from aiida_wannier90_workflows.utils.workflows.builder.serializer import print_builder
from aiida_wannier90_workflows.utils.workflows.builder.setter import set_parallelization, set_kpoints, set_num_bands
from aiida_wannier90_workflows.utils.workflows.builder.submit import submit_and_add_group
from aiida_wannier90_workflows.common.types import WannierProjectionType

from aiida_wannier90_workflows.workflows.bands import Wannier90BandsWorkChain
from aiida_wannier90_workflows.workflows.base.wannier90 import Wannier90BaseWorkChain

Expand Down
8 changes: 3 additions & 5 deletions examples/example_07.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@
from aiida import cmdline, orm

from aiida_wannier90_workflows.cli.params import RUN
from aiida_wannier90_workflows.utils.workflows.builder import (
print_builder,
submit_and_add_group,
)

from aiida_wannier90_workflows.utils.workflows.builder.serializer import print_builder
from aiida_wannier90_workflows.utils.workflows.builder.setter import set_parallelization, set_num_bands
from aiida_wannier90_workflows.utils.workflows.builder.submit import submit_and_add_group

def submit(group: orm.Group = None, run: bool = False):
"""Submit a ``YamboConvergence``."""
Expand Down
8 changes: 3 additions & 5 deletions examples/example_08.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,9 @@

from aiida_wannier90_workflows.cli.params import RUN
from aiida_wannier90_workflows.utils.kpoints import get_kpoints_from_bands
from aiida_wannier90_workflows.utils.workflows.builder import (
print_builder,
set_parallelization,
submit_and_add_group,
)
from aiida_wannier90_workflows.utils.workflows.builder.serializer import print_builder
from aiida_wannier90_workflows.utils.workflows.builder.setter import set_parallelization, set_num_bands
from aiida_wannier90_workflows.utils.workflows.builder.submit import submit_and_add_group
from aiida_wannier90_workflows.workflows.bands import Wannier90BandsWorkChain


Expand Down
8 changes: 3 additions & 5 deletions examples/example_09_Cu.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,9 @@
from aiida import cmdline, orm

from aiida_wannier90_workflows.cli.params import RUN
from aiida_wannier90_workflows.utils.workflows.builder import (
print_builder,
set_parallelization,
submit_and_add_group,
)
from aiida_wannier90_workflows.utils.workflows.builder.serializer import print_builder
from aiida_wannier90_workflows.utils.workflows.builder.setter import set_parallelization, set_num_bands
from aiida_wannier90_workflows.utils.workflows.builder.submit import submit_and_add_group


def submit(group: orm.Group = None, run: bool = False):
Expand Down
Loading

0 comments on commit 696c6c2

Please sign in to comment.