def test_upcast(): datasets_2d, specs = three_faces_sheet(zaxis=True) datasets = extrude(datasets_2d) eptm = Epithelium('3faces_3D', datasets, specs) eptm_2d = Epithelium('3faces_2D', datasets_2d, specs) expected_res = datasets['vert'].loc[eptm.e_cell_idx] expected_res.index = eptm.edge_df.index assert_array_equal(expected_res, eptm.upcast_cell(datasets['vert']))
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"])