simulariumio/file_converter.py
def _update_trajectory_info_v1_to_v2(data: Dict[str, Any]) -> Dict[str, Any]:
        """
        Update the trajectory info block from v1 to v2
        """
        # units
        if "spatialUnitFactorMeters" in data["trajectoryInfo"]:
            spatial_units = UnitData(
                "m", data["trajectoryInfo"]["spatialUnitFactorMeters"]
            )
            data["trajectoryInfo"].pop("spatialUnitFactorMeters")
        else:
            spatial_units = UnitData("m")
        data["trajectoryInfo"]["spatialUnits"] = {
            "magnitude": spatial_units.magnitude,
            "name": spatial_units.name,
        }
        time_units = UnitData("s", 1.0)
        data["trajectoryInfo"]["timeUnits"] = {
            "magnitude": time_units.magnitude,
            "name": time_units.name,
        }
        data["trajectoryInfo"]["version"] = 2
        return data

        Update the trajectory info block from v1 to v2
        
Update the trajectory info block from v1 to v2
Update the trajectory info block from v1 to v2
def _update_trajectory_info_v1_to_v2(data: Dict[str, Any]) -> Dict[str, Any]:
        if "spatialUnitFactorMeters" in data["trajectoryInfo"]:
            spatial_units = UnitData(
                "m", data["trajectoryInfo"]["spatialUnitFactorMeters"]
            )
            data["trajectoryInfo"].pop("spatialUnitFactorMeters")
        else:
            spatial_units = UnitData("m")
        data["trajectoryInfo"]["spatialUnits"] = {
            "magnitude": spatial_units.magnitude,
            "name": spatial_units.name,
        }
        time_units = UnitData("s", 1.0)
        data["trajectoryInfo"]["timeUnits"] = {
            "magnitude": time_units.magnitude,
            "name": time_units.name,
        }
        data["trajectoryInfo"]["version"] = 2
        return data
def _update_trajectory_info_v1_to_v2 ( data : Dict [ str , Any ] ) -> Dict [ str , Any ] : if "spatialUnitFactorMeters" in data [ "trajectoryInfo" ] : spatial_units = UnitData ( "m" , data [ "trajectoryInfo" ] [ "spatialUnitFactorMeters" ] ) data [ "trajectoryInfo" ] . pop ( "spatialUnitFactorMeters" ) else : spatial_units = UnitData ( "m" ) data [ "trajectoryInfo" ] [ "spatialUnits" ] = { "magnitude" : spatial_units . magnitude , "name" : spatial_units . name , } time_units = UnitData ( "s" , 1.0 ) data [ "trajectoryInfo" ] [ "timeUnits" ] = { "magnitude" : time_units . magnitude , "name" : time_units . name , } data [ "trajectoryInfo" ] [ "version" ] = 2 return data
Update the trajectory info block from v1 to v2
Update the trajectory info block from v1 to v2
"""
        Update the trajectory info block from v1 to v2
        """ # units
data
Dict[str, Any]