pytams.worker ============= .. py:module:: pytams.worker .. autoapi-nested-parse:: A set of functions used by TAMS workers. Functions --------- .. autoapisummary:: pytams.worker.traj_advance_with_exception pytams.worker.pool_worker pytams.worker.ms_worker pytams.worker.worker_async Module Contents --------------- .. py:function:: traj_advance_with_exception(traj: pytams.trajectory.Trajectory, walltime: float, a_db: pytams.database.Database | None) -> pytams.trajectory.Trajectory Advance a trajectory with exception handling. :param traj: a trajectory :param walltime: the time limit to advance the trajectory :param a_db: a database :returns: The updated trajectory .. py:function:: pool_worker(traj: pytams.trajectory.Trajectory, end_date: datetime.date, db_path: str | None = None) -> pytams.trajectory.Trajectory A worker to generate each initial trajectory. :param traj: a trajectory :param end_date: the time limit to advance the trajectory :param db_path: a path to a TAMS database or None :returns: The updated trajectory .. py:function:: ms_worker(from_traj: pytams.trajectory.Trajectory, rst_traj: pytams.trajectory.Trajectory, min_val: float, end_date: datetime.date, db_path: str | None = None) -> pytams.trajectory.Trajectory A worker to restart trajectories. :param from_traj: a trajectory to restart from :param rst_traj: the trajectory being restarted :param min_val: the value of the score function to restart from :param end_date: the time limit to advance the trajectory :param db_path: a database path or None .. py:function:: worker_async(queue: asyncio.Queue[tuple[collections.abc.Callable[Ellipsis, Any], pytams.trajectory.Trajectory, float, bool, str]], res_queue: asyncio.Queue[asyncio.Future[pytams.trajectory.Trajectory]], executor: concurrent.futures.Executor) -> None :async: An async worker for the asyncio taskrunner. It wraps the call to one of the above worker functions with access to the queue. :param queue: a queue from which to get tasks :param res_queue: a queue to put the results in :param executor: an executor to launch the work in