示例#1
0
def do_sim(simulation, sim_control=None):
    """setup a simulation"""
    global na, cell

    # hide the simulation control panel, if there was one
    if sim_control:
        sim_control.unmap()

    cell = FleidervishNeuron()

    # add sodium diffusion everywhere
    allsec = rxd.Region(h.allsec(), nrn_region='i')
    na = rxd.Species(allsec, d=0.6, name='na', charge=1)

    # create a current clamp and add it to the cell
    cell.ic = h.IClamp(cell.soma(0.5))
    cell.ic.dur = 3       # ms
    cell.ic.amp = 1.5     # nA

    # setup graphs needed by both simulations
    concentration_graph = h.Graph(False)
    concentration_graph.size(0, 3000, 4, 4.4)
    voltage_graph = h.Graph(False)
    voltage_graph.size(0, 3000, -90, 60)
    h.graphList[0].append(voltage_graph)
    h.graphList[1].append(concentration_graph)

    # pop up the run control
    h.nrncontrolmenu()

    # call the funciton which actually sets up the specific simulation
    simulation(cell, voltage_graph, concentration_graph)
示例#2
0
def plotiv(raster=True, cl=[]):
    global gl, g
    if raster:
        if not g: g = h.Graph()
        g.erase_all()
        ind.mark(g, tvec, "O", 4, 2, 1)
        for t in tvec:
            g.beginline(3, 1)
            g.line(t, 0)
            g.line(t, ncells)
        g.exec_menu("View = plot")
    if cl:
        gl = [h.Graph() for i in range(len(cl))]
        for c, g in zip(cl, gl):
            cells[c].vvec.plot(g)
            g.exec_menu("View = plot")
示例#3
0
 def build(self):
     self.box = h.HBox()
     self.box.intercept(1)
     self.box.ref(self)
     h.xpanel("")
     h.xbutton("Button 1", (self.bact, 1))
     h.xbutton("Button 2", (self.bact, (2, )))
     h.xbutton("Button 3", self.bact_noarg)
     h.xbutton("Button 4", (self.bact_2arg, ("hello", 4)))
     for i in range(3):
         h.xradiobutton("Radio " + str(i), (self.bact, i))
     h.xmenu("Menu")
     for i in range(3):
         h.xbutton("Item " + str(i), (self.bact, i))
     for i in range(3):
         h.xradiobutton("Radio " + str(i), (self.bact, i))
     h.xcheckbox('checkbox', (self, 'cbstate'), self.cb)
     h.xstatebutton('state', (self, 'sbut'), self.st)
     h.xmenu()
     h.xpanel()
     self.g = h.Graph()
     self.g.menu_tool('graph menu tool 1', self.gcb, (self.gsel, 1))
     h.xpanel("")
     h.xvalue("x", (self, "x"), 1, self.chgx)
     h.xcheckbox('checkbox', (self, 'cbstate'), self.cb)
     h.xstatebutton('state', (self, 'sbut'), self.st)
     h.xlabel('fixed label')
     h.xvarlabel((self, 'ss'))
     h.xslider((self, 'x'), 0, 20, self.slide)
     self.g.menu_tool('graph menu tool 2', self.gcb, (self.gsel, 2))
     h.xpanel()
     self.box.intercept(0)
示例#4
0
def gr():
    g = h.Graph()
    g.size(0, h.tstop, -80, 50)
    g.addvar("node0", h.node[0](0.5)._ref_v, 1, 2)
    g.addvar("node1", h.node[1](0.5)._ref_v, 3, 2)
    g.addvar("node25", h.node[25](0.5)._ref_v, 4, 2)
    g.addvar("node49", h.node[49](0.5)._ref_v, 2, 2)
    h.graphList[0].append(g)
示例#5
0
def drawsec (sec):
  # draw original 3d points (x,y values). Not using Shape because of origin issues
  g = h.Graph(0)
  g.view(2)
  n = int(sec.n3d())
  g.beginline(1, 4)
  for i in range(n):
    g.line(sec.x3d(i), sec.y3d(i))
  return g
示例#6
0
def run_single_simulation(config, interactive):
    axon = Axon(config)
    axon.insert_stim(config['stim_position'], config['stim_amplitude'],
            config['stim_start_time'], config['stim_duration'])

    # set up recording vectors for python plots and the csv file
    t = h.Vector()
    t.record(h._ref_t)

    num_v_traces = config['num_v_traces']
    v_traces = []
    for i in range(num_v_traces):
        v = h.Vector()
        v.record(axon.section_at_f(
            # record at num_v_traces points along the axon, equally spaced
            # from eachother and from the end points (since we don't care
            # about things like the impedance mismatch at the ends)
            (i + 1) * 1.0 / (num_v_traces + 1))
            (Axon.middle)._ref_v)
        v_traces.append(v)

    # set up NEURON plotting code (if we're in an interactive session)
    if interactive:
        g = h.Graph()
        g.size(0, config['integration_time'], -80, 55)
        for i in range(num_v_traces):
            g.addvar('v(0.5)',
                    sec=axon.section_at_f((i+1) * 1.0 / (num_v_traces + 1)))

    # initialize the simulation
    h.dt = config['max_time_step']
    tstop = config['integration_time']
    h.finitialize(config['initial_membrane_potential'])
    h.fcurrent()

    # run the simulation
    if interactive:
        g.begin()
        while h.t < tstop:
            h.fadvance()
            g.plot(h.t)
        g.flush()
    else:
        while h.t < tstop:
            h.fadvance()

    # save the data as a csv
    with open(config['csv_filename'], 'w') as csv_file:
        # start with a header of the form "t_ms, V0_mV, V1_mv, V2_mV,..."
        csv_file.write(", ".join(
            ["t_ms"] + ["V{0}_mV".format(i) for i in range(num_v_traces)]
            ) + "\n")

        # write the time and each of the recorded voltages at that time
        for row in zip(t, *v_traces):
            csv_file.write(", ".join([str(x) for x in row]) + "\n")
示例#7
0
文件: read.py 项目: nrnhines/bfilt
def plot_parms(rl):
    if rl[0][3] < 3:
        print "file does not contain data needed by plot_parms"
        return
    g = h.Graph(0)
    g.view(2)
    g.size(0, 10, 0, 10)
    g.label(.5, .9, '#channels ' + str(rl[0][1]), 2, 1, .5, 0, 1)
    for r in rl:
        parm = r[3][0]
        g.mark(parm[0], parm[1], "O", 5, 1, 1)
    return g
示例#8
0
 def show_state_funnels(self):
     t = self.Etime()
     if self.g == None:
         g = []
         for i in range(len(EKF.Scenter)):
             g.append(h.Graph())
     else:
         g = self.g
     for i in range(len(EKF.Scenter)):
         #self.Scenter(i).line(g[i], t)
         self.SUpper(i).line(g[i], t)
         self.SLower(i).line(g[i], t)
         if self.g == None:
             g[i].exec_menu('View = plot')
     self.g = g
示例#9
0
def test2():  # x, z slice through ipt = 0
    from neuron import h, gui
    g = h.Graph(0)
    g.view(2)
    for ilayer in range(nlayer):
        for icircle in range(ncircle[ilayer] - 1):
            c = cellcorners(ilayer, icircle, 0)
            g.beginline(ilayer + 1, 1)
            g.line(c.p000[0], c.p000[2])
            g.line(c.p010[0], c.p010[2])
            g.line(c.p110[0], c.p110[2])
            g.line(c.p100[0], c.p100[2])
            g.line(c.p000[0], c.p000[2])
            g.flush()
    return g
示例#10
0
def winup (izht=izhtype):
  global bub, g, nmenu, izhtype
  izhtype = izht  # swap in the new one
  cellset()
  if g is None: 
    g=h.Graph(0)
    h.graphList[0].append(g)
  if g.view_count()<1: 
    g.view(-0.1*h.tstop,-90,1.2*h.tstop,150,300,200,400,200)
    g.size(0,h.tstop,-80,40)
  if not bub is None: bub.vbox.unmap()
  bub = Bubox(izhtype,choices[izhtype][2])
  bub.label[0] = izhtype
  if not nmenu is None: nmenu.unmap()
  nmenu = ivwrap(lambda: h.nrnpointmenu(izh), izh.hname())
示例#11
0
def bld(x, y):
    global g, tt, ttstr, grp, sgrp, pras
    tt = 0.0
    ttstr = h.ref('tt=0.000000000')
    v = h.VBox()
    v.intercept(1)
    g = h.Graph()
    g.size(0, x, 0, y)
    h.xpanel("", 1)
    h.xvarlabel(ttstr)
    h.xvalue("group", (this_module, "grp"), 1, ttcallback)
    h.xslider((this_module, "sgrp"), 0, 100, ttscallback)
    h.xpanel()
    v.intercept(0)
    v.map("wave front", 100, 100, 700, 500)
    return v
示例#12
0
def fig6b(cell, voltage_graph, concentration_graph):
    """setup to run Fig 6B

    The model is the same as in Fig 3A except some of the sections are
    different lengths and the discretization is different.

    The cell receives a different stimulus and different time series are
    plotted. An additional graph plots sodium concentration as a function of
    position."""
    # differences to the morphology and discretization from Fig 3A
    cell.myelin[0].L = 51
    cell.myelin[1].L = 60
    cell.myelin[0].nseg = 255
    cell.myelin[1].nseg = 300
    cell.AIS.L = 48
    cell.AIS.nseg = 240

    h.cvode_active(True)

    # setup the graphs

    voltage_graph.view(0, -80, 50, 140, 528, 440, 549, 267.4)
    voltage_graph.addvar('soma(0.5).v', cell.soma(0.5)._ref_v)
    voltage_graph.addvar('AIS(0.5).v', cell.AIS(0.5)._ref_v, 2, 1)
    voltage_graph.addvar('node(0.5).v', cell.node(0.5)._ref_v, 4, 1)

    concentration_graph.view(-1, 4, 51, 0.58, 528, 870, 548.1, 238.6)
    concentration_graph.addvar('soma(0.5).nai', cell.soma(0.5)._ref_nai)
    concentration_graph.addvar('AIS(0.25).nai', cell.AIS(0.25)._ref_nai, 2, 1)
    concentration_graph.addvar('node(0.5).nai', cell.node(0.5)._ref_nai, 4, 1)

    # additional graph plotting sodium concentration along a path
    rvp = h.Graph(False)
    rvp.size(-40, 160, 4, 4.58)
    rvp.view(-40, 4, 200, 0.58, 534, 18, 544.5, 262)
    h.flush_list.append(rvp)
    rvp_ = h.RangeVarPlot("nai")
    rvp_.begin(cell.ApD(0))
    rvp_.end(cell.myelin[1](1))
    rvp.addobject(rvp_, 1, 1, 0.8, 0.9)

    # start time of current pulse
    cell.ic.delay = 10
    # default simulation length
    h.tstop = 50
示例#13
0
def test4():
    from neuron import h, gui
    # distance between circles as function of surface distance for
    # inner and outemost layers. Also length of cells.
    g1 = h.Graph()
    #for j, layer in enumerate([0, nlayer-1]):
    for j, layer in enumerate(range(nlayer)):
        p0 = xyz(layer, 0, 0)
        d_surf = [
            distance(xyz(layer, i, 0), p0) for i in range(1, ncircle[layer])
        ]
        d_circle = [
            distance(xyz(layer, i, 0), xyz(layer, i - 1, 0))
            for i in range(1, ncircle[layer])
        ]
        print(d_circle, d_surf)
        h.Vector(d_circle).line(g1, h.Vector(d_surf), j + 1, 2)
    return g1
def main(gui=True):

    if gui:

        h.load_file("stdlib.hoc")
        h.load_file("stdgui.hoc")
        h.steps_per_ms = 1 / h.dt

    # For each current value, create a cell
    for c in xrange(0, len(amps)):
        print("Trying amplitude:  %snA" % amps[c])
        cells.append(mkmitral(0))

        if gui:
            g = h.Graph(0)
            g.size(0, tstop, -80, 50)
            g.view(0, -80, tstop, 130, (c % 2) * 425, (c / 2) * 260, 400,
                   200)  # Position the graphs on screen
            addVars(g, c)
            graphs.append(g)

        stim = h.IClamp(0.5, sec=cells[c].soma)
        stim.delay = delay
        stim.amp = amps[c]
        stim.dur = duration
        stims.append(stim)

        data.append([])

    if gui:
        # For one of the current values, create a closeup of the AP
        focusampindex = 1
        closedupStartTime = 90  # ms
        closedupEndTime = 95  # ms
        closeup.size(closedupStartTime, closedupEndTime, -80, 50)
        closeup.view(closedupStartTime, -80,
                     closedupEndTime - closedupStartTime, 130, 850, 0, 400,
                     200)
        addVars(closeup, focusampindex)

    initialize()
    integrate()  # Plot the graphs
示例#15
0
    def __init__(self, cell):
        def show_val():
            print("Spacer Ra of the model: {}".format(cell.spacer.Ra))
            print(
                'The starting point is {}, end point is {} with increasing steps of {}'
                .format(min_current_var[0], max_current_var[0],
                        step_current_var[0]))

        #Contorl Panel
        sim_control = h.HBox()
        sim_control.intercept(1)
        h.nrncontrolmenu()
        attach_current_clamp(cell)
        h.xpanel('TEST')
        h.xlabel('Choose a  simulation to run')
        h.xbutton('Spike Protocol', (spike_fig, cell))
        h.xbutton('Rheobase Protocol', (fig_rheobase_check, cell))
        h.xbutton('Multiple Rheobase Protocol',
                  (multiple_rheobase_plots_new, cell))
        h.xbutton('Increasing Ra Protocol', (fig_ra_rheobase_spacerL, cell))
        h.xbutton('Increasing spacer_gpas Protocol',
                  (fig_g_rheobase_spacerL, cell))
        h.xbutton('Increasing cell c_m Protcol',
                  (fig_cm_rheobase_spacerL, cell))
        h.xbutton('Combined Protocol Run', (Combined_Protocol, cell))
        h.xpvalue('Rheobase protocol start', min_current_var, 1)
        h.xpvalue('Rheobase protocol end', max_current_var, 1)
        h.xpvalue('Rheobase step size', step_current_var, 1)
        h.xbutton('show value', show_val)
        # h.xvalue('enter value', (this_module, 'val'))
        h.xpanel()
        #Output panel
        g = h.Graph()
        g.addvar('soma(0.5).v', cell.soma(0.5)._ref_v)
        g.addvar('AIS(0.5).v', cell.AIS(0.5)._ref_v)
        g.size(0, 1000, -90, 90)
        h.graphList[0].append(g)
        h.MenuExplore()
        sim_control.intercept(0)
        sim_control.map()
        input()
示例#16
0
def test5():  #pt2circle
    from neuron import h, gui
    o0 = paraboloid[0]
    n = 4
    o1 = paraboloid[n]
    d = distance(o1[0][0], o0[0][0])
    g = h.Graph()
    for p in o1:
        g.mark(p[0][0], p[0][2], "|", 10, 1, 1)
    for o in o0:
        p = o[0]
        p1 = addmul(p, d, normgrad(p))
        i = pt2circle(n, p1)
        g.mark(p1[0], p1[2], "|", 10, 2, 1)
        g.mark(o1[i][0][0], o1[i][0][2], "|", 10, 3, 1)
        d1 = distance(p1, o1[i][0])
        if i < len(o1) - 1:
            zi = o1[i][0][2]
            z = p1[2]
            zip = o1[i + 1][0][2]
            print("zi=%g z=%g zip=%g" % (zi, z, zip))
            assert (zi <= z + 1e-9 and z <= zip + 1e-9)
    return g
示例#17
0
def test3():  # x, z slice through ipt = 0 (using RegionFace)
    from neuron import h, gui
    from cellorg import is_simulated, xyz, distance
    g = h.Graph(0)
    g.view(2)
    for ilayer in range(nlayer):
        for icircle in range(ncircle[ilayer] - 1):
            if is_simulated(ilayer, icircle, 0):
                c = cellcorners(ilayer, icircle, 0)
                rf = paraboloid[ilayer][icircle][2]
                b0 = rf.p0b[1] if rf and rf.p0b else []
                b1 = rf.p1b[1] if rf and rf.p1b else []
                g.beginline(ilayer + 1, 1)
                g.line(c.p000[0], c.p000[2])
                for p in b0:
                    g.line(p[0], p[2])
                g.line(c.p010[0], c.p010[2])
                g.line(c.p110[0], c.p110[2])
                for p in reversed(b1):
                    g.line(p[0], p[2])
                g.line(c.p100[0], c.p100[2])
                g.line(c.p000[0], c.p000[2])
                g.flush()
    return g
示例#18
0
soma.insert('cat')
soma.insert('sk')
soma.insert('bk')
soma.insert('pmp')

h.cao0_ca_ion = 2.0  # mM
soma.ena = 50  # mV
soma.ek = -90  # mV

h.celsius = 35
h.tstop = 1000
h.v_init = -60

h.nrncontrolmenu()

vWin = h.Graph(0)
vWin.size(0, runTime, -80, 20)
vWin.view(0, -80, runTime, 100, grXCoord, grYCoord, grWidth, grHeight)
grYCoord = grYCoord + grHeight + 100
vWin.addexpr("v(0.5)")
h.graphList[0].append(vWin)

iWin = h.Graph(0)
iWin.size(0, runTime, -0.005, 0.005)
iWin.view(0, -0.005, runTime, 0.01, grXCoord, grYCoord, grWidth, grHeight)
grYCoord = grYCoord + grHeight + 100
iWin.addvar("naf", soma(0.5)._ref_ina_naf, 2, 1)
iWin.addvar("nal", soma(0.5)._ref_ina_nal, 6, 1)
iWin.addvar("kdr", soma(0.5)._ref_ik_kdr, 3, 1)
iWin.addvar("ka", soma(0.5)._ref_ik_ka, 7, 1)
iWin.addvar("sk", soma(0.5)._ref_ik_sk, 4, 1)
示例#19
0
 def plot(self, variable, location=0.5, tmin=0, tmax=5, xmin=-80, xmax=40):
     import neuron.gui
     self.graph = h.Graph()
     h.graphList[0].append(self.graph)
     self.graph.size(tmin, tmax, xmin, xmax)
     self.graph.addvar('%s(%g)' % (variable, location), sec=self)
示例#20
0
h('forall psection()')

# vectors and plot
h.tstop = 520

trec = h.Vector()
trec.record(h._ref_t)

h.dt = 0.0025

h.steps_per_ms = 1 / h.dt

if plot:
    # Display: display_d1
    display_d1 = h.Graph(0)
    display_d1.size(0, h.tstop, -80.0, 50.0)
    display_d1.view(0, -80.0, h.tstop, 130.0, 80, 330, 330, 250)
    h.graphList[0].append(display_d1)
    # Line, plotting: RS_pop[0]/v
    display_d1.addexpr("v(0.5)", "v(0.5)", 1, 1, 0.8, 0.9, 2)

    # Display: display_d2
    display_d2 = h.Graph(0)
    display_d2.size(0, h.tstop, -80.0, 50.0)
    display_d2.view(0, -80.0, h.tstop, 130.0, 80, 330, 330, 250)
    h.graphList[0].append(display_d2)
    display_d2.addexpr("Izhi2007b[0].u", "Izhi2007b[0].u", 1, 1, 0.8, 0.9, 2)

# File to save: time
# Column: time
示例#21
0
  z1 = y.x[0]
  z2 = -fabs(cos(z1)) # jacobian element is db[1]/dy[0]
  z2 = 0
  gmat.setval(1,0, z2)
  b.x[1] = -sin(z1) + z1*z2

nlm = h.LinearMechanism(callback, cmat, gmat, y, y0, b)


dummy = h.Section()
trajec = h.Vector()
tvec = h.Vector()
trajec.record(y._ref_x[0])
tvec.record(h._ref_t)

graph = h.Graph()
h.tstop=50

def prun(theta0, omega0):
  graph.erase()
  y0.x[0] = theta0
  y0.x[1] = omega0
  h.run()
  trajec.line(graph, tvec)

h.dt /= 10
h.cvode.atol(1e-5)
h.cvode_active(1)
prun(0, 1.9999) # 2.0001 will keep it rotating
graph.exec_menu("View = plot")
from neuron import h

from mkmitral import *
import csv

amps = [1, 2, 5]  # Current stimulation values in nA
delay = 40  # ms
duration = 100  # ms
tstop = 2 * delay + duration
h.dt = 0.01  # ms
vinit = -65  # mV

cells = []
stims = []
graphs = []
closeup = h.Graph(0)
data = []


def main(gui=True):

    if gui:

        h.load_file("stdlib.hoc")
        h.load_file("stdgui.hoc")
        h.steps_per_ms = 1 / h.dt

    # For each current value, create a cell
    for c in xrange(0, len(amps)):
        print("Trying amplitude:  %snA" % amps[c])
        cells.append(mkmitral(0))
示例#23
0
                print(list(result[2]))
                assert False

    for mode in [0, 1, 2]:
        runassert(mode)

    coreneuron.enable = False
    # teardown
    pc.gid_clear()
    return stdlist


if __name__ == "__main__":
    try:
        from neuron import gui

        stdlist = test_netmove()
        g = h.Graph()
        print("n_netsend  n_netmove")
        for result in stdlist:
            print(result[0], result[1])
            result[2].line(g)
        g.exec_menu("View = plot")
    except:
        traceback.print_exc()
        # Make the CTest test fail
        sys.exit(42)
    # The test doesn't exit without this.
    if enable_gpu:
        h.quit()
示例#24
0
stimulus.start = 100
stimulus.number = 7
stimulus.interval = 500

stimulator = h.NetCon(stimulus, mf.skin, 0, 0, 1)


def go(v_init, tstop, init):
    if init:
        h.finitialize(v_init)
    while h.t < tstop:
        h.fadvance()


h.tstop = 2000
h.v_init = -60
mf.skin.number = 10
go(h.v_init, h.tstop, 1)
mf.skin.number = 50
go(h.v_init, 4000, 0)

raster = h.Graph(0)
raster.exec_menu("Keep Lines")
mf.SpikeTrain_output[0].mark(raster, mf.SpikeTrain_output[1], "|", 12, 1)

# for idx,v in enumerate(mf.SpikeTrain_output):
#     v[0].mark(raster,v[1], "|",12,idx+2)

raster.view(0, 0, 400, nrel + 1, 0, 48, 1000, 1000)
#raster.flush()
示例#25
0
 def gui(self):
     self.g = h.Graph()
     self.g.size(0, h.tstop, -65, -50)
示例#26
0
  mkhalfgap(2, seg2, seg1, g)

def setgap(g):
  for hg in hglist:
    hg.g = g

seg1 = cells[0].soma(.5) if 0 in cells else None
seg2 = cells[1].soma(.5) if 1 in cells else None
mkgap(seg1, seg2, .0001)

for g in [0., .0001, .001, .01]:
  print ("\n gap conductance %g" % g)
  setgap(g)
  imp(0)
  imp(1)
  phenom_imp(1., seg1, seg1)
  phenom_imp(1., seg1, seg2)
  imp(10)
  imp(100)

setgap(0.)
a = phenom_imp(1., seg1, seg1)
gr1 = h.Graph()
a[2].line(gr1)
gr2 = h.Graph()
a[3].line(gr2)

if nhost > 1:
  pc.barrier()
  h.quit()
示例#27
0
文件: fig1.py 项目: schloegl/ringtest
f.close()

def select(x, y, sel):
  result = []
  for d in data:
    if eval(sel):
      result.append((eval(x), eval(y)))
  result.sort(cmp=lambda a,b: cmp(a[0], b[0]))

  return result

result = select("d.npt", "d.solvetime", "d.permute == 1")

from neuron import h, gui
from math import log
g = h.Graph()
def plot(result, g, mark):
  r = [(log(a, 2), b) for (a,b) in result]
  for p in r:
    g.mark(p[0], p[1], mark, 8)
  g.beginline(9,1)
  g.line(r[0][0], r[-1][1])
  g.line(r[-1][0], r[-1][1])
  g.flush()
  g.exec_menu("View = plot")
  g.size(0,5,0,25)

plot(result, g, "o")

result = select("d.npt", "float(d.perf.split()[1][0:-1])", "d.permute == 1")
plot(result, g, "O")
示例#28
0
            'passed' if val == correct_val else 'failed')))


a = h.ref(0)
b = h.ref(0)
c = h.ref('foo')
d = c
v = h.Vector([1, 2])
h('double x[3][2][2]')
h('double y[3][2]')
h('double z1[2], z2[2]')
h('''
proc xaxis() {
}
''')
g = h.Graph(0)
g2 = h.Graph(0)

print("""
                          Test      Value  Expected  Result
-----------------------------------------------------------""")

do_test('a==a', a == a, True)
do_test('a==b', a == b, False)
do_test('a!=b', a != b, True)
do_test('d==c', d == c, True)
do_test('h._ref_t == h._ref_t', h._ref_t == h._ref_t, True)
do_test('h._ref_t < h._ref_t', h._ref_t < h._ref_t, False)
do_test('h._ref_t == v._ref_x[0]', h._ref_t == v._ref_x[0], False)
do_test('h._ref_z1 == h._ref_z1', h._ref_z1 == h._ref_z1, True)
do_test('h._ref_z1 == h._ref_z2', h._ref_z1 == h._ref_z2, False)