Skip to content

Commit

Permalink
BUG: fixed erroneous conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
simonwengert committed Apr 12, 2023
1 parent 9650f16 commit 3d94488
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion matscipy/calculators/committee/committee.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ def set_internal_validation_set(self, appearance_threshold):

self._validation_set = []
for id_i, appearance_i in self.id_counter.most_common()[::-1]:
if appearance_i < appearance_threshold:
if appearance_i > appearance_threshold:
break
self._validation_set.append(self.id_to_atoms[id_i])

Expand Down
6 changes: 3 additions & 3 deletions tests/test_committee.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def committee():

@pytest.fixture
def committee_calibrated(committee):
committee.set_internal_validation_set(appearance_threshold=3)
committee.set_internal_validation_set(appearance_threshold=5)
committee.calibrate(prop='energy', key='E_lj', location='info')
committee.calibrate(prop='forces', key='F_lj', location='arrays')
return committee
Expand Down Expand Up @@ -162,7 +162,7 @@ def test_committee_set_internal_validation_set(committee):
with pytest.raises(AssertionError):
committee.set_internal_validation_set(appearance_threshold=committee.number - 1)

committee.set_internal_validation_set(appearance_threshold=3)
committee.set_internal_validation_set(appearance_threshold=5)
obtained = set([atoms_i.info['_Index_FullTrainingSet'] for atoms_i
in committee.validation_set])
expected = set([atoms_i.info['_Index_FullTrainingSet'] for atoms_i
Expand All @@ -171,7 +171,7 @@ def test_committee_set_internal_validation_set(committee):


def test_committee_calibrate(committee):
committee.set_internal_validation_set(appearance_threshold=3)
committee.set_internal_validation_set(appearance_threshold=5)

committee.calibrate(prop='energy', key='E_lj', location='info')
assert committee.calibrated_for == set(['energy'])
Expand Down

0 comments on commit 3d94488

Please sign in to comment.