Exemple #1
0
def default_empad():
    executor = InlineJobExecutor()
    ds = EMPADDataSet(
        path=EMPAD_XML,
    )
    ds = ds.initialize(executor)
    yield ds
Exemple #2
0
def test_nonexistent():
    ds = EMPADDataSet(
        path="/does/not/exist.raw",
        scan_size=(4, 4),
    )
    with pytest.raises(DataSetException) as e:
        ds = ds.initialize()
    assert "No such file or directory" in str(e)
Exemple #3
0
def test_nonexistent():
    ds = EMPADDataSet(
        path="/does/not/exist.raw",
        scan_size=(4, 4),
    )
    with pytest.raises(DataSetException) as einfo:
        ds = ds.initialize(InlineJobExecutor())
    assert einfo.match("No such file or directory")
Exemple #4
0
def test_nonexistent():
    ds = EMPADDataSet(
        path="/does/not/exist.raw",
        nav_shape=(4, 4),
    )
    with pytest.raises(DataSetException) as einfo:
        ds = ds.initialize(InlineJobExecutor())
    assert einfo.match("could not open file /does/not/exist.raw")
Exemple #5
0
def test_invalid_size():
    ds = EMPADDataSet(
        path=EMPAD_RAW,
        scan_size=(4, 5),
    )
    ds = ds.initialize()
    with pytest.raises(DataSetException) as e:
        ds.check_valid()
    assert "invalid filesize" in str(e)
Exemple #6
0
def test_invalid_size():
    ds = EMPADDataSet(
        path=EMPAD_RAW,
        scan_size=(4, 5),
    )
    ds = ds.initialize(InlineJobExecutor())
    with pytest.raises(DataSetException) as einfo:
        ds.check_valid()

    assert einfo.match("invalid filesize")
Exemple #7
0
def random_empad(tmpdir_factory):
    datadir = tmpdir_factory.mktemp('data')
    filename = datadir + '/empad-test-default.raw'
    data = _mk_random(size=(16, 16, 130, 128), dtype='float32')
    data.tofile(str(filename))
    del data
    ds = EMPADDataSet(
        path=str(filename),
        scan_size=(16, 16),
    )
    ds = ds.initialize()
    yield ds
Exemple #8
0
def test_empad_dist(dist_ctx):
    ds = EMPADDataSet(path="/data/EMPAD/acquisition_12_pretty.xml")
    ds = ds.initialize(dist_ctx.executor)
    analysis = dist_ctx.create_sum_analysis(dataset=ds)
    results = dist_ctx.run(analysis)
    assert results[0].raw_data.shape == (128, 128)
Exemple #9
0
def default_empad():
    ds = EMPADDataSet(path=EMPAD_XML, )
    ds = ds.initialize()
    yield ds
def test_new_empad_xml():
    executor = InlineJobExecutor()
    ds = EMPADDataSet(path=EMPAD_XML_2, )
    ds = ds.initialize(executor)
def test_empad_dist(dist_ctx):
    ds = EMPADDataSet(path=EMPAD_XML)
    ds = ds.initialize(dist_ctx.executor)
    analysis = dist_ctx.create_sum_analysis(dataset=ds)
    results = dist_ctx.run(analysis)
    assert results[0].raw_data.shape == (128, 128)