Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
0aab57c
add framework for UK national and GSP
peterdudfield Dec 2, 2025
ac833c2
add gsp locations route
peterdudfield Dec 2, 2025
f35f5b9
lint
peterdudfield Dec 2, 2025
7a60342
Merge branch 'main' into uk-national-and-gsp-framework
peterdudfield Dec 3, 2025
5128fd3
Merge branch 'main' into uk-national-and-gsp-locations
peterdudfield Dec 3, 2025
c382360
PR comments
peterdudfield Dec 4, 2025
caba26b
Update TODO elexon
peterdudfield Dec 4, 2025
8d09c92
remove legacy routes
peterdudfield Dec 4, 2025
d16be98
add start to getting national forecast
peterdudfield Dec 4, 2025
c18b8be
Merge commit 'b1c66bee95de4ee6e27f7a4aa27865bd039d5523' into uk-natio…
peterdudfield Dec 8, 2025
6203f51
Merge commit 'b1c66bee95de4ee6e27f7a4aa27865bd039d5523' into uk-natio…
peterdudfield Dec 8, 2025
3c7e911
rename + lint
peterdudfield Dec 8, 2025
459c24e
Merge branch 'uk-national-and-gsp-framework' into uk-national-and-gsp…
peterdudfield Dec 8, 2025
3110128
Merge branch 'uk-national-and-gsp-framework' into national/forecast
peterdudfield Dec 8, 2025
f01f99c
get working for model_name
peterdudfield Dec 8, 2025
618d0c7
Merge commit 'ba856c2ed063512c437dbc9cd10472bf3d1ec146' into national…
peterdudfield Dec 9, 2025
b9b3fb0
Merge branch 'main' into national/forecast
peterdudfield Dec 9, 2025
702b73b
Merge branch 'main' into uk-national-and-gsp-locations
peterdudfield Dec 9, 2025
e3e068f
lint
peterdudfield Dec 9, 2025
0996fbf
lint
peterdudfield Dec 9, 2025
7ac4a80
national/pvlive
peterdudfield Dec 9, 2025
b038e79
lint
peterdudfield Dec 9, 2025
cce60d6
Merge branch 'national/pvlive' into uk-national-and-gsp-locations
peterdudfield Dec 9, 2025
332f540
tidy up
peterdudfield Dec 9, 2025
2a8cb85
add options for get_window
peterdudfield Dec 12, 2025
74ee1d6
Merge branch 'start-end' into national/forecast
peterdudfield Dec 12, 2025
91445bf
add start and end datetime
peterdudfield Dec 12, 2025
539c4c8
add start and end filters
peterdudfield Dec 12, 2025
9297666
lint
peterdudfield Dec 12, 2025
0469b5b
Merge branch 'start-end' into national/pvlive
peterdudfield Dec 12, 2025
f520b2f
Merge branch 'national/forecast' into gsp-pvlive
peterdudfield Dec 12, 2025
eb0092d
Merge branch 'uk-national-and-gsp-locations' into gsp-pvlive
peterdudfield Dec 12, 2025
29cca1a
add gsp-pvlive
peterdudfield Dec 12, 2025
f41a541
add gsp forecast route
peterdudfield Dec 12, 2025
2d83a0a
add TODO routes in
peterdudfield Dec 12, 2025
841f534
fix national uuid
peterdudfield Dec 12, 2025
dda7402
lint
peterdudfield Dec 12, 2025
30ba6d5
add forecast/all and pvlive/all routes in
peterdudfield Dec 12, 2025
0a1c566
format forecast/all and pvlive/all routes
peterdudfield Dec 12, 2025
a39f69e
add get forecast_metadata
peterdudfield Dec 15, 2025
9e24e61
hid route
peterdudfield Dec 15, 2025
88dac77
add legacy database connectionfr for status
peterdudfield Dec 15, 2025
130607e
and ceil and floor for gsp all
peterdudfield Dec 15, 2025
0128148
add plevels
peterdudfield Dec 15, 2025
863858c
fix
peterdudfield Dec 15, 2025
925c1d3
tidy up warnings
peterdudfield Dec 15, 2025
25ffadd
Merge commit 'bd25c123223eb918f6201bc9b11ef170c2056e2c' into uk-national
peterdudfield Dec 17, 2025
5cb60ab
Merge branch 'main' into uk-national
peterdudfield Dec 19, 2025
b863e02
Merge branch 'main' into uk-national
braddf Dec 24, 2025
0f6b525
Merge commit 'ff1930f398a6b14d95dd70070166bfc80e175170' into uk-national
peterdudfield Jan 6, 2026
b187c17
Merge commit 'ba4e429824cd5daac5faec20066be68d40fa23bc' into uk-national
peterdudfield Jan 6, 2026
8db291c
limit end datetime on permissions
peterdudfield Jan 6, 2026
19ca23a
lint
peterdudfield Jan 6, 2026
b5a5b0b
Merge branch 'main' into uk-national
peterdudfield Jan 7, 2026
ac336a2
Merge commit 'd952b899c7d4c01cbefa6be20c5959587bb21373' into uk-national
peterdudfield Jan 7, 2026
f08e3dd
use dataplatform 0.18.0
peterdudfield Jan 7, 2026
fdecea6
use created_utc_limit
peterdudfield Jan 7, 2026
5722ffc
update model names from - to _
peterdudfield Jan 8, 2026
e143a3f
order by gsp_id
peterdudfield Jan 8, 2026
a176508
system/GB/gsp/
peterdudfield Jan 8, 2026
315ffc6
solar/GB/status no solar/GB/status/
peterdudfield Jan 8, 2026
a1ec834
remove empty forecasts in gsp/forecast/all
peterdudfield Jan 9, 2026
559f3fa
add cache
peterdudfield Jan 9, 2026
d196d19
change window to -2day, floored 2 6 hours
peterdudfield Jan 9, 2026
fc0d218
fix for forecast horizon
peterdudfield Jan 9, 2026
bca002c
move gsp names to upper
peterdudfield Jan 9, 2026
7e3dbba
forecast/all in mw
peterdudfield Jan 9, 2026
0c73ec5
add longer cache for forecast/all and pvlive/all
peterdudfield Jan 12, 2026
7cb1ece
remove old params in cache key builder
peterdudfield Jan 13, 2026
ac276fb
add logging to cache
peterdudfield Jan 13, 2026
481c727
Merge branch 'main' into uk-national
peterdudfield Jan 13, 2026
c1b6d90
small fixes
peterdudfield Jan 13, 2026
baeabb3
Merge commit 'ad46de99b2ad917d0ddb0488f5df3f33a7115d34' into uk-national
peterdudfield Jan 16, 2026
a89692c
copy over fixes
peterdudfield Jan 16, 2026
6234606
cover gsp_ids='non-int-string' case
peterdudfield Jan 16, 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
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ dependencies = [
"numpy >= 1.25.0",
"sentry-sdk >= 2.1.1",
"pyhocon>=0.3.61",
"sqlalchemy>=2.0.44",
"apitally[fastapi]>=0.22.3",
"auth0-fastapi-api>=1.0.0b5",
"fastapi-cache2[memcache]>=0.2.2",
]

[dependency-groups]
Expand All @@ -46,11 +48,13 @@ dev = [
"types-pytz>=2025.2.0.20251108",
"pandas-stubs>=2.3.2.250926",
"pytest-asyncio>=1.3.0",
"freezegun>=1.5.5",
]

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


[project.urls]
repository = "https://github.com/openclimatefix/quartz-api"

Expand Down
7 changes: 6 additions & 1 deletion src/quartz_api/cmd/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
from fastapi import FastAPI, status
from fastapi.middleware.cors import CORSMiddleware
from fastapi.openapi.utils import get_openapi
from fastapi_cache import FastAPICache
from fastapi_cache.backends.inmemory import InMemoryBackend
from grpclib.client import Channel
from pydantic import BaseModel
from pyhocon import ConfigFactory, ConfigTree
Expand All @@ -29,6 +31,7 @@
from ._logging import setup_json_logging

log = logging.getLogger(__name__)
# set hpack to warning log level
logging.getLogger("hpack").setLevel(logging.WARNING)

static_dir = pathlib.Path(__file__).parent.parent / "static"
Expand Down Expand Up @@ -67,7 +70,6 @@ def _custom_openapi(server: FastAPI) -> dict[str, Any]:

return openapi_schema


@asynccontextmanager
async def _lifespan(server: FastAPI, conf: ConfigTree) -> Generator[None]:
"""Configure FastAPI app instance with startup and shutdown events."""
Expand Down Expand Up @@ -120,6 +122,9 @@ def _create_server(conf: ConfigTree) -> FastAPI:
},
)

# set up cache
FastAPICache.init(InMemoryBackend(), expire=120, prefix="fastapi-cache")

# Add the default routes
server.mount("/static", StaticFiles(directory=static_dir.as_posix()), name="static")

Expand Down
Loading