scidash / neuronunit

A package for data-driven validation of neuron and ion channel models using SciUnit
http://neuronunit.scidash.org
38 stars 24 forks source link

unit tests of neuronunit tests fail with serial NEURON #156

Closed russelljjarvis closed 6 years ago

russelljjarvis commented 6 years ago

unit tests of neuronunit tests fail with serial neuron because the latest backends no longer refreshes neuron models with current injection.

serial rheobase unit test not working with serial neuron as model, /model/backends.py is no longer

refreshing the neuron model between runs as you would expect

adding in the line self.init_backend() at 515 of backends.py eg:

works.

    def inject_square_current(self, current, section = None):

        self.init_backend()
russelljjarvis commented 6 years ago

This issue is resolved but not in the most 'maintainable', way. I welcome suggestions on a more transparent fix.

Lines 491 to 499 now read:

        ##
        # init_backend is the most reliable way to purge existing NEURON simulations.
        # however we don't want to purge the model attributes, we only want to purge
        # the NEURON model code.
        # store the model attributes, in a temp buffer such that they persist throughout the model reinitialization.
        ##
        temp_attrs = copy.copy(self.model.attrs)
        self.init_backend()
        self.set_attrs(**temp_attrs)
rgerkin commented 6 years ago

Fixed with self.init_backend(), which purges the information associated with a previous simulation.