Пример #1
0
def test_produce_cytokines_n(
    macrophage_list: MacrophageCellList,
    grid: RectangularGrid,
    populated_fungus: FungusCellList,
    cyto,
):
    m_n = 10
    macrophage_list.append(
        MacrophageCellData.create_cell(point=Point(x=grid.x[3],
                                                   y=grid.y[3],
                                                   z=grid.z[3]), ))
    vox = grid.get_voxel(macrophage_list[0]['point'])
    assert vox.z == 3 and vox.y == 3 and vox.x == 3

    for cell in populated_fungus.cell_data:
        vox = grid.get_voxel(cell['point'])
    assert vox.z in [1, 2, 3, 4, 5] and vox.y in [1, 2, 3, 4, 5] and vox.x in [
        1, 2, 3, 4, 5
    ]

    # 1
    m_det = 1
    assert cyto[3, 3, 3] == 0

    macrophage_list.produce_cytokines(m_det, m_n, grid, populated_fungus, cyto)
    assert cyto[3, 3, 3] == 30

    # 2
    m_det = 2
    cyto[3, 3, 3] = 0

    macrophage_list.produce_cytokines(m_det, m_n, grid, populated_fungus, cyto)
    assert cyto[3, 3, 3] == 50
Пример #2
0
def test_produce_cytokines_0(
    macrophage_list: MacrophageCellList,
    grid: RectangularGrid,
    populated_fungus: FungusCellList,
    cyto,
):
    m_det = 0
    m_n = 10

    assert cyto[3, 3, 3] == 0

    macrophage_list.append(
        MacrophageCellData.create_cell(point=Point(x=grid.x[3],
                                                   y=grid.y[3],
                                                   z=grid.z[3]), ))

    vox = grid.get_voxel(macrophage_list[0]['point'])
    assert vox.z == 3 and vox.y == 3 and vox.x == 3

    macrophage_list.produce_cytokines(m_det, m_n, grid, populated_fungus, cyto)

    assert cyto[3, 3, 3] == 10