simulariumio/cytosim/cytosim_converter.py
def _parse_object_dimensions(
        data_lines: List[str],
        is_fiber: bool,
    ) -> DimensionData:
        """
        Parse a Cytosim output file containing objects
        (fibers, solids, singles, or couples) to get the number
        of subpoints per agent per timestep
        """
        result = DimensionData(0, 0)
        agents = 0
        subpoints = 0
        for line in data_lines:
            if CytosimConverter._ignore_line(line):
                continue
            if line[0] == "%":
                if "frame" in line:
                    if agents > result.max_agents:
                        result.max_agents = agents
                    agents = 0
                    result.total_steps += 1
                elif "fiber" in line:
                    if subpoints > result.max_subpoints:
                        result.max_subpoints = subpoints
                    subpoints = 0
                    agents += 1
                continue
            if is_fiber:
                subpoints += 1
            else:
                agents += 1
        if agents > result.max_agents:
            result.max_agents = agents
        if subpoints > result.max_subpoints:
            result.max_subpoints = subpoints
        return result

        Parse a Cytosim output file containing objects
        (fibers, solids, singles, or couples) to get the number
        of subpoints per agent per timestep
        
Parse a Cytosim output file containing objects
(fibers, solids, singles, or couples) to get the number
of subpoints per agent per timestep
Parse a Cytosim output file containing objects ( fibers solids singles or couples ) to get the number of subpoints per agent per timestep
def _parse_object_dimensions(
        data_lines: List[str],
        is_fiber: bool,
    ) -> DimensionData:
        result = DimensionData(0, 0)
        agents = 0
        subpoints = 0
        for line in data_lines:
            if CytosimConverter._ignore_line(line):
                continue
            if line[0] == "%":
                if "frame" in line:
                    if agents > result.max_agents:
                        result.max_agents = agents
                    agents = 0
                    result.total_steps += 1
                elif "fiber" in line:
                    if subpoints > result.max_subpoints:
                        result.max_subpoints = subpoints
                    subpoints = 0
                    agents += 1
                continue
            if is_fiber:
                subpoints += 1
            else:
                agents += 1
        if agents > result.max_agents:
            result.max_agents = agents
        if subpoints > result.max_subpoints:
            result.max_subpoints = subpoints
        return result
def _parse_object_dimensions ( data_lines : List [ str ] , is_fiber : bool , ) -> DimensionData : result = DimensionData ( 0 , 0 ) agents = 0 subpoints = 0 for line in data_lines : if CytosimConverter . _ignore_line ( line ) : continue if line [ 0 ] == "%" : if "frame" in line : if agents > result . max_agents : result . max_agents = agents agents = 0 result . total_steps += 1 elif "fiber" in line : if subpoints > result . max_subpoints : result . max_subpoints = subpoints subpoints = 0 agents += 1 continue if is_fiber : subpoints += 1 else : agents += 1 if agents > result . max_agents : result . max_agents = agents if subpoints > result . max_subpoints : result . max_subpoints = subpoints return result
Parse a Cytosim output file containing objects
(fibers, solids, singles, or couples) to get the number
of subpoints per agent per timestep
Parse a Cytosim output file containing objects ( fibers solids singles or couples ) to get the number of subpoints per agent per timestep
"""
        Parse a Cytosim output file containing objects
        (fibers, solids, singles, or couples) to get the number
        of subpoints per agent per timestep
        """
data_lines
List[str]
is_fiber
bool