

def compare(myg1, myd1, myg2, myd2):
    if (not (myg1 == myg2)):
        return 'gridbad'
    if (not (myg2.vars == myd2.vars)):
        return 'namesbad'
    print(' ')
    print('variable comparisons:')
    result = 0
    for n in range(myd1.nvar):
        d1 = myd1.get_var(myd1.vars[n])
        d2 = myd2.get_var(myd2.vars[n])
        err = numpy.max(numpy.abs((d1.v() - d2.v())))
        print(('%20s error = %20.10g' % (myd1.vars[n], err)))
        if (not (err == 0)):
            result = 'varerr'
    return result

dataset/ETHPy150Open zingale/pyro2/compare.py compare/VarMisuse@36/47 `myd1`->`myg2`