Skip to content

Commit

Permalink
Update unit tests affected by THR charge change
Browse files Browse the repository at this point in the history
  • Loading branch information
dominiquesydow committed Jun 28, 2021
1 parent 31f94ac commit 53b4a82
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
4 changes: 3 additions & 1 deletion kissim/tests/encoding/test_fingerprint.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def test_from_structure_klifs_id(self, structure_klifs_id, fingerprint):

@pytest.mark.parametrize(
"structure_klifs_id, values_array_mean",
[(109, 4.9905), (12347, 5.1622)],
[(109, 4.9885), (12347, 5.1590)],
)
def test_values_array(self, structure_klifs_id, values_array_mean):
"""
Expand All @@ -111,6 +111,8 @@ def test_values_array(self, structure_klifs_id, values_array_mean):

fingerprint = Fingerprint.from_structure_klifs_id(structure_klifs_id, LOCAL)
values_array_mean_calculated = np.nanmean(fingerprint.values_array(True, True, True))
print(fingerprint.values_array(True, True, True)[:8])
print(fingerprint.values_array(True, True, True)[17 * 8 : 18 * 8])
assert pytest.approx(values_array_mean_calculated, abs=1e-4) == values_array_mean

# Test the different lengths of the final fingerprint based on the selection of
Expand Down
12 changes: 6 additions & 6 deletions kissim/tests/encoding/test_fingerprint_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ class TestFingerprintGenerator:
@pytest.mark.parametrize(
"structure_klifs_ids, klifs_session, n_cores, fingerprints_values_array_sum",
[
([110, 118], REMOTE, 1, 10152.4256),
([110, 118], REMOTE, 2, 10152.4256),
([110, 118], LOCAL, 1, 10152.4256),
([110, 118], LOCAL, 2, 10152.4256),
([110, 118], None, None, 10152.4256),
([110, 118], REMOTE, 1, 10148.4256),
([110, 118], REMOTE, 2, 10148.4256),
([110, 118], LOCAL, 1, 10148.4256),
([110, 118], LOCAL, 2, 10148.4256),
([110, 118], None, None, 10148.4256),
],
)
def test_from_structure_klifs_id(
Expand Down Expand Up @@ -96,7 +96,7 @@ def test_from_structure_klifs_id(

@pytest.mark.parametrize(
"structure_klifs_ids, normalize, values_array_sum",
[([110, 118], False, 10152.4256), ([110, 118], True, 10152.4256)],
[([110, 118], False, 10148.4256), ([110, 118], True, 10148.4256)],
)
def test_to_from_json(self, structure_klifs_ids, normalize, values_array_sum):
"""
Expand Down

0 comments on commit 53b4a82

Please sign in to comment.