Beispiel #1
0
def test_hexagrid3d_noise():
    np.random.seed(1)
    grid = hexa_grid3d(6, 4, 3, noise=0.1)
    datasets = from_3d_voronoi(Voronoi(grid))
    assert datasets["vert"].shape[0] == 318
    assert datasets["edge"].shape[0] == 3300
    assert datasets["face"].shape[0] == 335
    assert datasets["cell"].shape[0] == 72
Beispiel #2
0
def test_from_3d_voronoi():

    grid = hexa_grid3d(6, 4, 3)
    datasets = from_3d_voronoi(Voronoi(grid))
    assert datasets["vert"].shape[0] == 139
    assert datasets["edge"].shape[0] == 1272
    assert datasets["face"].shape[0] == 141
    assert datasets["cell"].shape[0] == 70
    bulk = Epithelium("bulk", datasets, config.geometry.bulk_spec())
    bulk.reset_index()
    bulk.reset_topo()
    BulkGeometry.update_all(bulk)
    bulk.sanitize()
    assert bulk.validate()
Beispiel #3
0
def test_from_3d_voronoi():

    grid = hexa_grid3d(6, 4, 3)
    datasets = from_3d_voronoi(Voronoi(grid))
    assert datasets["vert"].shape[0] == 139
    assert datasets["edge"].shape[0] == 1272
    assert datasets["face"].shape[0] == 282
    assert datasets["cell"].shape[0] == 70
    bulk = Epithelium("bulk", datasets, config.geometry.bulk_spec())
    bulk.reset_index()
    bulk.reset_topo()
    BulkGeometry.update_all(bulk)
    bulk.sanitize()

    # GH 137
    assert (bulk.edge_df.groupby("face").apply(
        lambda df: df["cell"].unique().size).max() == 1)
    assert bulk.validate()
def test_bulk_division():

    cells = hexa_grid3d(4, 4, 6)
    datasets = from_3d_voronoi(Voronoi(cells))
    specs = bulk_spec()
    bulk = Epithelium("bulk", datasets, specs)
    bulk.reset_topo()
    bulk.reset_index()
    bulk.sanitize()
    bulk.reset_topo()
    bulk.reset_index()
    cell_division(bulk, 4, BulkGeometry)

    dsets = hdf5.load_datasets(Path(stores_dir) / "with_4sided_cell.hf5")
    bulk = Monolayer("4", dsets)

    BulkGeometry.update_all(bulk)

    # daughter = cell_division(bulk, 12, BulkGeometry)
    with pytest.warns(UserWarning):
        cell_division(bulk, 4, BulkGeometry)
        assert bulk.validate()
Beispiel #5
0
def test_single_cell():
    grid = hexa_grid3d(6, 4, 3)
    datasets = from_3d_voronoi(Voronoi(grid))
    sheet = Sheet("test", datasets)
    eptm = utils.single_cell(sheet, 1)
    assert len(eptm.edge_df) == len(sheet.edge_df[sheet.edge_df["cell"] == 1])