Skip to content

feat(proto): Add p2,98,25,75; refactor tests - #181

Merged
devsjc merged 1 commit into
mainfrom
devsjc/more-plevels
Jul 7, 2026
Merged

feat(proto): Add p2,98,25,75; refactor tests#181
devsjc merged 1 commit into
mainfrom
devsjc/more-plevels

Conversation

@devsjc

@devsjc devsjc commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Adds 4 more p-levels to the predicted generation values table. These cost nothing storage-wise if they are unused. Also refactors the test suite a little bit.

Contribution Checklist

  • Have you followed the Open Climate Fix Contribution Guidelines?
  • Have you referenced the Issue this PR addresses, where applicable?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added a summary of the changes?
  • Have you written new tests for your changes, where applicable?
  • Have you successfully run make lint with your changes locally?
  • Have you successfully run make test with your changes locally?

Warning

PRs may be closed if all the above boxes are not checked.

@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown

Benchmark Results

Benchmark results
?   	github.com/openclimatefix/data-platform/cmd	[no test files]
?   	github.com/openclimatefix/data-platform/internal/gen/ocf/dp	[no test files]
?   	github.com/openclimatefix/data-platform/internal/interceptors	[no test files]
PASS
ok  	github.com/openclimatefix/data-platform/internal/server/dummy	0.005s
{"level":"debug","time":"2026-07-07T10:34:13Z","message":"Completed migrations"}
goos: linux
goarch: amd64
pkg: github.com/openclimatefix/data-platform/internal/server/postgres
cpu: AMD EPYC 9V74 80-Core Processor                
BenchmarkPostgresClient/small/GetForecastAsTimeseries-4         	      45	  25021931 ns/op
BenchmarkPostgresClient/small/GetForecastAtTimestamp-4          	     178	   6543182 ns/op
BenchmarkPostgresClient/small/GetObservationsAsTimeseries-4     	     966	   1159993 ns/op
BenchmarkPostgresClient/small/CreateForecast-4                  	     124	   9282810 ns/op
BenchmarkPostgresClient/small/StreamForecastData-4              	      20	  55648845 ns/op
PASS
ok  	github.com/openclimatefix/data-platform/internal/server/postgres	60.554s
?   	github.com/openclimatefix/data-platform/internal/server/postgres/gen	[no test files]
Benchmark vs base branch
goos: linux
goarch: amd64
pkg: github.com/openclimatefix/data-platform/internal/server/postgres
cpu: AMD EPYC 9V74 80-Core Processor                
                                                   │ bench-main.txt │    bench-devsjc-more-plevels.txt     │
                                                   │     sec/op     │    sec/op     vs base                │
PostgresClient/small/GetForecastAsTimeseries-4         22.11m ± ∞ ¹   25.02m ± ∞ ¹       ~ (p=1.000 n=1) ²
PostgresClient/small/GetForecastAtTimestamp-4          5.758m ± ∞ ¹   6.543m ± ∞ ¹       ~ (p=1.000 n=1) ²
PostgresClient/small/GetObservationsAsTimeseries-4     1.154m ± ∞ ¹   1.160m ± ∞ ¹       ~ (p=1.000 n=1) ²
PostgresClient/small/CreateForecast-4                  9.036m ± ∞ ¹   9.283m ± ∞ ¹       ~ (p=1.000 n=1) ²
PostgresClient/small/StreamForecastData-4              52.85m ± ∞ ¹   55.65m ± ∞ ¹       ~ (p=1.000 n=1) ²
geomean                                                9.316m         9.962m        +6.93%
¹ need >= 6 samples for confidence interval at level 0.95
² need >= 4 samples to detect a difference at alpha level 0.05

@devsjc devsjc linked an issue Jul 1, 2026 that may be closed by this pull request
3 tasks
Comment thread proto/ocf/dp/dp-data.messages.proto Outdated
Comment thread internal/server/postgres/sql/migrations/00010_7_plevels.sql
Comment thread internal/server/postgres/dataserverimpl.go
Adds four more p-levels to the data-platform. Also fixes a bug whereby
the created time was not getting propagated to the databse engine when
looking for recent forecasts.
@devsjc
devsjc force-pushed the devsjc/more-plevels branch from 1cfdbb3 to 811588a Compare July 7, 2026 10:31
@devsjc
devsjc merged commit 740f0ff into main Jul 7, 2026
4 checks passed
@devsjc
devsjc deleted the devsjc/more-plevels branch July 7, 2026 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cant update location if valid_from_utc not set

2 participants