Skip to content

Commit d017b55

Browse files
committed
Fix compatibility
1 parent a1b3c25 commit d017b55

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/aiida_common_workflows/workflows/relax/vasp/generator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def _construct_builder(self, **kwargs) -> engine.ProcessBuilder: # noqa: PLR091
8888
builder.structure = structure
8989

9090
# Set options
91-
builder.vasp.calc.options = engines['relax']['options']
91+
builder.vasp.calc.metadata.options = engines['relax']['options']
9292

9393
# Set workchain related inputs, in this case, give more explicit output to report
9494
builder.verbose = True
@@ -154,7 +154,7 @@ def _construct_builder(self, **kwargs) -> engine.ProcessBuilder: # noqa: PLR091
154154

155155
# Set the parameters on the builder, put it in the code namespace to pass through
156156
# to the code inputs
157-
builder.vasp.parameters = parameters_dict
157+
builder.vasp.parameters = {'incar': parameters_dict}
158158

159159
# Set potentials and their mapping
160160
builder.vasp.potential_family = protocol['potential_family']

src/aiida_common_workflows/workflows/relax/vasp/workchain.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Implementation of `aiida_common_workflows.common.relax.workchain.CommonRelaxWorkChain` for VASP."""
2+
import numpy as np
23
from aiida import orm
34
from aiida.common.exceptions import NotExistentAttributeError
45
from aiida.engine import calcfunction
@@ -14,7 +15,7 @@
1415
def get_stress(misc):
1516
"""Return the final stress array."""
1617
stress_data = orm.ArrayData()
17-
stress_kbar = misc['stress']
18+
stress_kbar = np.array(misc['stress'])
1819
stress_ev_per_angstr3 = stress_kbar / 1602.1766208
1920
stress_data.set_array(name='stress', array=stress_ev_per_angstr3)
2021

@@ -25,7 +26,7 @@ def get_stress(misc):
2526
def get_forces(misc):
2627
"""Return the final forces array.."""
2728
forces_data = orm.ArrayData()
28-
forces_data.set_array(name='forces', array=misc['forces'])
29+
forces_data.set_array(name='forces', array=np.array(misc['forces']))
2930

3031
return forces_data
3132

@@ -42,7 +43,7 @@ def get_total_free_energy(misc):
4243
@calcfunction
4344
def get_total_cell_magnetic_moment(misc):
4445
"""Return the total cell magnetic moment."""
45-
magnetization = misc.get_dict()['magnetization']
46+
magnetization = misc.get('magnetization')
4647

4748
if not magnetization:
4849
# If list is empty, we have no magnetization
@@ -63,7 +64,7 @@ class VaspCommonRelaxWorkChain(CommonRelaxWorkChain):
6364
def convert_outputs(self):
6465
"""Convert the outputs of the sub workchain to the common output specification."""
6566
try:
66-
self.out('relaxed_structure', self.ctx.workchain.outputs.relax__structure)
67+
self.out('relaxed_structure', self.ctx.workchain.outputs.relax.structure)
6768
except NotExistentAttributeError:
6869
# We have no control of when we want to perform relaxations here,
6970
# this is up to the calling workchains, so do not set the relaxed structure if a

0 commit comments

Comments
 (0)