def test_invalid_file(): try: nef=nefis.Nefis('data/tut_fti_waq-bal.his') except nefis.NefisException as exc: assert(exc.code==8023) return assert(False)
def load_data(): nef = nefis.Nefis('data/trim-tut_fti_waq.dat', 'data/trim-tut_fti_waq.def') g = dg.DflowGrid2D.from_nef_map(nef) u1 = nef['map-series'].getelt('U1', [10]) rho = nef['map-series'].getelt('RHO', [10]) dp0 = nef['map-const'].getelt('DP0', [0]) dps0 = nef['map-const'].getelt('DPS0', [0]) nef.close() return g, u1, rho, dp0, dps0
def test_open(): nef=nefis.Nefis('data/trim-tut_fti_waq.dat', 'data/trim-tut_fti_waq.def') assert(nef) nef.close()
def get_nef(): return nefis.Nefis('data/trim-tut_fti_waq.dat', 'data/trim-tut_fti_waq.def')
def test_character_element(): nef=nefis.Nefis('data/tut_fti_waq.hda', 'data/tut_fti_waq.hdf') sub_names=nef['DELWAQ_PARAMS'].getelt('SUBST_NAMES',[0]) assert(sub_names[0].strip()=='IM1')