def test_guess_udic():
    dic, data = ng.pipe.read(NMRPIPE_2D_FREQ)
    udic = ng.pipe.guess_udic(dic, data)
    assert udic[0]['car'] == 12375.0
    assert udic[0]['complex'] is False
    assert udic[0]['encoding'] == 'states'
    assert udic[0]['freq'] is True
    assert udic[0]['label'] == 'C13'
    assert udic[0]['obs'] == 125.0
    assert udic[0]['size'] == 2
    assert udic[0]['sw'] == 20000.0
    assert udic[0]['time'] is False
    assert round(udic[1]['car']) == 2350
    assert udic[1]['complex'] is False
    assert udic[1]['encoding'] == 'states'
    assert udic[1]['freq'] is True
    assert udic[1]['label'] == 'H1'
    assert udic[1]['obs'] == 500.0
    assert udic[1]['size'] == 8
    assert udic[1]['sw'] == 50000.0
    assert udic[1]['time'] is False
    assert udic['ndim'] == 2

    dic, data = ng.pipe.read(NMRPIPE_2D_TIME)
    udic = ng.pipe.guess_udic(dic, data)
    assert udic[0]['car'] == 12375.0
    assert udic[0]['complex'] is True
    assert udic[0]['encoding'] == 'states'
    assert udic[0]['freq'] is False
    assert udic[0]['label'] == 'C13'
    assert udic[0]['obs'] == 125.0
    assert udic[0]['size'] == 4
    assert udic[0]['sw'] == 20000.0
    assert udic[0]['time'] is True
    assert round(udic[1]['car']) == 2350
    assert udic[1]['complex'] is True
    assert udic[1]['encoding'] == 'states'
    assert udic[1]['freq'] is False
    assert udic[1]['label'] == 'H1'
    assert udic[1]['obs'] == 500.0
    assert udic[1]['size'] == 8
    assert udic[1]['sw'] == 50000.0
    assert udic[1]['time'] is True
    assert udic['ndim'] == 2
Save a user's action to the persistent medium.
dataset/ETHPy150Open jjhelmus/nmrglue/nmrglue/fileio/tests/test_pipe.py/test_guess_udic--crossover with--dataset/ETHPy150Open dcrosta/dabble/dabble/__init__.py/ResultStorage.record