Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValueError in EOS workchain excepted #225

Closed
atztogo opened this issue Sep 19, 2021 · 2 comments · Fixed by #226
Closed

ValueError in EOS workchain excepted #225

atztogo opened this issue Sep 19, 2021 · 2 comments · Fixed by #226

Comments

@atztogo
Copy link

atztogo commented Sep 19, 2021

I got ValueError in running EOS workchain (Excepted). There may exist a problem at the following line:

structure = scale_structure(self.inputs.structure, scale_factor)

scale_factor -> orm.Float(scale_factor).

By this, the EOS workchain finished [0].

My environment is as follow:

aiida-common-workflows: 33d0198 (latest master)
aiida-core: v1.6.5 (modified to ignore raising SGE issue #174 in scheduler)
aiida-quantumespresso: 926b785ef (Thu Sep 16 18:08:24 2021 +0200)

My inputs is

inputs = {
    'scale_factors': List(list=[0.98, 1, 1.02]),
    'structure': structure,
    'sub_process_class': 'common_workflows.relax.quantum_espresso',
    'generator_inputs': {
        'engines': {
            'relax': {
                'code': load_code(1435),
                'options': {
                    'resources': {
                        'parallel_env': "mpi*",
                        'tot_num_mpiprocs': 24,
                    }
                }
            }
        },
        'electronic_type': 'insulator',
        'protocol': 'moderate',
        'relax_type': 'none'
    }
}

and the report was

% verdi process report 19741
2021-09-19 05:58:59 [6388 | REPORT]: [19741|EquationOfStateWorkChain|run_init]: 0.98
2021-09-19 05:58:59 [6389 | REPORT]: [19741|EquationOfStateWorkChain|on_except]: Traceback (most recent call last):
  File "/home/togo/.miniconda/envs/demo/lib/python3.8/site-packages/plumpy/process_states.py", line 231, in execute
    result = self.run_fn(*self.args, **self.kwargs)
  File "/home/togo/aiida-demo/aiida-core/aiida/engine/processes/workchains/workchain.py", line 197, in run
    return self._do_step()
  File "/home/togo/aiida-demo/aiida-core/aiida/engine/processes/workchains/workchain.py", line 214, in _do_step
    finished, stepper_result = self._stepper.step()
  File "/home/togo/.miniconda/envs/demo/lib/python3.8/site-packages/plumpy/workchains.py", line 299, in step
    finished, result = self._child_stepper.step()
  File "/home/togo/.miniconda/envs/demo/lib/python3.8/site-packages/plumpy/workchains.py", line 250, in step
    return True, self._fn(self._workchain)
  File "/home/togo/aiida-demo/aiida-common-workflows/aiida_common_workflows/workflows/eos.py", line 154, in run_init
    builder, structure = self.get_sub_workchain_builder(scale_factor)
  File "/home/togo/aiida-demo/aiida-common-workflows/aiida_common_workflows/workflows/eos.py", line 138, in get_sub_workchain_builder
    structure = scale_structure(self.inputs.structure, scale_factor)
  File "/home/togo/aiida-demo/aiida-core/aiida/engine/processes/functions.py", line 179, in decorated_function
    result, _ = run_get_node(*args, **kwargs)
  File "/home/togo/aiida-demo/aiida-core/aiida/engine/processes/functions.py", line 131, in run_get_node
    process = process_class(inputs=inputs, runner=runner)
  File "/home/togo/.miniconda/envs/demo/lib/python3.8/site-packages/plumpy/base/state_machine.py", line 193, in __call__
    inst.transition_to(inst.create_initial_state())
  File "/home/togo/.miniconda/envs/demo/lib/python3.8/site-packages/plumpy/base/state_machine.py", line 335, in transition_to
    self.transition_failed(initial_state_label, label, *sys.exc_info()[1:])
  File "/home/togo/.miniconda/envs/demo/lib/python3.8/site-packages/plumpy/base/state_machine.py", line 351, in transition_failed
    raise exception.with_traceback(trace)
  File "/home/togo/.miniconda/envs/demo/lib/python3.8/site-packages/plumpy/base/state_machine.py", line 320, in transition_to
    self._enter_next_state(new_state)
  File "/home/togo/.miniconda/envs/demo/lib/python3.8/site-packages/plumpy/base/state_machine.py", line 382, in _enter_next_state
    self._fire_state_event(StateEventHook.ENTERING_STATE, next_state)
  File "/home/togo/.miniconda/envs/demo/lib/python3.8/site-packages/plumpy/base/state_machine.py", line 299, in _fire_state_event
    callback(self, hook, state)
  File "/home/togo/.miniconda/envs/demo/lib/python3.8/site-packages/plumpy/processes.py", line 324, in <lambda>
    lambda _s, _h, state: self.on_entering(cast(process_states.State, state)),
  File "/home/togo/aiida-demo/aiida-core/aiida/engine/processes/process.py", line 380, in on_entering
    super().on_entering(state)
  File "/home/togo/.miniconda/envs/demo/lib/python3.8/site-packages/plumpy/processes.py", line 669, in on_entering
    call_with_super_check(self.on_create)
  File "/home/togo/.miniconda/envs/demo/lib/python3.8/site-packages/plumpy/base/utils.py", line 29, in call_with_super_check
    wrapped(*args, **kwargs)
  File "/home/togo/aiida-demo/aiida-core/aiida/engine/processes/process.py", line 370, in on_create
    super().on_create()
  File "/home/togo/.miniconda/envs/demo/lib/python3.8/site-packages/plumpy/base/utils.py", line 16, in wrapper
    wrapped(self, *args, **kwargs)
  File "/home/togo/.miniconda/envs/demo/lib/python3.8/site-packages/plumpy/processes.py", line 726, in on_create
    raise ValueError(result)
ValueError: Error occurred validating port 'inputs.scale_factor': value 'scale_factor' is not of the right type. Got '<class 'float'>', expected '(<class 'aiida.orm.nodes.data.data.Data'>,)'
@sphuber
Copy link
Collaborator

sphuber commented Sep 19, 2021

@atztogo you are a true bug-hunter! 😄 Looking at the code the problem is with get_scale_factors. If the input scale_factors is defined, it simply returns that value, which in your case is a List of normal floats (as it should). However, it passes the elements straight to scale_structure which expects a Float node. Weird that this was never reported before. I guess this is because you are the first to use scale_factors instead of the scale_increment and scale_count input. I will submit a fix soon.

@atztogo
Copy link
Author

atztogo commented Oct 21, 2021

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants