def transform(ind): from neuronunit.optimization.data_transport_container import DataTC dtc = DataTC() print(dtc) param_dict = {} for i, j in enumerate(ind): param_dict[td[i]] = str(j) dtc.attrs = param_dict dtc.evaluated = False return dtc
def transform(ind): import dask.bag as db from neuronunit.optimization.data_transport_container import DataTC dtc = DataTC() import neuronunit LEMS_MODEL_PATH = str(neuronunit.__path__[0])+str('/models/NeuroML2/LEMS_2007One.xml') if backend is not None: dtc.backend = backend else: dtc.backend = 'NEURON' dtc.attrs = {} for i,j in enumerate(ind): dtc.attrs[str(td[i])] = j dtc.evaluated = False return dtc
def transform(xargs): (ind, td, backend) = xargs # The merits of defining a function in a function # is that it yields a semi global scoped variables. # conisider refactoring outer function as a decorator. dtc = DataTC() LEMS_MODEL_PATH = str( neuronunit.__path__[0]) + str('/models/NeuroML2/LEMS_2007One.xml') dtc.backend = 'RAW' dtc.attrs = {} for i, j in enumerate(ind): dtc.attrs[str(td[i])] = j dtc.evaluated = False return dtc
def transform(ind): # The merits of defining a function in a function # is that it yields a semi global scoped variables. # dtc = DataTC() LEMS_MODEL_PATH = str(neuronunit.__path__[0])+str('/models/NeuroML2/LEMS_2007One.xml') if backend is not None: dtc.backend = backend else: dtc.backend = 'NEURON' dtc.attrs = {} if isinstance(ind, Iterable): for i,j in enumerate(ind): dtc.attrs[str(td[i])] = j else: dtc.attrs[str(td[0])] = ind dtc.evaluated = False return dtc