diff --git a/emodel_generalisation/model/bpopt.py b/emodel_generalisation/model/bpopt.py index 1640bd2..a12ed61 100644 --- a/emodel_generalisation/model/bpopt.py +++ b/emodel_generalisation/model/bpopt.py @@ -33,7 +33,6 @@ class eFELFeatureBPEM(eFELFeature): - """eFEL feature extra""" SERIALIZED_FIELDS = ( @@ -318,7 +317,6 @@ def check_recordings(recordings, icell, sim): class BPEMProtocol(ephys.protocols.SweepProtocol): - """Base protocol""" def __init__( @@ -479,7 +477,6 @@ def instantiate(self, sim=None, icell=None): class ResponseDependencies: - """To add to a protocol to specify that it depends on the responses of other protocols""" def __init__(self, dependencies=None): @@ -536,7 +533,6 @@ def run( class ProtocolWithDependencies(BPEMProtocol, ResponseDependencies): - """To add to a protocol to specify that it depends on the responses of other protocols""" def __init__( @@ -577,7 +573,6 @@ def _run( class ReboundBurst(BPEMProtocol): - """Protocol for rebound bursting of thalamic cells.""" def __init__( @@ -603,6 +598,7 @@ def get_holding_current_from_voltage( isolate=None, timeout=None, responses=None, + max_depth=10, ): """Run bisection search to get holding current that match holding voltage.""" # maybe not the best, this is copied from normal holding search @@ -619,6 +615,7 @@ def get_holding_current_from_voltage( self.stimulus.location, target_voltage=target_voltage, stimulus_duration=2000.0, + max_depth=max_depth, ) if self.stimulus.holding_current is not None: hold_prot.stimulus.delay = 1000 @@ -642,6 +639,7 @@ def run( isolate, timeout, responses, + max_depth=20, ) if self.stimulus.amp_voltage is not None: @@ -653,12 +651,12 @@ def run( isolate, timeout, responses, + max_depth=10, ) return BPEMProtocol.run(self, cell_model, param_values, sim, isolate, timeout, responses) class ThresholdBasedProtocol(ProtocolWithDependencies): - """Protocol having rheobase-rescaling capabilities. When using ThresholdBasedProtocol, the current amplitude and step amplitude of the stimulus will be ignored and replaced by values obtained from the holding current and rheobase of the cell model respectively.""" @@ -695,7 +693,6 @@ def run( class RMPProtocol(BPEMProtocol): - """Protocol consisting of a step of amplitude zero""" def __init__(self, name, location, target_voltage, stimulus_duration=500.0): @@ -756,7 +753,6 @@ def run( class RinProtocol(ProtocolWithDependencies): - """Protocol used to find the input resistance of a model""" def __init__( @@ -1054,7 +1050,6 @@ def bisection_search( class SearchThresholdCurrent(ProtocolWithDependencies): - """Protocol used to find the threshold current (rheobase) of a model""" def __init__( @@ -1267,7 +1262,6 @@ def bisection_search( class ProtocolRunner(ephys.protocols.Protocol): - """Meta-protocol in charge of running the other protocols in the correct order""" def __init__(self, protocols, name="ProtocolRunner"): diff --git a/emodel_generalisation/model/evaluation.py b/emodel_generalisation/model/evaluation.py index 8c17e0a..67b3a18 100644 --- a/emodel_generalisation/model/evaluation.py +++ b/emodel_generalisation/model/evaluation.py @@ -539,7 +539,6 @@ def _define_protocols( class ProtocolConfiguration: - """Container for the definition of a protocol""" def __init__( @@ -857,7 +856,6 @@ def _get_stim(stimulus, sec_id): class EFeatureConfiguration: - """Container for the definition of an EFeature""" def __init__( @@ -956,7 +954,6 @@ def as_dict(self): class FitnessCalculatorConfiguration: - """The goal of this class is to store the results of an efeature extraction (efeatures and protocols) or to contain the results of a previous extraction retrieved from an access point. This object is used for the creation of the fitness calculator. @@ -1943,8 +1940,10 @@ def get_emodel_data(access_point, combo, morphology_path, morph_modifiers): model_configuration=model_configuration, morph_modifiers=modifiers.get_synth_modifiers(combo, morph_modifiers=morph_modifiers), ) - - emodel_params = access_point.final[combo["emodel"]]["params"] + if "params" in access_point.final[combo["emodel"]]: + emodel_params = access_point.final[combo["emodel"]]["params"] + else: + emodel_params = access_point.final[combo["emodel"]]["parameters"] return cell, fitness_calculator_configuration, emodel_params