From a1b6e9fc5d1c8615a16e5ffb11caac7ef19765f5 Mon Sep 17 00:00:00 2001 From: stuppie Date: Mon, 24 Aug 2026 16:45:26 -0600 Subject: add TaskCalculationType 'starts' --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pyproject.toml') diff --git a/pyproject.toml b/pyproject.toml index 183e271..0fe8772 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "generalresearch" -version = "3.4.0" +version = "3.4.1" description = "Python Utilities for General Research" readme = "README.md" requires-python = ">=3.8" -- cgit v1.2.3 From f2a6426642cc07991bb10fb3b09a2d1ee2dc8f8d Mon Sep 17 00:00:00 2001 From: stuppie Date: Thu, 27 Aug 2026 10:55:09 -0600 Subject: bump --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pyproject.toml') diff --git a/pyproject.toml b/pyproject.toml index 0fe8772..fd55201 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,10 +4,10 @@ build-backend = "setuptools.build_meta" [project] name = "generalresearch" -version = "3.4.1" +version = "3.4.2" description = "Python Utilities for General Research" readme = "README.md" -requires-python = ">=3.8" +requires-python = ">=3.10" dependencies = [ "fastapi", "Faker", -- cgit v1.2.3 From c5aa734cad3d4a8a1f01d113fff05198218e7879 Mon Sep 17 00:00:00 2001 From: stuppie Date: Thu, 27 Aug 2026 17:46:17 -0600 Subject: Leaderboard id & name optional; set by validators --- generalresearch/models/thl/leaderboard.py | 17 +++++++++++------ pyproject.toml | 2 +- 2 files changed, 12 insertions(+), 7 deletions(-) (limited to 'pyproject.toml') diff --git a/generalresearch/models/thl/leaderboard.py b/generalresearch/models/thl/leaderboard.py index 399a906..bc55034 100644 --- a/generalresearch/models/thl/leaderboard.py +++ b/generalresearch/models/thl/leaderboard.py @@ -6,6 +6,7 @@ from datetime import datetime, timedelta, timezone from enum import Enum from typing import Literal from uuid import UUID, uuid3 +from zoneinfo import ZoneInfo import pandas as pd from pydantic import ( @@ -17,7 +18,6 @@ from pydantic import ( field_validator, model_validator, ) -from zoneinfo import ZoneInfo from generalresearch.models.custom_types import AwareDatetimeISO, UUIDStr from generalresearch.models.legacy.api_status import StatusResponse @@ -78,14 +78,19 @@ class Leaderboard(BaseModel): weekly, and monthly leaderboard. """ - id: UUIDStr = Field( + # Note: id and name get auto-generated by the model_validators, but the fields need + # to be optional with a default or the model can't be inited. + # todo: these should really be computed_fields instead + id: UUIDStr | None = Field( description="Unique ID for this leaderboard", examples=["845b0074ad533df580ebb9c80cc3bce1"], + default=None, ) - name: str = Field( + name: str | None = Field( description="Descriptive name for the leaderboard based on the board_code", examples=["Number of Completes"], + default=None, ) board_code: LeaderboardCode = Field( @@ -266,9 +271,9 @@ class Leaderboard(BaseModel): .to_pydatetime() .replace(tzinfo=self.timezone) ) - assert ( - period_start_local == self.period_start_local - ), f"invalid period_start_local {self.period_start_local}. The period starts at {period_start_local}" + assert period_start_local == self.period_start_local, ( + f"invalid period_start_local {self.period_start_local}. The period starts at {period_start_local}" + ) if self.period_end_local is not None: assert self.period_end_local == period_end_local, "invalid period" else: diff --git a/pyproject.toml b/pyproject.toml index fd55201..2d1d246 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "generalresearch" -version = "3.4.2" +version = "3.4.3" description = "Python Utilities for General Research" readme = "README.md" requires-python = ">=3.10" -- cgit v1.2.3 From ec850b9ddd5cf520646f0f8c4a5f0a996b78ac94 Mon Sep 17 00:00:00 2001 From: stuppie Date: Fri, 28 Aug 2026 10:56:58 -0600 Subject: fix broken ruff imports. fastapi isnt a dependency --- generalresearch/models/thl/survey/penalty.py | 5 ++--- pyproject.toml | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'pyproject.toml') diff --git a/generalresearch/models/thl/survey/penalty.py b/generalresearch/models/thl/survey/penalty.py index e9515d4..0f544b8 100644 --- a/generalresearch/models/thl/survey/penalty.py +++ b/generalresearch/models/thl/survey/penalty.py @@ -2,10 +2,9 @@ from __future__ import annotations import abc from datetime import datetime, timezone -from typing import Literal +from typing import Annotated, Literal from pydantic import BaseModel, ConfigDict, Field, TypeAdapter -from typing_extensions import Annotated from generalresearch.models import Source from generalresearch.models.custom_types import ( @@ -59,7 +58,7 @@ class TeamSurveyPenalty(SurveyPenalty): Penalty = Annotated[ - Union[BPSurveyPenalty, TeamSurveyPenalty], + BPSurveyPenalty | TeamSurveyPenalty, Field(discriminator="kind"), ] PenaltyListAdapter = TypeAdapter(list[Penalty]) diff --git a/pyproject.toml b/pyproject.toml index 2d1d246..e855d16 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,12 +4,12 @@ build-backend = "setuptools.build_meta" [project] name = "generalresearch" -version = "3.4.3" +version = "3.4.4" description = "Python Utilities for General Research" readme = "README.md" requires-python = ">=3.10" dependencies = [ - "fastapi", +# "fastapi", "Faker", "PyMySQL", "psycopg", -- cgit v1.2.3 From f6ee73468e27cfddd34b24f00ffd712bccd03347 Mon Sep 17 00:00:00 2001 From: stuppie Date: Mon, 31 Aug 2026 12:08:30 -0600 Subject: bump --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pyproject.toml') diff --git a/pyproject.toml b/pyproject.toml index e855d16..0cc4227 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "generalresearch" -version = "3.4.4" +version = "3.4.5" description = "Python Utilities for General Research" readme = "README.md" requires-python = ">=3.10" -- cgit v1.2.3