Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
129 commits
Select commit Hold shift + click to select a range
887bc4d
feat[router]: add first pass routes for unified v1
braddf Feb 13, 2026
45fb2d7
chore[router]: fix import order
braddf Feb 13, 2026
112bb52
feat[router]: add generation sources & enum for docs
braddf Feb 13, 2026
12cfc30
feat[auth]: auto-authorise Swagger UI
braddf Mar 14, 2026
cd3b547
feat[v1]: add filter params; refactor typings
braddf Mar 14, 2026
37a9321
fix[v1]: add model version filter
braddf Mar 15, 2026
60e7bf0
chore[deps]: bump dp-sdk to v0.25.0
braddf Apr 20, 2026
2f1e3ee
feat[v1]: add timeseries matrix endpoints with pre-warmed cache
braddf Apr 20, 2026
edaac64
test[v1]: add unit tests for v1 router
braddf Apr 20, 2026
b9f69b7
test[v1]: add missing coverage for national snapshot, region filters,…
braddf Apr 20, 2026
96bf380
test[v1]: add window sub-query tests and fix code quality
braddf Apr 20, 2026
ac6910f
refactor[v1]: use _to_uuid() consistently throughout router
braddf Apr 20, 2026
994c229
perf[v1]: parallelize timeseries cache reads with asyncio.gather
braddf Apr 20, 2026
b5c28b9
refactor[v1]: standardize generation endpoint params to start_utc/end…
braddf Apr 20, 2026
989b8bb
refactor[v1]: document cache warm throttle; add strict= to zip calls
braddf Apr 20, 2026
dd0812a
refactor[v1]: rename routes to country-first /{country}/{source}/…
braddf Apr 20, 2026
82ec952
refactor[v1]: rename forecast/last_updated to forecast/last-updated (…
braddf Apr 20, 2026
0fdaa3e
feat[v1]: add 'national' slug alias for per-region endpoints
braddf Apr 20, 2026
bb138d2
feat[v1]: mount v1 as independent FastAPI sub-app at /v1
braddf Apr 21, 2026
767fe2d
feat[v1]: add CountryCode enum to country path param
braddf Apr 21, 2026
166e7af
feat[v1]: add NL forecast models, generation source, and nation name …
braddf Apr 21, 2026
e24836b
feat[v1]: enrich /countries response and add forecast model dropdown
braddf Apr 21, 2026
5ff9f55
feat[v1]: add solar/wind enum and solar default example to source pat…
braddf Apr 21, 2026
91b3640
feat[v1]: validate model param against region type on forecast routes
braddf Apr 21, 2026
d225d40
fix: surface exception tracebacks in JSON logs; guard empty forecaste…
braddf Apr 21, 2026
f48c155
feat[v1]: centralise forecaster labels map; fix GB model names to mat…
braddf Apr 23, 2026
2c5fdab
fix: type annotation and file formatting
braddf Apr 23, 2026
f6cc253
fix: amend country to use region_id for consistency
braddf Apr 23, 2026
6bb48ec
feat[v1]: add default_model to RegionTypeConfig; apply in forecast ha…
braddf Apr 23, 2026
e021cdf
refactor[v1]: split monolithic router into focused modules
braddf Apr 23, 2026
ba1e92d
feat: replace Swagger UI with Scalar across v1 and root app
braddf Apr 23, 2026
024a3cc
fix: restore Swagger UI on root app; Scalar only on /v1/docs
braddf Apr 23, 2026
9217c84
fix: embed client_id and audience in OAuth2 authorizationUrl for Scal…
braddf Apr 23, 2026
f0c84e7
fix: add x-scalar-client-id to OAuth2 security scheme for Scalar auto…
braddf Apr 23, 2026
ce600d2
fix: use x-scalar-secret-client-id on flow to auto-fill client ID in …
braddf Apr 23, 2026
e74b4c2
refactor[v1]: rename /timeseries routes to /period with 'Get Forecast…
braddf Apr 28, 2026
686072f
refactor[v1]: rename types
braddf Apr 28, 2026
b54532c
fix[validation]: add checks for len(regions)
braddf Apr 28, 2026
ee3cc78
fix[dp]: reformat client.py to ruff style; remove debug logging; make…
braddf Apr 29, 2026
076cb3a
feat[v1]: add ValidRegionType enum (all-countries) and _check_region_…
braddf Apr 29, 2026
13bb265
refactor[v1]: apply ValidRegionType and _check_region_type across rou…
braddf Apr 29, 2026
9fe9be6
test: expand v1 router test suite from 32 to 71 tests
braddf Apr 30, 2026
11b341d
refactor: rename Capability routes to Discovery
braddf Apr 30, 2026
435d6f1
chore[routes]: update route names
braddf Apr 30, 2026
4239afc
refactor: move Regions routes under Discovery tag in API docs
braddf May 5, 2026
9f824bf
feat: tighten default time windows for per-region forecast and genera…
braddf May 5, 2026
dec9ea0
feat: rename NL region type netbeheerder → provinces
braddf May 5, 2026
1cdc01a
feat: add centroid field to CountryDetail and RegionSummary responses
braddf May 5, 2026
ebd2d9e
feat: add ?name= substring search to GET /regions
braddf May 5, 2026
68baee3
feat: expose default_model on region-types response and clarify model…
braddf May 5, 2026
d50fed8
feat: enforce 1-year rolling window limit on per-region forecast and …
braddf May 5, 2026
5c37517
feat: allowlist metadata fields per region type in CountryConfig
braddf May 5, 2026
bb9159b
feat: enforce per-country auth scopes on v1 data routes
braddf May 6, 2026
70f4649
feat: add slug/api_name to ForecastModel for user-facing name aliasing
braddf May 6, 2026
f893792
fix: remove lat/lng from CountryDetail, round centroid coords to 3dp
braddf May 6, 2026
ad7ee15
fix: use read:gb permission for GB country (read:uk-intraday stays)
braddf May 6, 2026
10ed002
chore[v1]: remove DNO forecast models
braddf May 6, 2026
2e80067
refactor: expand intraday models to explicit entries with pvnet_intra…
braddf May 6, 2026
fedaf67
fix: remove redundant lat/lng from RegionSummary/RegionDetail (centro…
braddf May 6, 2026
49214b5
feat: add blend/blend_adjust to NL models, set blend_adjust as default
braddf May 6, 2026
4c01788
chore: add "Trend" to adjusted labels
braddf May 6, 2026
d12bf40
chore: update config metadata fields
braddf May 6, 2026
bd0a58f
feat: support region name lookup in all region_id path params
braddf May 6, 2026
81ecfa5
fix: use authdata={} for region list in period endpoints
braddf May 6, 2026
6126767
chore: update nl_blend name; rm unneeded models
braddf May 6, 2026
e56e465
fix: correct LocationType.DNO enum name after rebase (LOCATION_TYPE_DNO)
braddf May 6, 2026
b5edb71
lint: ruff fixes
braddf May 6, 2026
276cd5b
docs: add reviewer comments to novel v1 patterns
braddf May 6, 2026
d36b0dd
chore: restore v0 swagger docs auth
braddf May 11, 2026
9219b94
fix: rm unneeded DP fallback
braddf May 11, 2026
d7b1f9b
fix(v1/cache): always write forecast _meta key after warm
braddf May 11, 2026
8ae9e8d
fix(backends/dp): fix Timestamp sort and indentation rebase artifacts
braddf May 11, 2026
712edb0
chore(backends): remove grpclib and grpc-requests remnants from PR #2…
braddf May 11, 2026
149c15e
feat(api): add GZipMiddleware for browser clients
braddf May 11, 2026
141b5bd
feat(v1): columnar matrix response shape for timeseries endpoints
braddf May 11, 2026
8c4a11b
refactor(v1): bake source→EnergyType coercion into ValidSource type
braddf May 11, 2026
e42724d
fix(v1/cache): replace leftover source var with energy_type.name.lowe…
braddf May 11, 2026
2926622
refactor: bake country lookup and window validation into Annotated types
braddf May 11, 2026
0cc3845
fix: force ValidSource OpenAPI schema to string enum values
braddf May 11, 2026
b940045
docs: add parameter docstrings to all v1 route handlers
braddf May 11, 2026
8ef5791
fix: amend default NL models
braddf May 12, 2026
2ebc9ea
fix: update NL default model assertion to nl_blend_adjust
braddf May 12, 2026
c8fd146
chore: remove wind from v1 API surface — solar only for now
braddf May 12, 2026
5fde05d
fix: add OptionalValidRegionType so /regions region_type shows enum d…
braddf May 12, 2026
30f46fc
chore: remove wind from legacy regions service
braddf May 12, 2026
23e558c
lint: ruff line-length formatting in legacy regions service
braddf May 12, 2026
b96f471
chore: rename NL provinces to province
braddf May 12, 2026
7cb0ce7
fix(tests): update intraday default model assertion for GSP (no adjus…
braddf May 12, 2026
8645e70
chore: remove DNO region type from GB config (no DP geometries yet)
braddf May 12, 2026
f383d21
fix: use user-facing API slugs throughout v1 model name responses
braddf May 12, 2026
feb9874
chore: expose nl_blend/nl_blend_adjust as blend/blend_adjust slugs fo…
braddf May 12, 2026
6aa1b34
chore: expose ned_nl_national as ned_nl slug
braddf May 12, 2026
a705870
chore: map DP nation names to user-facing display names (uk->GB, nl_n…
braddf May 12, 2026
a68ac28
fix lint and tests on v1/mvp (#308)
peterdudfield May 12, 2026
494e882
Merge remote-tracking branch 'origin/v1/mvp' into v1/mvp
braddf May 12, 2026
038e867
refactor: standardise time param/field names to _utc suffix
braddf May 12, 2026
5410a83
feat: include region_id and region_name on all forecast/generation re…
braddf May 12, 2026
578aa86
lint: fix E501/COM812 in cache.py _internal_to_api_name call
braddf May 12, 2026
dd6c89c
feat: add region_names filter to period routes; use DP native name se…
braddf May 12, 2026
566559c
refactor: rename region_id path param to region across v1 per-region …
braddf May 12, 2026
76d3676
docs: add default model comment for /period
braddf May 12, 2026
6e9fce9
docs: add NED comment to generation
braddf May 12, 2026
a71ec18
chore: remove NED NL forecast model
braddf May 12, 2026
92f14e4
feat: very quick styling & btn colors
braddf May 13, 2026
d3657c2
chore: ruff organise imports
braddf May 13, 2026
d9480ad
Merge branch 'main' into v1/mvp
braddf May 13, 2026
4b6e6d3
chore: ruff fixes
braddf May 13, 2026
89835da
chore: ruff fixes
braddf May 13, 2026
e62bd0f
docs: remove dno from v1 route docstring examples
braddf May 13, 2026
4474271
feat: generation snapshot defaults to most recent available timestamp
braddf May 13, 2026
7aeef2d
fix: remove remaining DP authdata
braddf May 13, 2026
6962c5b
feat: add location_name_map to RegionTypeConfig; map NL province disp…
braddf May 13, 2026
b2a7467
feat: remove UUIDs from v1 API responses; region names are sole ident…
braddf May 13, 2026
d306ad4
fix: name look-/line-ups for regions
braddf May 13, 2026
f076b13
docs: update nation names & region name comment
braddf May 13, 2026
b7ae943
chore: update available GB models
braddf May 13, 2026
97144c1
refactor: unify intraday_models as ForecastModel tuples; add FM model…
braddf May 13, 2026
b5c6b0f
fix: correct GSP forecast_models; add invariant assertion for intrada…
braddf May 13, 2026
f55bcbd
refactor: inline model labels into FM class; remove FORECASTER_LABELS…
braddf May 13, 2026
fbef554
chore: ruff fix
braddf May 13, 2026
ef59bf4
docs: move param descriptions to annotations, strip redundant docstri…
braddf May 13, 2026
a986092
feat: add 1-min default caching to per-region and discovery routes
braddf May 14, 2026
f40f05c
fix: give v1 its own key_builder using access-tier partitioning
braddf May 14, 2026
1f569d1
fix: lint and US spelling (reluctantly)
braddf May 14, 2026
bfa70bc
fix: lint again
braddf May 14, 2026
0c64662
fix: add response_model to all cached v1 routes to restore Scalar schema
braddf May 14, 2026
2bb425d
fix: validate region path param min length 2 to prevent DP 500s
braddf May 14, 2026
8f64f8c
fix: validate region_type and observer before 503 on period endpoints
braddf May 14, 2026
04188c5
fix: exclude national from period endpoint region_type enum and error…
braddf May 14, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ authors = [
classifiers = ["Programming Language :: Python :: 3"]
dependencies = [
"cryptography >= 41.0.0",
"dp-sdk >= 0.25.0,<1.0.0",
"dp-sdk >= 0.29.0,<1.0.0",
"fastapi>=0.105.0",
"pvsite-datamodel == 1.2.3",
"pyjwt >= 2.8.0",
Expand All @@ -34,9 +34,10 @@ dependencies = [
"auth0-fastapi-api>=1.0.0b5",
"fastapi-cache2[memcache]>=0.2.2",
"slowapi>=0.1.9",
"grpc-requests>=0.1.21",
"gunicorn>=25.3.0",
"jinja2>=3.1.6",
"scalar-fastapi>=1.8.2",
"protobuf>=7.34.1",
]

[dependency-groups]
Expand All @@ -61,7 +62,7 @@ dev = [
]

[tool.uv.sources]
dp-sdk = { url = "https://github.com/openclimatefix/data-platform/releases/download/v0.25.0/dp_sdk-0.25.0-py3-none-any.whl" }
dp-sdk = { url = "https://github.com/openclimatefix/data-platform/releases/download/v0.29.0/dp_sdk-0.29.0-py3-none-any.whl" }

[project.urls]
repository = "https://github.com/openclimatefix/quartz-api"
Expand Down
4 changes: 3 additions & 1 deletion src/quartz_api/cmd/_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,13 @@ def format(self, record: LogRecord) -> str:
"pid": record.process,
}

# Add custom extra attributes if they exist
for extra_attr in ["trace_id", "process_time", "client_ip", "user_id", "request_url"]:
if hasattr(record, extra_attr):
base[extra_attr] = getattr(record, extra_attr)

if record.exc_info:
base["exc"] = self.formatException(record.exc_info)

return json.dumps(base, ensure_ascii=False)


Expand Down
Loading
Loading