kumagai-group / pydefect

Python library for point-defect calculations in non-metallic solids based on first-principle calculations with the VASP code.
https://kumagai-group.github.io/pydefect/
MIT License
46 stars 18 forks source link

Can't instantiate abstract class GkfoCorrection with abstract methods correction_dict #14

Closed Tangshi3 closed 11 months ago

Tangshi3 commented 12 months ago

I find a issue, when i use the command "pydefect_util gkfo -u ../../../unitcell/unitcell.yaml -iefnv ../correction.json -icr ../calc_results.json -fcr calc_results.json -cd 1" in Tutorial for calculation of vertical transition level i get the error, "Can't instantiate abstract class GkfoCorrection with abstract methods correction_dict". I guess that the code of "gkfo_correction.py" do not have implementation of the method "correction_dict", so i fixed this bug by adding following code: @property def correction_dict(self): return self.repr() Then it worked, the results look like reasonable. I donot know the details of pydefect code. Please fix this bug offcially.

By the way, "assert final_calc_results.structure == initial_calc_results.structure" maybe too "strick". The static calculation of VASP cannot keep the POSCAR and CONTCAR total same, there is tiny difference, which is probably related with "Floating point precision". Can blogger consider this situation to make pydefect robust.

yuuukuma commented 12 months ago

Thank you for using my code and letting me know the bug. I've fixed the issue. Could you please try the latest version?

And I also removed the assertion. Please also check it if you have a chance.