Пример #1
0
def check_xray_fields(ds_fn, fields):
    if not can_run_ds(ds_fn): return
    dso = [None, ("sphere", ("m", (0.1, 'unitary')))]
    for field in fields:
        for dobj_name in dso:
            for axis in [0, 1, 2]:
                yield ProjectionValuesTest(ds_fn, axis, field, None, dobj_name)
            yield FieldValuesTest(ds_fn, field, dobj_name)
Пример #2
0
def standard_small_simulation(ds_fn, fields):
    if not can_run_ds(ds_fn): return
    dso = [None]
    tolerance = ytcfg.getint("yt", "answer_testing_tolerance")
    bitwise = ytcfg.getboolean("yt", "answer_testing_bitwise")
    for field in fields:
        if bitwise:
            yield GridValuesTest(ds_fn, field)
        if 'particle' in field: continue
        for dobj_name in dso:
            for axis in [0, 1, 2]:
                for weight_field in [None, "Density"]:
                    yield ProjectionValuesTest(
                        ds_fn, axis, field, weight_field,
                        dobj_name, decimals=tolerance)
            yield FieldValuesTest(
                    ds_fn, field, dobj_name, decimals=tolerance)
def standard_small_simulation(ds_fn, fields):
    if not can_run_ds(ds_fn): return
    dso = [None]
    tolerance = ytcfg.getint("yt", "answer_testing_tolerance")
    bitwise = ytcfg.getboolean("yt", "answer_testing_bitwise")
    for field in fields:
        if bitwise:
            yield GridValuesTest(ds_fn, field)
        if 'particle' in field: continue
        for dobj_name in dso:
            for axis in [0, 1, 2]:
                for weight_field in [None, "Density"]:
                    yield ProjectionValuesTest(
                        ds_fn, axis, field, weight_field,
                        dobj_name, decimals=tolerance)
            yield FieldValuesTest(
                    ds_fn, field, dobj_name, decimals=tolerance)
Пример #4
0
def test_cm1_mesh_fields():
    ds = data_dir_load(cm1sim)
    assert_equal(str(ds), "nc4_cm1_lofs_tornado_test.nc")

    # run the small_patch_amr tests on safe fields
    ic = ds.domain_center
    for test in small_patch_amr(ds, _fields, input_center=ic, input_weight=None):
        test_cm1_mesh_fields.__name__ = test.description
        yield test

    # manually run the Grid and Field Values tests on dbz (do not want to run the
    # ProjectionValuesTest for this field)
    if can_run_ds(ds):
        dso = [None, ("sphere", (ic, (0.1, "unitary")))]
        for field in [("cm1", "dbz")]:
            yield GridValuesTest(ds, field)
            for dobj_name in dso:
                yield FieldValuesTest(ds, field, dobj_name)