-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Chloe lee doper #264
Chloe lee doper #264
Changes from 5 commits
57c1c70
5cd98ec
b260500
db901d2
1cb2db1
f3421a0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
@@ -1,17 +1,15 @@ | ||||
import os | ||||
import unittest | ||||
|
||||
import smact | ||||
from smact.dopant_prediction import doper | ||||
from smact.structure_prediction import mutation, utilities | ||||
from smact.structure_prediction import utilities | ||||
|
||||
files_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), "files") | ||||
TEST_LAMBDA_JSON = os.path.join(files_dir, "test_lambda_tab.json") | ||||
|
||||
|
||||
class DopantPredictionTest(unittest.TestCase): | ||||
def test_dopant_prediction(self): | ||||
num_dopants = 10 | ||||
test_specie = ("Cu+", "Ga3+", "S2-") | ||||
test = doper.Doper(test_specie) | ||||
|
||||
|
@@ -25,7 +23,8 @@ def test_dopant_prediction(self): | |||
_, an_charge = utilities.parse_spec(anion_min_charge) | ||||
|
||||
# Assert: Length of the list and return type (dictionary: list) | ||||
result = test.get_dopants() | ||||
dopants = test.get_dopants() | ||||
result = test.results | ||||
self.assertIs(type(result), dict) | ||||
for d in result.values(): | ||||
self.assertIn("sorted", d) | ||||
|
@@ -59,7 +58,8 @@ def test_dopant_prediction_skipspecies(self): | |||
test = doper.Doper( | ||||
test_specie, embedding="skipspecies", use_probability=False | ||||
) | ||||
result = test.get_dopants() | ||||
dopants = test.get_dopants() | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove assignment to unused variable - dopants = test.get_dopants() Committable suggestion
Suggested change
ToolsRuff
|
||||
result = test.results | ||||
|
||||
n_sub_list_cat = result.get("n-type cation substitutions").get("sorted") | ||||
p_sub_list_cat = result.get("p-type cation substitutions").get("sorted") | ||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove assignment to unused variable
dopants
.- dopants = test.get_dopants()
Committable suggestion
Tools
Ruff