Skip to content

Commit

Permalink
Small tests updates
Browse files Browse the repository at this point in the history
  • Loading branch information
kavanase committed Feb 12, 2024
1 parent ec976ee commit ad3eadf
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 67 deletions.
3 changes: 2 additions & 1 deletion shakenbreak/input.py
Original file line number Diff line number Diff line change
Expand Up @@ -1335,7 +1335,8 @@ def _apply_rattle_bond_distortions(
defect_type = defect_object.defect_type.name.lower()
bulk_supercell_site = _get_bulk_defect_site(defect_entry)
defect_structure = defect_entry.sc_entry.structure
defect_structure.add_oxidation_state_by_element(oxidation_states)
if oxidation_states is not None:
defect_structure.add_oxidation_state_by_element(oxidation_states)

if defect_type == "vacancy": # for vacancies, we need to use fractional coordinates
# (no atom site in structure!)
Expand Down
126 changes: 63 additions & 63 deletions tests/data/vasp/CdTe/CdTe_V_Cd_Dimer_Rattled_0pt25_POSCAR
Original file line number Diff line number Diff line change
Expand Up @@ -6,66 +6,66 @@ Cd31 Te32
Cd Te
31 32
direct
0.0156871194840353 0.0168499172361065 0.5013659606570436 Cd2+
0.0271500115668686 0.4957262246093266 0.0100224763679073 Cd2+
-0.0014495703722099 0.4980731524352150 0.4781192167960491 Cd2+
0.4722094233480639 0.0200506294364088 -0.0182692230473816 Cd2+
0.4885585281400621 -0.0053878728738825 0.4817673004644190 Cd2+
0.5056282073490231 0.5186277985499153 -0.0269746115858607 Cd2+
0.4801688502186689 0.5257243960661042 0.5248055377787585 Cd2+
-0.0348316368950783 0.2728944316714810 0.2387460475061252 Cd2+
-0.0105745472528089 0.2665553322767636 0.7249704332381200 Cd2+
-0.0075690729980406 0.7073232895687733 0.2540302118175998 Cd2+
-0.0050910397377601 0.7355423155760010 0.7679544090557621 Cd2+
0.5005816366983870 0.2820536382478840 0.2335402909392014 Cd2+
0.5164511376504562 0.2542450219488173 0.7322823716342084 Cd2+
0.5070828585054892 0.7526462759552357 0.2894765820190052 Cd2+
0.5049584993998797 0.7681671971948304 0.7591942235932660 Cd2+
0.2314439007613033 -0.0139691580327037 0.2710898637591607 Cd2+
0.2376369130393935 0.0053687944240744 0.7381653011727750 Cd2+
0.2718374045812695 0.4922892243165773 0.2451784226567301 Cd2+
0.2622947472228113 0.5173549697162710 0.7260213390066484 Cd2+
0.7421013906143455 -0.0369394254180139 0.2601101761807642 Cd2+
0.7643010257290317 0.0082559723869255 0.7375144675771959 Cd2+
0.7772298637541588 0.5061737877891480 0.2418884425731874 Cd2+
0.7112919524310897 0.4891818031292686 0.7452862206392076 Cd2+
0.2597626037064264 0.2654750359385809 -0.0138178746240745 Cd2+
0.2856911389734074 0.2667607419061732 0.4824379442736103 Cd2+
0.2553308492327366 0.7324121579095495 -0.0270836224755171 Cd2+
0.2877874281235570 0.7210962747120893 0.4960596434321737 Cd2+
0.7756092046801939 0.2696741257630375 -0.0094615087069471 Cd2+
0.7674603327148890 0.2433936502088358 0.5342582586445987 Cd2+
0.7659806984052299 0.7592741823626890 0.0084426299687161 Cd2+
0.7451092426178079 0.7523250438453772 0.4937354606915620 Cd2+
0.1187568485774295 0.1507937162676332 0.3762100856753475 Te2-
0.1312359429836720 0.1328551962041555 0.9202598135720425 Te2-
0.1128884079346265 0.6182951658040680 0.3473039496781265 Te2-
0.1315797807618614 0.6225939184343635 0.8700339946167042 Te2-
0.6283847628206453 0.1104322706926303 0.3462095332815449 Te2-
0.6231233285696897 0.1431785472589133 0.8803636878306192 Te2-
0.6132648937495118 0.6443581611601850 0.3924510477913719 Te2-
0.6271436363496584 0.6167078405828447 0.8527871928487835 Te2-
0.1273727892891333 0.3919108640973764 0.1439967743041993 Te2-
0.1141821228674018 0.3715100179204548 0.6127261640254006 Te2-
0.1173411386799441 0.8870697863654669 0.0681915310744819 Te2-
0.1575630076145119 0.8519631496831680 0.5913649039501945 Te2-
0.6082245405973820 0.3839467110079552 0.1129579011512159 Te2-
0.6252520424249853 0.3639435370678827 0.5933896303873651 Te2-
0.6560941606888189 0.8579088993238950 0.1114096916911318 Te2-
0.6386215189674254 0.8782996437744818 0.6183416726189549 Te2-
0.3691659245140350 0.1150467855183059 0.1518612689124705 Te2-
0.3803128561907226 0.1426243580437952 0.6395882828468022 Te2-
0.3947428748509966 0.6398822065520391 0.0971153956045202 Te2-
0.3750000000000000 0.6250000000000000 0.6250000000000000 Te2-
0.8975517329778733 0.0479069033959441 0.0927849932342861 Te2-
0.8958653442608970 0.1243931913490970 0.6052705997044724 Te2-
0.8662709695677386 0.6264704742842300 0.1299247251675607 Te2-
0.8694061068288607 0.6014102855379397 0.6172289000223002 Te2-
0.3903631884266203 0.3750040440301268 0.3693633479218935 Te2-
0.3840986630527822 0.3765797318809899 0.8701975112891386 Te2-
0.3794827130771702 0.8854032160195859 0.3674836864650987 Te2-
0.3917242540183349 0.8543409397301263 0.8784352524394520 Te2-
0.8817775378020919 0.3813543713889261 0.4031743957535139 Te2-
0.8794108581844571 0.3946822747640026 0.8757006722884800 Te2-
0.8749999999999999 0.8749999999999999 0.3750000000000000 Te2-
0.8539818238484530 0.9657359971042676 0.9006515870041598 Te2-
0.0156871194840353 0.0168499172361065 0.5013659606570436 Cd
0.0271500115668686 0.4957262246093266 0.0100224763679073 Cd
-0.0014495703722099 0.4980731524352150 0.4781192167960491 Cd
0.4722094233480639 0.0200506294364088 -0.0182692230473816 Cd
0.4885585281400621 -0.0053878728738825 0.4817673004644190 Cd
0.5056282073490231 0.5186277985499153 -0.0269746115858607 Cd
0.4801688502186689 0.5257243960661042 0.5248055377787585 Cd
-0.0348316368950783 0.2728944316714810 0.2387460475061252 Cd
-0.0105745472528089 0.2665553322767636 0.7249704332381200 Cd
-0.0075690729980406 0.7073232895687733 0.2540302118175998 Cd
-0.0050910397377601 0.7355423155760010 0.7679544090557621 Cd
0.5005816366983870 0.2820536382478840 0.2335402909392014 Cd
0.5164511376504562 0.2542450219488173 0.7322823716342084 Cd
0.5070828585054892 0.7526462759552357 0.2894765820190052 Cd
0.5049584993998797 0.7681671971948304 0.7591942235932660 Cd
0.2314439007613033 -0.0139691580327037 0.2710898637591607 Cd
0.2376369130393935 0.0053687944240744 0.7381653011727750 Cd
0.2718374045812695 0.4922892243165773 0.2451784226567301 Cd
0.2622947472228113 0.5173549697162710 0.7260213390066484 Cd
0.7421013906143455 -0.0369394254180139 0.2601101761807642 Cd
0.7643010257290317 0.0082559723869255 0.7375144675771959 Cd
0.7772298637541588 0.5061737877891480 0.2418884425731874 Cd
0.7112919524310897 0.4891818031292686 0.7452862206392076 Cd
0.2597626037064264 0.2654750359385809 -0.0138178746240745 Cd
0.2856911389734074 0.2667607419061732 0.4824379442736103 Cd
0.2553308492327366 0.7324121579095495 -0.0270836224755171 Cd
0.2877874281235570 0.7210962747120893 0.4960596434321737 Cd
0.7756092046801939 0.2696741257630375 -0.0094615087069471 Cd
0.7674603327148890 0.2433936502088358 0.5342582586445987 Cd
0.7659806984052299 0.7592741823626890 0.0084426299687161 Cd
0.7451092426178079 0.7523250438453772 0.4937354606915620 Cd
0.1250000000000000 0.1250000000000000 0.3750000000000000 Te
0.1187568485774295 0.0798259097921571 0.9471778921508236 Te
0.1312359429836720 0.6328551962041555 0.4202598135720426 Te
0.1128884079346265 0.6182951658040680 0.8473039496781265 Te
0.6315797807618615 0.1225939184343634 0.3700339946167043 Te
0.6283847628206453 0.1104322706926303 0.8462095332815449 Te
0.6231233285696897 0.6431785472589133 0.3803636878306193 Te
0.6132648937495118 0.6443581611601850 0.8924510477913717 Te
0.1139339894586364 0.3681844242533567 0.1518017271048436 Te
0.1250000000000000 0.3750000000000000 0.6250000000000000 Te
0.1106383255258450 0.9486769885987631 0.0905073922219817 Te
0.1252520424249854 0.8639435370678826 0.5933896303873651 Te
0.6560941606888189 0.3579088993238951 0.1114096916911318 Te
0.6386215189674254 0.3782996437744819 0.6183416726189549 Te
0.6721889309442109 0.8433628919160479 0.1250367613866258 Te
0.6191659245140352 0.8650467855183057 0.6518612689124705 Te
0.3578307244804382 0.1464941555012161 0.0876090610972016 Te
0.3803128561907226 0.1426243580437952 0.6395882828468022 Te
0.3947428748509966 0.6398822065520391 0.0971153956045202 Te
0.3975517329778734 0.6188747098714201 0.6637527997097622 Te
0.8958653442608970 0.1243931913490970 0.1052705997044723 Te
0.8997301454086939 0.1260280502017524 0.6286909690625229 Te
0.8662709695677386 0.6264704742842300 0.1299247251675607 Te
0.8694061068288607 0.6014102855379397 0.6172289000223002 Te
0.3903631884266203 0.3750040440301268 0.3693633479218935 Te
0.3840986630527822 0.3765797318809899 0.8701975112891386 Te
0.3794827130771702 0.8854032160195859 0.3674836864650987 Te
0.3917242540183349 0.8543409397301263 0.8784352524394520 Te
0.8817775378020919 0.3813543713889261 0.4031743957535139 Te
0.8794108581844571 0.3946822747640026 0.8757006722884800 Te
0.8832990018766742 0.9089615994988091 0.3627269241214383 Te
0.8460654184237592 0.8901079778386413 0.8694308400251983 Te
2 changes: 1 addition & 1 deletion tests/data/vasp/CdTe/vacancies_dist_defect_dict.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions tests/test_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,7 @@ def test_apply_rattle_bond_distortions_V_Cd_dimer(self):
) # Shouldn't match because rattling not done yet

rattling_atom_indices = np.arange(0, 63)
idx = np.in1d(rattling_atom_indices, [i - 1 for i in [62, 51]])
idx = np.in1d(rattling_atom_indices, [i - 1 for i in [41, 32]])
rattling_atom_indices = rattling_atom_indices[
~idx
] # removed distorted Te indices
Expand Down Expand Up @@ -1021,7 +1021,7 @@ def test_apply_snb_distortions_V_Cd_dimer(self):
self.assertEqual(distortion_parameters_dict["num_distorted_neighbours_in_dimer"], 2)
self.assertEqual(
set(distortion_parameters_dict["distorted_atoms_in_dimer"]),
set([(62, "Te"), (51, "Te")]) # order of elements not important
set([(41, "Te"), (32, "Te")]) # order of elements not important
)
self.assertEqual(self.V_Cd_dimer_struc_0pt25_rattled, distorted_V_Cd_struc)

Expand Down

0 comments on commit ad3eadf

Please sign in to comment.