import LFPy_util
from load_model import get_cell
from new_simulation_class import CustomSimulation

sim = LFPy_util.Simulator()
sim.set_cell_load_func(get_cell)
# The string is passed to the get_cell function.
sim.set_neuron_name("pyramidal_1")

sim_custom_1 = CustomSimulation()
sim_custom_1.run_param['amp'] = 1.25 # nA

sim_custom_2 = CustomSimulation()
sim_custom_2.run_param['amp'] = 0.75 # nA
# Avoid sim_custom_2 overwriting the data from sim_custom_1.
sim_custom_2.set_name("custom_sim_2")

# Add the simulations to a list we want to run.
sim.push(sim_custom_1)
sim.push(sim_custom_2)

sim.simulate()
sim.plot()
# Import the get_cell function defined previously.
from load_model import get_cell

# Import the newly defined simulation class.
from new_simulation_class import CustomSimulation

# Load the model, using a string to identify which model will be returned.
cell = get_cell("pyramidal_1")

# Create an instance of the custom simulation class.
sim_custom = CustomSimulation()

sim_custom.simulate(cell)
sim_custom.process_data()
# Plots are stored in a folder called first_simulation.
sim_custom.plot("first_simulation")