SMTG-Bham / ShakeNBreak

Defect structure-searching employing chemically-guided bond distortions
https://shakenbreak.readthedocs.io
MIT License
79 stars 17 forks source link

`snb-regenerate` dict error #41

Closed kantaimperial closed 1 year ago

kantaimperial commented 1 year ago

Hi I got this error with snb-regenerate.

kanta@ln04:~/work/SrTiO3_Al/defect/vac/vac_Sr> snb-regenerate -v

vac_1_Sr
Parsing vac_1_Sr_-2...
vac_1_Sr_-2: Energy difference between minimum, found with Rattled bond distortion, and unperturbed: -0.73 eV.
Energy lowering distortion found for vac_1_Sr with charge -2. Adding to low_energy_defects dictionary.
Parsing vac_1_Sr_-1...
No energy lowering distortion with energy difference greater than min_e_diff = 0.05 eV found for vac_1_Sr with charge -1.
Parsing vac_1_Sr_0...
Bond_Distortion_-60.0% not fully relaxed
vac_1_Sr_0: Energy difference between minimum, found with -0.5 bond distortion, and unperturbed: -0.14 eV.
Comparing structures to specified ref_structure (Sr26 Ti27 O81)...
New (according to structure matching) low-energy distorted structure found for vac_1_Sr_0, adding to low_energy_defects['vac_1_Sr'] list.

Comparing and pruning defect structures across charge states...
io.py:419: UserWarning: /mnt/lustre/a2fs-work1/work/e685/e685/kanta/SrTiO3_Al/defect/vac/vac_Sr/vac_1_Sr_0/Bond_Distortion_-60.0%/CONTCAR file doesn't exist, storing as 'Not converged'. Check path & relaxation
Traceback (most recent call last):
  File "/work/e685/e685/kanta/.local/bin/snb-regenerate", line 8, in <module>
    sys.exit(regenerate())
  File "/work/e685/e685/kanta/.local/lib/python3.8/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/work/e685/e685/kanta/.local/lib/python3.8/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/work/e685/e685/kanta/.local/lib/python3.8/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/work/e685/e685/kanta/.local/lib/python3.8/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/work/e685/e685/kanta/.local/lib/python3.8/site-packages/shakenbreak/cli.py", line 1393, in regenerate
    _ = energy_lowering_distortions.get_energy_lowering_distortions(
  File "/work/e685/e685/kanta/.local/lib/python3.8/site-packages/shakenbreak/energy_lowering_distortions.py", line 621, in get_energy_lowering_distortions
    low_energy_defects = _prune_dict_across_charges(
  File "/work/e685/e685/kanta/.local/lib/python3.8/site-packages/shakenbreak/energy_lowering_distortions.py", line 277, in _prune_dict_across_charges
    comparison_results = compare_struct_to_distortions(
  File "/work/e685/e685/kanta/.local/lib/python3.8/site-packages/shakenbreak/energy_lowering_distortions.py", line 734, in compare_struct_to_distortions
    sorted_distorted_df = matching_sub_df[
TypeError: sort_values() got an unexpected keyword argument 'key'
kantaimperial commented 1 year ago

No error for a different defect in this system, with snb-regenerate. These are the energies for the charge states of vac_Sr above:

kanta@ln04:~/work/SrTiO3_Al/defect/vac/vac_Sr> cat */*yaml
distortions:
  -0.6: -1305.83551517
  -0.5: -1305.8321543
  -0.4: -1305.83302221
  -0.3: -1305.69228929
  -0.2: -1305.69270129
  -0.1: -1305.69310438
  0.0: -1305.6936265
  0.1: -1305.69411663
  0.2: -1305.83418805
  0.3: -1305.83606075
  0.4: -1305.83606927
  0.5: -1305.84981239
  0.6: -1305.82217318
Unperturbed: -1305.80265533
distortions:
  Rattled: -1302.62363888
Unperturbed: -1301.89290869
distortions:
  -0.6: -1308.30928894
  -0.5: -1309.06616245
  -0.4: -1308.93788804
  -0.3: -1308.93935736
  -0.2: -1308.95414844
  -0.1: -1308.89114693
  0.0: -1308.89186585
  0.1: -1308.8399513
  0.2: -1308.84058203
  0.3: -1308.97810832
  0.4: -1308.90320564
  0.5: -1308.94030158
  0.6: -1308.96662173
Unperturbed: -1308.92404603
ireaml commented 1 year ago

As the error is related to the pandas version, will update the requirements to pandas > v1.1.0 (https://pandas.pydata.org/pandas-docs/stable/whatsnew/v1.1.0.html#sorting-with-keys) :)