from neuron import h, gui


class cell:
    def __init__(self, _id):
        self._id = _id

        # morphology
        axon = h.Section(name='axon', cell=self)
        axon.L = 10000
        axon.diam = 1
        axon.nseg = 101

        # biophysics
        axon.insert('hh')

        self.axon = axon

    def __str__(self):
        return 'cell[{}]'.format(self._id)

    def hi(self):
        print('hi')

my_cell = cell(0)

# current injection
ic = h.IClamp(my_cell.axon(0))
ic.delay = 1
ic.dur = 1
ic.amp = 100
