mirror of
https://github.com/kuhyx/utils.git
synced 2026-11-10 20:07:18 +01:00
earned_time 0.13.1: sick-day helper out of resolve (pylint too-many-locals)
Some checks are pending
dependency freshness / dependencies on newest stable (push) Waiting to run
earned_time pre-commit / pre-commit (push) Waiting to run
earned_time tests / test (push) Waiting to run
file length / file-length (push) Waiting to run
md-naming / markdown naming convention (push) Waiting to run
palette drift / palette (push) Waiting to run
repo-contract / repo contract (push) Waiting to run
shared gate tests / gate unit tests (push) Waiting to run
Some checks are pending
dependency freshness / dependencies on newest stable (push) Waiting to run
earned_time pre-commit / pre-commit (push) Waiting to run
earned_time tests / test (push) Waiting to run
file length / file-length (push) Waiting to run
md-naming / markdown naming convention (push) Waiting to run
palette drift / palette (push) Waiting to run
repo-contract / repo contract (push) Waiting to run
shared gate tests / gate unit tests (push) Waiting to run
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
f1378e97f1
commit
09a3a15d64
@ -241,7 +241,7 @@ on the day itself is logged and does not count.
|
||||
## Install
|
||||
|
||||
```console
|
||||
pip install --user --break-system-packages --no-deps "earned-time @ git+https://github.com/kuhyx/utils@earned-time-v0.13.0#subdirectory=earned_time"
|
||||
pip install --user --break-system-packages --no-deps "earned-time @ git+https://github.com/kuhyx/utils@earned-time-v0.13.1#subdirectory=earned_time"
|
||||
```
|
||||
|
||||
The root `steam-backlog-enforcer.service` sets `HOME=/home/kuhy`, so it imports
|
||||
|
||||
@ -128,6 +128,11 @@ def _check_registered(
|
||||
raise KeyError(msg)
|
||||
|
||||
|
||||
def _sick_or(earned: int, terms: list[Term], day: date) -> int:
|
||||
"""A sick day's shutdown: 20:00 plus gaming pay, never below ``earned``."""
|
||||
return max(earned, sick_shutdown_from(sum(t.gaming_minutes for t in terms), day))
|
||||
|
||||
|
||||
def resolve(
|
||||
answers: Mapping[str, Answer],
|
||||
day: date | None = None,
|
||||
@ -187,8 +192,7 @@ def resolve(
|
||||
shutdown_ceiling_for(target),
|
||||
base.shutdown_minutes + sum(t.shutdown_minutes for t in terms),
|
||||
)
|
||||
paid = sum(t.gaming_minutes for t in terms)
|
||||
shutdown = max(earned, sick_shutdown_from(paid, target)) if sick else earned
|
||||
shutdown = _sick_or(earned, terms, target) if sick else earned
|
||||
return Resolution(
|
||||
day=target,
|
||||
base=base,
|
||||
|
||||
@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
||||
|
||||
[project]
|
||||
name = "earned-time"
|
||||
version = "0.13.0"
|
||||
version = "0.13.1"
|
||||
description = "Penalty-then-reward registry: what every gate app earns in gaming time and shutdown time"
|
||||
requires-python = ">=3.14"
|
||||
dependencies = []
|
||||
|
||||
Loading…
Reference in New Issue
Block a user