Skip to content

feat(proto): Add CreateLocationEnergySource RPC - #193

Merged
devsjc merged 4 commits into
mainfrom
devsjc/create-location-source
Aug 20, 2026
Merged

feat(proto): Add CreateLocationEnergySource RPC#193
devsjc merged 4 commits into
mainfrom
devsjc/create-location-source

Conversation

@devsjc

@devsjc devsjc commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

This adds a new RPC, CreateLocationEnergySource. Currently, there is no
way to add a new energy source (e.g. Wind) to an existing location
(which is an energy source + geometry combination). This rectifies that
lack, and also modifies create location such that it prevents creating
an existing one.### 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.

devsjc added 2 commits August 20, 2026 11:13
This adds a new RPC, CreateLocationEnergySource. Currently, there is no
way to add a new energy source (e.g. Wind) to an existing location
(which is an energy source + geometry combination). This rectifies that
lack, and also modifies create location such that it prevents creating
an existing one.
@github-actions

github-actions Bot commented Aug 20, 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-08-20T10:43:25Z","message":"Completed migrations"}
goos: linux
goarch: amd64
pkg: github.com/openclimatefix/data-platform/internal/server/postgres
cpu: INTEL(R) XEON(R) PLATINUM 8573C
BenchmarkPostgresClient/small/GetForecastAsTimeseries-4         	     174	   6464702 ns/op
BenchmarkPostgresClient/small/GetForecastAtTimestamp-4          	     366	   3036271 ns/op
BenchmarkPostgresClient/small/GetObservationsAsTimeseries-4     	    1119	   1031265 ns/op
BenchmarkPostgresClient/small/CreateForecast-4                  	     422	   2678311 ns/op
BenchmarkPostgresClient/small/StreamForecastData-4              	      37	  31436424 ns/op
PASS
ok  	github.com/openclimatefix/data-platform/internal/server/postgres	46.099s
?   	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 7763 64-Core Processor                
                                                   │ bench-main.txt │
                                                   │     sec/op     │
PostgresClient/small/GetForecastAsTimeseries-4         8.146m ± ∞ ¹
PostgresClient/small/GetForecastAtTimestamp-4          3.556m ± ∞ ¹
PostgresClient/small/GetObservationsAsTimeseries-4     1.187m ± ∞ ¹
PostgresClient/small/CreateForecast-4                  3.192m ± ∞ ¹
PostgresClient/small/StreamForecastData-4              42.37m ± ∞ ¹
geomean                                                5.414m
¹ need >= 6 samples for confidence interval at level 0.95

cpu: INTEL(R) XEON(R) PLATINUM 8573C
                                                   │ bench-devsjc-create-location-source.txt │
                                                   │                 sec/op                  │
PostgresClient/small/GetForecastAsTimeseries-4                                  6.465m ± ∞ ¹
PostgresClient/small/GetForecastAtTimestamp-4                                   3.036m ± ∞ ¹
PostgresClient/small/GetObservationsAsTimeseries-4                              1.031m ± ∞ ¹
PostgresClient/small/CreateForecast-4                                           2.678m ± ∞ ¹
PostgresClient/small/StreamForecastData-4                                       31.44m ± ∞ ¹
geomean                                                                         4.429m
¹ need >= 6 samples for confidence interval at level 0.95

@devsjc
devsjc merged commit 6b75718 into main Aug 20, 2026
4 checks passed
@devsjc
devsjc deleted the devsjc/create-location-source branch August 20, 2026 11:15
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.

1 participant