simulariumio/physicell/physicell_converter.py
def _get_agent_type(
        cell_type: int,
        cell_phase: int,
        input_data: PhysicellData,
        ids: Dict[int, Dict[int, int]],
        last_id: int,
        type_mapping: Dict[int, str],
    ) -> int:
        """
        Get a unique agent type ID for a specific cell type and phase combination
        """
        if cell_type not in ids:
            ids[cell_type] = {}
        if cell_phase not in ids[cell_type]:
            ids[cell_type][cell_phase] = last_id
            type_name = ""
            if cell_type in input_data.display_data:
                type_name = input_data.display_data[cell_type].name
            else:
                type_name = PhysicellConverter._get_default_cell_name(cell_type)
            if (
                cell_type in input_data.phase_names
                and cell_phase in input_data.phase_names[cell_type]
            ):
                type_name += "#" + input_data.phase_names[cell_type][cell_phase]
            else:
                type_name += PhysicellConverter._get_default_phase_name(cell_phase)
            type_mapping[last_id] = type_name
            last_id += 1
        return ids[cell_type][cell_phase], ids, last_id, type_mapping

        Get a unique agent type ID for a specific cell type and phase combination
        
Get a unique agent type ID for a specific cell type and phase combination
Get a unique agent type ID for a specific cell type and phase combination
def _get_agent_type(
        cell_type: int,
        cell_phase: int,
        input_data: PhysicellData,
        ids: Dict[int, Dict[int, int]],
        last_id: int,
        type_mapping: Dict[int, str],
    ) -> int:
        if cell_type not in ids:
            ids[cell_type] = {}
        if cell_phase not in ids[cell_type]:
            ids[cell_type][cell_phase] = last_id
            type_name = ""
            if cell_type in input_data.display_data:
                type_name = input_data.display_data[cell_type].name
            else:
                type_name = PhysicellConverter._get_default_cell_name(cell_type)
            if (
                cell_type in input_data.phase_names
                and cell_phase in input_data.phase_names[cell_type]
            ):
                type_name += "#" + input_data.phase_names[cell_type][cell_phase]
            else:
                type_name += PhysicellConverter._get_default_phase_name(cell_phase)
            type_mapping[last_id] = type_name
            last_id += 1
        return ids[cell_type][cell_phase], ids, last_id, type_mapping
def _get_agent_type ( cell_type : int , cell_phase : int , input_data : PhysicellData , ids : Dict [ int , Dict [ int , int ] ] , last_id : int , type_mapping : Dict [ int , str ] , ) -> int : if cell_type not in ids : ids [ cell_type ] = { } if cell_phase not in ids [ cell_type ] : ids [ cell_type ] [ cell_phase ] = last_id type_name = "" if cell_type in input_data . display_data : type_name = input_data . display_data [ cell_type ] . name else : type_name = PhysicellConverter . _get_default_cell_name ( cell_type ) if ( cell_type in input_data . phase_names and cell_phase in input_data . phase_names [ cell_type ] ) : type_name += "#" + input_data . phase_names [ cell_type ] [ cell_phase ] else : type_name += PhysicellConverter . _get_default_phase_name ( cell_phase ) type_mapping [ last_id ] = type_name last_id += 1 return ids [ cell_type ] [ cell_phase ] , ids , last_id , type_mapping
Get a unique agent type ID for a specific cell type and phase combination
Get a unique agent type ID for a specific cell type and phase combination
"""
        Get a unique agent type ID for a specific cell type and phase combination
        """
cell_type
int
cell_phase
int
input_data
PhysicellData
ids
Dict[int, Dict[int, int]]
last_id
int
type_mapping
Dict[int, str]