Esempio n. 1
0
def test_upcast():
    datasets_2d, specs = three_faces_sheet(zaxis=True)
    datasets = extrude(datasets_2d)
    eptm = Epithelium("3faces_3D", datasets, specs)
    eptm.cell_df["test_data"] = eptm.cell_df.index
    eptm.face_df["test_data"] = eptm.face_df.index
    eptm.vert_df["test_data"] = eptm.vert_df.index

    assert_array_equal(eptm.upcast_srce(eptm.vert_df["test_data"]),
                       eptm.edge_df["srce"])
    assert_array_equal(eptm.upcast_srce("test_data"), eptm.edge_df["srce"])
    assert_array_equal(eptm.upcast_trgt(eptm.vert_df["test_data"]),
                       eptm.edge_df["trgt"])
    assert_array_equal(eptm.upcast_trgt("test_data"), eptm.edge_df["trgt"])

    assert_array_equal(eptm.upcast_face("test_data"), eptm.edge_df["face"])
    assert_array_equal(eptm.upcast_cell("test_data"), eptm.edge_df["cell"])
Esempio n. 2
0
def test_upcast_ndarray():
    datasets_2d, specs = three_faces_sheet(zaxis=True)
    datasets = extrude(datasets_2d)
    eptm = Epithelium("3faces_3D", datasets, specs)
    data = np.arange(eptm.Nv * 3).reshape((eptm.Nv, 3))
    assert eptm.upcast_srce(data).shape == (eptm.Ne, 3)