Fix some flake8 spam. NFC.
This commit is contained in:
@ -14,6 +14,7 @@ from correspondence import Correspondence
|
||||
from workspaceFormulas import chooseUnmodifiedObject
|
||||
from workspaceFormulas import chooseBondFacet
|
||||
|
||||
|
||||
def codelet(name):
|
||||
"""Decorator for otherwise-unused functions that are in fact used as codelet behaviors"""
|
||||
def wrap(f):
|
||||
@ -23,6 +24,7 @@ def codelet(name):
|
||||
return f
|
||||
return wrap
|
||||
|
||||
|
||||
# some methods common to the codelets
|
||||
def __showWhichStringObjectIsFrom(structure):
|
||||
if not structure:
|
||||
|
||||
@ -2,12 +2,14 @@ import bisect
|
||||
import math
|
||||
import random
|
||||
|
||||
|
||||
def accumulate(iterable):
|
||||
total = 0
|
||||
for v in iterable:
|
||||
total += v
|
||||
yield total
|
||||
|
||||
|
||||
class Randomness(object):
|
||||
def __init__(self, seed=None):
|
||||
self.rng = random.Random(seed)
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import math
|
||||
|
||||
|
||||
class Temperature(object):
|
||||
def __init__(self):
|
||||
self.reset()
|
||||
|
||||
@ -1,9 +1,8 @@
|
||||
"""Run the copycat program"""
|
||||
|
||||
import unittest
|
||||
|
||||
from context import Context
|
||||
|
||||
|
||||
def pnormaldist(p):
|
||||
table = {
|
||||
0.80: 1.2815,
|
||||
@ -21,7 +20,8 @@ def pnormaldist(p):
|
||||
0.99999999: 5.7307,
|
||||
0.999999999: 6.1094,
|
||||
}
|
||||
return max(v for k,v in table.iteritems() if k <= p)
|
||||
return max(v for k, v in table.iteritems() if k <= p)
|
||||
|
||||
|
||||
def lower_bound_on_probability(hits, attempts, confidence=0.95):
|
||||
if attempts == 0:
|
||||
@ -33,6 +33,7 @@ def lower_bound_on_probability(hits, attempts, confidence=0.95):
|
||||
denominator = (1 + zsqr / attempts)
|
||||
return (phat + zsqr / (2*attempts) - z * (under_sqrt ** 0.5)) / denominator
|
||||
|
||||
|
||||
def upper_bound_on_probability(hits, attempts, confidence=0.95):
|
||||
misses = attempts - hits
|
||||
return 1.0 - lower_bound_on_probability(misses, attempts, confidence)
|
||||
@ -131,5 +132,6 @@ class TestCopycat(unittest.TestCase):
|
||||
'kitten': {'count': 4, 'avgtemp': 68},
|
||||
})
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user