Skip to content

Commit

Permalink
Merge pull request #673 from aiidateam/release/3.4.1
Browse files Browse the repository at this point in the history
Release `v3.4.1`
  • Loading branch information
sphuber authored Apr 14, 2021
2 parents a08d08c + 6beb957 commit 33cb11e
Show file tree
Hide file tree
Showing 14 changed files with 46 additions and 41 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
- name: Install system dependencies
run: |
sudo apt update
sudo apt install postgresql-10
sudo apt install postgresql-12
- name: Install python dependencies
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
- name: Install system dependencies
run: |
sudo apt update
sudo apt install postgresql-10
sudo apt install postgresql-12
- name: Install python dependencies
continue-on-error: true
Expand Down
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
## v3.4.1

### Dependencies
- Dependencies: update to `aiida-pseudo==0.6.0` [[#671]](https://github.com/aiidateam/aiida-quantumespresso/pull/#671)

### Documentation
- Docs: fix `gamma_only` value in `settings_dict` [[#672]](https://github.com/aiidateam/aiida-quantumespresso/pull/#672)

### Devops
- CI: use `postgres-12` for Github Actions since `ubuntu-latest` was updated to Ubuntu Focal 20.04 [[#674]](https://github.com/aiidateam/aiida-quantumespresso/pull/#674)


## v3.4.0

### Features
Expand Down
2 changes: 1 addition & 1 deletion aiida_quantumespresso/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# -*- coding: utf-8 -*-
"""The official AiiDA plugin for Quantum ESPRESSO."""
__version__ = '3.4.0'
__version__ = '3.4.1'
7 changes: 3 additions & 4 deletions aiida_quantumespresso/cli/calculations/cp.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,10 @@ def launch_calculation(code, structure, pseudo_family, max_num_machines, max_wal
"""Run a CpCalculation."""
from aiida.orm import Dict
from aiida.plugins import CalculationFactory
from qe_tools import CONSTANTS

from aiida_quantumespresso.utils.resources import get_default_options

cutoff_wfc, cutoff_rho = pseudo_family.get_recommended_cutoffs(structure=structure)
cutoff_wfc, cutoff_rho = pseudo_family.get_recommended_cutoffs(structure=structure, unit='Ry')

parameters = {
'CONTROL': {
Expand All @@ -40,8 +39,8 @@ def launch_calculation(code, structure, pseudo_family, max_num_machines, max_wal
'nstep': 10,
},
'SYSTEM': {
'ecutwfc': cutoff_wfc / CONSTANTS.ry_to_ev,
'ecutrho': cutoff_rho / CONSTANTS.ry_to_ev,
'ecutwfc': cutoff_wfc,
'ecutrho': cutoff_rho,
'nr1b': 24,
'nr2b': 24,
'nr3b': 24,
Expand Down
7 changes: 3 additions & 4 deletions aiida_quantumespresso/cli/calculations/neb.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,19 +59,18 @@ def launch_calculation(
"""
from aiida.orm import Dict
from aiida.plugins import CalculationFactory
from qe_tools import CONSTANTS

from aiida_quantumespresso.utils.resources import get_default_options

cutoff_wfc, cutoff_rho = pseudo_family.get_recommended_cutoffs(structure=structures[0])
cutoff_wfc, cutoff_rho = pseudo_family.get_recommended_cutoffs(structure=structures[0], unit='Ry')

pw_parameters = {
'CONTROL': {
'calculation': 'relax',
},
'SYSTEM': {
'ecutwfc': ecutwfc or cutoff_wfc / CONSTANTS.ry_to_ev,
'ecutrho': ecutrho or cutoff_rho / CONSTANTS.ry_to_ev,
'ecutwfc': ecutwfc or cutoff_wfc,
'ecutrho': ecutrho or cutoff_rho
}
}

Expand Down
7 changes: 3 additions & 4 deletions aiida_quantumespresso/cli/calculations/pw.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,19 +58,18 @@ def launch_calculation(
"""Run a PwCalculation."""
from aiida.orm import Dict, KpointsData
from aiida.plugins import CalculationFactory
from qe_tools import CONSTANTS

from aiida_quantumespresso.utils.resources import get_default_options

cutoff_wfc, cutoff_rho = pseudo_family.get_recommended_cutoffs(structure=structure)
cutoff_wfc, cutoff_rho = pseudo_family.get_recommended_cutoffs(structure=structure, unit='Ry')

parameters = {
'CONTROL': {
'calculation': mode,
},
'SYSTEM': {
'ecutwfc': ecutwfc or cutoff_wfc / CONSTANTS.ry_to_ev,
'ecutrho': ecutrho or cutoff_rho / CONSTANTS.ry_to_ev,
'ecutwfc': ecutwfc or cutoff_wfc,
'ecutrho': ecutrho or cutoff_rho,
}
}

Expand Down
7 changes: 3 additions & 4 deletions aiida_quantumespresso/cli/workflows/pw/bands.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,20 @@ def launch_workflow(
# pylint: disable=too-many-statements
from aiida.orm import Bool, Float, Dict
from aiida.plugins import WorkflowFactory
from qe_tools import CONSTANTS

from aiida_quantumespresso.utils.resources import get_default_options, get_automatic_parallelization_options

builder = WorkflowFactory('quantumespresso.pw.bands').get_builder()

cutoff_wfc, cutoff_rho = pseudo_family.get_recommended_cutoffs(structure=structure)
cutoff_wfc, cutoff_rho = pseudo_family.get_recommended_cutoffs(structure=structure, unit='Ry')

parameters = {
'CONTROL': {
'calculation': 'relax',
},
'SYSTEM': {
'ecutwfc': ecutwfc or cutoff_wfc / CONSTANTS.ry_to_ev,
'ecutrho': ecutrho or cutoff_rho / CONSTANTS.ry_to_ev,
'ecutwfc': ecutwfc or cutoff_wfc,
'ecutrho': ecutrho or cutoff_rho,
},
}

Expand Down
7 changes: 3 additions & 4 deletions aiida_quantumespresso/cli/workflows/pw/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,17 @@ def launch_workflow(
"""Run a `PwBaseWorkChain`."""
from aiida.orm import Bool, Float, Dict
from aiida.plugins import WorkflowFactory
from qe_tools import CONSTANTS

from aiida_quantumespresso.utils.resources import get_default_options, get_automatic_parallelization_options

builder = WorkflowFactory('quantumespresso.pw.base').get_builder()

cutoff_wfc, cutoff_rho = pseudo_family.get_recommended_cutoffs(structure=structure)
cutoff_wfc, cutoff_rho = pseudo_family.get_recommended_cutoffs(structure=structure, unit='Ry')

parameters = {
'SYSTEM': {
'ecutwfc': ecutwfc or cutoff_wfc / CONSTANTS.ry_to_ev,
'ecutrho': ecutrho or cutoff_rho / CONSTANTS.ry_to_ev,
'ecutwfc': ecutwfc or cutoff_wfc,
'ecutrho': ecutrho or cutoff_rho,
},
}

Expand Down
7 changes: 3 additions & 4 deletions aiida_quantumespresso/cli/workflows/pw/relax.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,21 +47,20 @@ def launch_workflow(
"""Run a `PwRelaxWorkChain`."""
from aiida.orm import Bool, Float, Dict, Str
from aiida.plugins import WorkflowFactory
from qe_tools import CONSTANTS

from aiida_quantumespresso.utils.resources import get_default_options, get_automatic_parallelization_options

builder = WorkflowFactory('quantumespresso.pw.relax').get_builder()

cutoff_wfc, cutoff_rho = pseudo_family.get_recommended_cutoffs(structure=structure)
cutoff_wfc, cutoff_rho = pseudo_family.get_recommended_cutoffs(structure=structure, unit='Ry')

parameters = {
'CONTROL': {
'calculation': 'relax',
},
'SYSTEM': {
'ecutwfc': ecutwfc or cutoff_wfc / CONSTANTS.ry_to_ev,
'ecutrho': ecutrho or cutoff_rho / CONSTANTS.ry_to_ev,
'ecutwfc': ecutwfc or cutoff_wfc,
'ecutrho': ecutrho or cutoff_rho,
},
}

Expand Down
9 changes: 4 additions & 5 deletions aiida_quantumespresso/workflows/pw/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def validate_pseudo_family(value, _):
class PwBaseWorkChain(ProtocolMixin, BaseRestartWorkChain):
"""Workchain to run a Quantum ESPRESSO pw.x calculation with automated error handling and restarts."""

# pylint: disable=too-many-public-methods
# pylint: disable=too-many-public-methods, too-many-statements

_process_class = PwCalculation

Expand Down Expand Up @@ -140,7 +140,6 @@ def get_builder_from_protocol(
guess for the magnetic moment is automatically set in case this argument is not provided.
:return: a process builder instance with all inputs defined ready for launch.
"""
from qe_tools import CONSTANTS
from aiida_quantumespresso.workflows.protocols.utils import get_starting_magnetization

if isinstance(code, str):
Expand Down Expand Up @@ -176,13 +175,13 @@ def get_builder_from_protocol(
'install it.'
) from exception

cutoff_wfc, cutoff_rho = pseudo_family.get_recommended_cutoffs(structure=structure)
cutoff_wfc, cutoff_rho = pseudo_family.get_recommended_cutoffs(structure=structure, unit='Ry')

parameters = inputs['pw']['parameters']
parameters['CONTROL']['etot_conv_thr'] = natoms * meta_parameters['etot_conv_thr_per_atom']
parameters['ELECTRONS']['conv_thr'] = natoms * meta_parameters['conv_thr_per_atom']
parameters['SYSTEM']['ecutwfc'] = cutoff_wfc / CONSTANTS.ry_to_ev
parameters['SYSTEM']['ecutrho'] = cutoff_rho / CONSTANTS.ry_to_ev
parameters['SYSTEM']['ecutwfc'] = cutoff_wfc
parameters['SYSTEM']['ecutrho'] = cutoff_rho

if electronic_type is ElectronicType.INSULATOR:
parameters['SYSTEM']['occupations'] = 'fixed'
Expand Down
2 changes: 1 addition & 1 deletion docs/source/user_guide/calculation_plugins/pw.rst
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ may want to use the following flag to tell QE to use the gamma-only routines
(typically twice faster)::

settings_dict = {
'gamma_only': False,
'gamma_only': True,
}

Initialization only
Expand Down
4 changes: 2 additions & 2 deletions setup.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
},
"install_requires": [
"aiida_core[atomic_tools]~=1.4,>=1.4.4",
"aiida-pseudo~=0.5.0",
"aiida-pseudo~=0.6.0",
"jsonschema",
"packaging",
"qe-tools~=2.0rc1",
Expand All @@ -103,5 +103,5 @@
"name": "aiida_quantumespresso",
"python_requires": ">=3.6",
"url": "https://github.com/aiidateam/aiida-quantumespresso",
"version": "3.4.0"
"version": "3.4.1"
}
12 changes: 6 additions & 6 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,15 @@ def _serialize_builder(builder):
@pytest.fixture(scope='session', autouse=True)
def sssp(aiida_profile, generate_upf_data):
"""Create an SSSP pseudo potential family from scratch."""
from qe_tools import CONSTANTS
from aiida.common.constants import elements
from aiida.plugins import GroupFactory

aiida_profile.reset_db()

SsspFamily = GroupFactory('pseudo.family.sssp')

cutoffs = {'standard': {}}
cutoffs = {}
stringency = 'standard'

with tempfile.TemporaryDirectory() as dirpath:
for values in elements.values():
Expand All @@ -133,15 +133,15 @@ def sssp(aiida_profile, generate_upf_data):
handle.write(source.read())
handle.flush()

cutoffs['standard'][element] = {
'cutoff_wfc': 30. * CONSTANTS.ry_to_ev,
'cutoff_rho': 240. * CONSTANTS.ry_to_ev
cutoffs[element] = {
'cutoff_wfc': 30.0,
'cutoff_rho': 240.0,
}

label = 'SSSP/1.1/PBE/efficiency'
family = SsspFamily.create_from_folder(dirpath, label)

family.set_cutoffs(cutoffs)
family.set_cutoffs(cutoffs, stringency, unit='Ry')

return family

Expand Down

0 comments on commit 33cb11e

Please sign in to comment.