simulariumio/mcell/mcell_converter.py
def _read(input_data: McellData) -> TrajectoryData:
        """
        Return an object containing the data shaped for Simularium format
        """
        print("Reading MCell Data -------------")
        # read data model json
        with open(input_data.path_to_data_model_json) as data_model_file:
            data_model = json.load(data_model_file)
        # read spatial data
        time_units = UnitData(
            "s", float(data_model["mcell"]["initialization"]["time_step"])
        )
        agent_data = McellConverter._read_cellblender_data(
            time_units.magnitude,
            data_model["mcell"]["define_molecules"]["molecule_list"],
            input_data,
        )
        time_units.magnitude = 1
        # get box size
        partitions = data_model["mcell"]["initialization"]["partitions"]
        box_size = np.array(
            [
                float(partitions["x_end"]) - float(partitions["x_start"]),
                float(partitions["y_end"]) - float(partitions["y_start"]),
                float(partitions["z_end"]) - float(partitions["z_start"]),
            ]
        )
        # get display data (geometry and color)
        for type_name in input_data.display_data:
            display_data = input_data.display_data[type_name]
            agent_data.display_data[display_data.name] = display_data
        input_data.meta_data._set_box_size(box_size)
        return TrajectoryData(
            meta_data=input_data.meta_data,
            agent_data=agent_data,
            time_units=time_units,
            spatial_units=UnitData("µm", 1.0 / input_data.meta_data.scale_factor),
            plots=input_data.plots,
        )

        Return an object containing the data shaped for Simularium format
        
Return an object containing the data shaped for Simularium format
Return an object containing the data shaped for Simularium format
def _read(input_data: McellData) -> TrajectoryData:
        print("Reading MCell Data -------------")
        with open(input_data.path_to_data_model_json) as data_model_file:
            data_model = json.load(data_model_file)
        time_units = UnitData(
            "s", float(data_model["mcell"]["initialization"]["time_step"])
        )
        agent_data = McellConverter._read_cellblender_data(
            time_units.magnitude,
            data_model["mcell"]["define_molecules"]["molecule_list"],
            input_data,
        )
        time_units.magnitude = 1
        partitions = data_model["mcell"]["initialization"]["partitions"]
        box_size = np.array(
            [
                float(partitions["x_end"]) - float(partitions["x_start"]),
                float(partitions["y_end"]) - float(partitions["y_start"]),
                float(partitions["z_end"]) - float(partitions["z_start"]),
            ]
        )
        for type_name in input_data.display_data:
            display_data = input_data.display_data[type_name]
            agent_data.display_data[display_data.name] = display_data
        input_data.meta_data._set_box_size(box_size)
        return TrajectoryData(
            meta_data=input_data.meta_data,
            agent_data=agent_data,
            time_units=time_units,
            spatial_units=UnitData("µm", 1.0 / input_data.meta_data.scale_factor),
            plots=input_data.plots,
        )
def _read ( input_data : McellData ) -> TrajectoryData : print ( "Reading MCell Data -------------" ) with open ( input_data . path_to_data_model_json ) as data_model_file : data_model = json . load ( data_model_file ) time_units = UnitData ( "s" , float ( data_model [ "mcell" ] [ "initialization" ] [ "time_step" ] ) ) agent_data = McellConverter . _read_cellblender_data ( time_units . magnitude , data_model [ "mcell" ] [ "define_molecules" ] [ "molecule_list" ] , input_data , ) time_units . magnitude = 1 partitions = data_model [ "mcell" ] [ "initialization" ] [ "partitions" ] box_size = np . array ( [ float ( partitions [ "x_end" ] ) - float ( partitions [ "x_start" ] ) , float ( partitions [ "y_end" ] ) - float ( partitions [ "y_start" ] ) , float ( partitions [ "z_end" ] ) - float ( partitions [ "z_start" ] ) , ] ) for type_name in input_data . display_data : display_data = input_data . display_data [ type_name ] agent_data . display_data [ display_data . name ] = display_data input_data . meta_data . _set_box_size ( box_size ) return TrajectoryData ( meta_data = input_data . meta_data , agent_data = agent_data , time_units = time_units , spatial_units = UnitData ( "µm", .0  nput_data. m eta_data. s cale_factor) , plots = input_data . plots , )
Return an object containing the data shaped for Simularium format
Return an object containing the data shaped for Simularium format
"""
        Return an object containing the data shaped for Simularium format
        """ # read data model json # read spatial data # get box size # get display data (geometry and color)
input_data
McellData