
    SThG                         d dl Z d Zd Zy)    Nc                      d\  t        d        dt         d      z  z
  t        j                   z  dz         z   fd}|S )a  Calibration of the dynamic frames per second engine.

    I've started with the equation y = log10(x + m) * k + n, where:
      y is the desired fps, m and n are horizontal and vertical translation,
      k is a calibration factor, computed from some user input c (see readme for details).

    Considering minfps and maxfps as given constants, I came to:
      fps = log10(x + 1) * k + minfps, which must be equal to maxfps for x = c,
    so the factor k = (maxfps - minfps) / log10(c + 1), and
      fps = log10(x + 1) * (maxfps - minfps) / log10(c + 1) + minfps

    Neat! ;)

    Args:
        calibrate (float): user provided

    Returns:
        a callable to calculate the fps

    )g       @g      N@gư>g      Y@      ?c                 `    | dk  ry| k  r!t        j                  | z  dz         z  z   S S )Nr   g      $@r   )mathlog10)rateadjust_log_curve	calibratefactormax_fpsmin_fpss    d/home/www/backend.miabetepe.com/venv/lib/python3.12/site-packages/alive_progress/core/calibration.pyfpszcalibrated_fps.<locals>.fps   s>    19)::t&66"<=FPP    )maxminr   r   )r
   r   r	   r   r   r   s   ` @@@@r   calibrated_fpsr      sa    * GWD)$Ic)T224::y;K/Kr.Q#RRF  Jr   c                       fd}d z   |S )Nc                     S )N )_raterefresh_secss    r   r   zcustom_fps.<locals>.fps)   s	    r      r   )r   r   s   ` r   
custom_fpsr   (   s     |#LJr   )r   r   r   r   r   r   <module>r      s    !Hr   