pytams.utils

A set of utility functions for TAMS.

Functions

setup_logger(→ None)

Setup the logger parameters.

get_min_scored(→ tuple[list[int], ...)

Get the nworker lower scored trajectories or more if equal score.

moving_avg(→ numpy.typing.NDArray[Any])

Return the moving average of a 1D numpy array.

Module Contents

setup_logger(params: dict[Any, Any]) None[source]

Setup the logger parameters.

Parameters:

params – a dictionary of parameters

get_min_scored(maxes: numpy.typing.NDArray[Any], nworkers: int) tuple[list[int], numpy.typing.NDArray[Any]][source]

Get the nworker lower scored trajectories or more if equal score.

Parameters:
  • maxes – array of maximas accros all trajectories

  • nworkers – number of workers

Returns:

list of indices of the nworker lower scored trajectories array of minimas

moving_avg(arr_in: numpy.typing.NDArray[Any], window_l: int) numpy.typing.NDArray[Any][source]

Return the moving average of a 1D numpy array.

Parameters:
  • arr_in – 1D numpy array

  • window_l – length of the moving average window

Returns:

1D numpy array