+
    ]gj                    .    R t ^ RIHt R R ltR R ltR# )u  Shared pace math for usage-window tracking.

`server.py::_compute_pace` and `simulate_display.py::draw_gauge` both need to
turn "how far into the window are we, and how much has been used" into a pace
ratio, but they apply *different* guard/clamp policy on top of that ratio:

- `server.py` returns the raw, unclamped ratio (or `None` on a few edge
  conditions) because it feeds the `/status` API's `"pace"` field, a real
  consumer surface.
- `simulate_display.py` clamps the ratio to `[0.0, 2.0]` for the gauge's
  visual arc and has its own branch behavior at the edges.

Only the genuinely-shared arithmetic lives here. Each caller keeps its own
guards, clamps, and edge-case handling exactly as before — this module does
not decide policy.
)annotationsc               $    V ^8  d   QhRRRRRR/# )   resets_in_secintduration_secreturnfloat )formats   ";/Users/jameslopez/projects/CodexBar-ESP32/companion/pace.py__annotate__r      s!     9 9C 9s 9u 9    c                     W,
          V,          # )u   Fraction of the window elapsed so far: (duration - remaining) / duration.

Caller is responsible for guarding `duration_sec` (e.g. against zero or
negative values) and for clamping/interpreting the result — this is pure
arithmetic, no policy.
r
   )r   r   s   &&r   elapsed_fractionr      s     (L88r   c               $    V ^8  d   QhRRRRRR/# )r   pctr	   elapsed_fracr   r
   )r   s   "r   r   r      s!     	( 	(E 	( 	(5 	(r   c                     WR,          ,          # )a|  Usage pace ratio: pct used vs. pct expected at this point in the window.

`elapsed_frac * 100.0` is the expected usage percent if usage were
perfectly linear; `pct / expected_pct` is 1.0 exactly on pace, >1.0 ahead
of pace (overpace), <1.0 behind pace (underpace). Caller is responsible
for guarding `elapsed_frac` (e.g. against zero/negative) and for any
clamping of the result.
g      Y@r
   )r   r   s   &&r   
pace_ratior      s     &''r   N)__doc__
__future__r   r   r   r
   r   r   <module>r      s   " #9	(r   