tilde-lab / aiida-crystal-dft

AiiDA plugin for the ab initio modeling suite CRYSTAL, developed in Turin University
MIT License
3 stars 4 forks source link

Bug in guess_oxistates #26

Closed blokhin closed 4 years ago

blokhin commented 4 years ago
root@aiida-repl:~# verdi process report 720
*** 720 [Be5Zr/191/hP6: Geometry optimization [2]]: None
*** Scheduler output: N/A
*** Scheduler errors: N/A
*** 1 LOG MESSAGES:
+-> REPORT at 2020-02-16 02:17:28.265110+01:00
 | [720|CrystalParallelCalculation|on_except]: Traceback (most recent call last):
 |   File "/usr/local/lib/python3.7/dist-packages/aiida/engine/processes/calcjobs/tasks.py", line 78, in do_upload
 |     calc_info, script_filename = process.presubmit(folder)
 |   File "/usr/local/lib/python3.7/dist-packages/aiida/engine/processes/calcjobs/calcjob.py", line 312, in presubmit
 |     calc_info = self.prepare_for_submission(folder)
 |   File "/usr/local/lib/python3.7/dist-packages/aiida_crystal/calculations/parallel.py", line 24, in prepare_for_submission
 |     self._prepare_input_files(folder)
 |   File "/usr/local/lib/python3.7/dist-packages/aiida_crystal/calculations/common.py", line 109, in _prepare_input_files
 |     oxi_states = guess_oxistates(self.inputs.structure)
 |   File "/usr/local/lib/python3.7/dist-packages/aiida_crystal/utils/electrons.py", line 208, in guess_oxistates
 |     return dict(zip(elements, sorted(weights.items(), key=lambda x: x[1], reverse=True)[0][0]))
 | IndexError: list index out of range
blokhin commented 4 years ago

May be the same:

root@aiida-new:~# verdi process report 9097
*** 9097 [CdY/221/cP2: Elastic constants [2]]: None
*** Scheduler output: N/A
*** Scheduler errors: N/A
*** 1 LOG MESSAGES:
+-> REPORT at 2020-02-17 07:25:53.724971+01:00
 | [9097|CrystalParallelCalculation|on_except]: Traceback (most recent call last):
 |   File "/usr/local/lib/python3.7/dist-packages/aiida_crystal/calculations/common.py", line 112, in _prepare_input_files
 |     basis_dict['basis_family'], {})
 |   File "/usr/local/lib/python3.7/dist-packages/aiida_crystal/io/d12_write.py", line 71, in write_input
 |     outstr = _basis_set_block(outstr, indict, basis, atom_props, is_basis_family)
 |   File "/usr/local/lib/python3.7/dist-packages/aiida_crystal/io/d12_write.py", line 184, in _basis_set_block
 |     content = basis.content
 |   File "/usr/local/lib/python3.7/dist-packages/aiida_crystal/data/basis_family.py", line 176, in content
 |     basis_strings = [b.content(state) for b, state in zip(bases, oxi_states)]
 |   File "/usr/local/lib/python3.7/dist-packages/aiida_crystal/data/basis_family.py", line 176, in <listcomp>
 |     basis_strings = [b.content(state) for b, state in zip(bases, oxi_states)]
 |   File "/usr/local/lib/python3.7/dist-packages/aiida_crystal/data/basis.py", line 48, in content
 |     basis = self.set_oxistate(oxi_state, high_spin_preferred)
 |   File "/usr/local/lib/python3.7/dist-packages/aiida_crystal/data/basis.py", line 110, in set_oxistate
 |     occs = add_valence_electrons(-oxi_state, occs, self.element, high_spin_preferred)
 |   File "/usr/local/lib/python3.7/dist-packages/aiida_crystal/data/basis.py", line 211, in add_valence_electrons
 |     element, n
 | ValueError: Too large negative oxidation state for element Cd: 2
 |
 | During handling of the above exception, another exception occurred:
 |
 | Traceback (most recent call last):
 |   File "/usr/local/lib/python3.7/dist-packages/aiida/engine/processes/calcjobs/tasks.py", line 78, in do_upload
 |     calc_info, script_filename = process.presubmit(folder)
 |   File "/usr/local/lib/python3.7/dist-packages/aiida/engine/processes/calcjobs/calcjob.py", line 312, in presubmit
 |     calc_info = self.prepare_for_submission(folder)
 |   File "/usr/local/lib/python3.7/dist-packages/aiida_crystal/calculations/parallel.py", line 24, in prepare_for_submission
 |     self._prepare_input_files(folder)
 |   File "/usr/local/lib/python3.7/dist-packages/aiida_crystal/calculations/common.py", line 116, in _prepare_input_files
 |     format(err))
 | aiida.common.exceptions.InputValidationError: an input file could not be created from the parameters: Too large negative oxidation state for element Cd: 2