Skip to content

Commit

Permalink
fix flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
miketynes committed Dec 3, 2024
1 parent 39b003c commit cb9f07c
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions cascade/auditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,23 +55,24 @@ def audit(self,
n_audits: int,
sort_audits: bool = False,
) -> tuple[float, list[int]]:
"""
Args:
atoms: list of ase atoms. Should have atoms.info['forces_ens']
set by the cascade EnsembleCalculator
n_audits: number of frames to return
sort_audits: in this case does nothing, since there is no UQ order
Returns:
p_any: drawn from Unif(0,1)
audit_frames: indices of the frams that were sampled
"""
"""
Args:
atoms: list of ase atoms. Should have atoms.info['forces_ens']
set by the cascade EnsembleCalculator
n_audits: number of frames to return
sort_audits: in this case does nothing, since there is no UQ order
Returns:
p_any: drawn from Unif(0,1)
audit_frames: indices of the frams that were sampled
"""
score = self.rng.uniform(0, 1)

ix = self.rng.choice(a=len(atoms),
size=n_audits,
replace=False)
return score, ix


class ForceThresholdAuditor(BaseAuditor):
"""Determines the likelihood all calculations have error below the
threshold, based on ensemble variance
Expand Down

0 comments on commit cb9f07c

Please sign in to comment.