Created
August 1, 2013 16:21
-
-
Save rgerkin/6132918 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 of this method is guaranteed by model. | |
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