Skip to content

Instantly share code, notes, and snippets.

@rgerkin
Last active December 20, 2015 12:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rgerkin/6132920 to your computer and use it in GitHub Desktop.
Save rgerkin/6132920 to your computer and use it in GitHub Desktop.
class RateTest(sciunit.Test):
def __init__(self, mean, std, input_current):
self.mean, self.std, self.input_current = mean, std, input_current
required_capabilities = (
neurounit.Capabilities.ReceivesCurrent,
neurounit.Capabilities.ProducesFiringRate
)
def run_test(self, model):
model.set_current(self.input_current) # Implementation guaranteed.
rate = model.get_firing_rate()
mean, std = self.mean, self.std
result = (mean - std) <= rate <= (mean - std)
return sciunit.scores.BooleanScore(result, related_data={
"rate": rate,
"mean": mean,
"std": std
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment