From c5e5b7e205c98fea2dd1750060ac0488f1d41d6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Se=C3=A1n=20Kavanagh?= <51478689+kavanase@users.noreply.github.com> Date: Mon, 25 Apr 2022 12:30:37 +0100 Subject: [PATCH 1/2] Fix `substituting_specie` assignment for substitutions --- defect_finder/BDM.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/defect_finder/BDM.py b/defect_finder/BDM.py index 7551926e..9ab852fd 100644 --- a/defect_finder/BDM.py +++ b/defect_finder/BDM.py @@ -72,9 +72,13 @@ def calc_number_electrons( substituting_specie = str(defect_dict['site_specie']) site_specie = 'Vac' # Consider an interstitial as the interstitial atom substituting a vacant position - elif defect_dict['defect_type'] in ['antisite', 'substitution']: + elif defect_dict['defect_type'] == 'antisite': site_specie = str(defect_dict['site_specie']) substituting_specie = defect_dict['substituting_specie'] + + elif defect_dict['defect_type'] == 'substitution': + site_specie = str(defect_dict['site_specie']) + substituting_specie = defect_dict['substitution_specie'] num_electrons = - ( oxidation_states[substituting_specie] - oxidation_states[site_specie] ) # print( f"Number of missing/extra electrons of defect {defect['name']}: ", num_electrons ) From d5863f4bb4db342fc63de1cd9b9e48e99de9aaee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Se=C3=A1n=20Kavanagh?= <51478689+kavanase@users.noreply.github.com> Date: Mon, 6 Jun 2022 14:34:23 +0100 Subject: [PATCH 2/2] Update test workflow to explicitly test output plots --- .github/workflows/build_and_test.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index ecc7301b..c7362158 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -39,4 +39,7 @@ jobs: pip install -e .[tests] - name: Test - run: pytest + run: | + pytest + pytest tests/test_shakenbreak.py --mpl # test output plots +