# weekly_points

Python reference for `nagasim.build.weekly_points`.

`nagasim.build.weekly_points`

```python
weekly_points(values_168: list[float], unit: str = 'minutes')
```

Return a repeating ``points`` schedule from 168 hourly values.

The first value is Monday 00:00. Each run of equal hours becomes one
``[duration, value]`` point, the duration in *unit*. Runs are not merged across
the end of the week, so Monday 00:00 stays at time 0 and the period is one week.
Use it as ``{"name": ..., "kind": ..., **weekly_points(values)}`` in ``schedules``.

Parameters
----------
values_168 : list of float
    Exactly 168 numbers, one per hour of the week from Monday 00:00.
unit : str
    ``"minutes"`` (default) or ``"seconds"``, the model's time unit.

Returns
-------
dict
    ``{"points": [[duration, value], ...], "repeat": True}``.

See Also
--------
nagasim.build.Model : Takes the schedule in ``schedules``.

Examples
--------
>>> from nagasim import build as nb
>>> nb.weekly_points([0] * 8 + [2] * 160)["points"]
[[480, 0], [9600, 2]]
