Skip to content

Commit 13e252d

Browse files
authored
Merge pull request #614 from electricitymaps/robin/update-forecast-documentation
Make documentation for forecasts signal agnostic
2 parents a9412ac + 69254e0 commit 13e252d

File tree

5 files changed

+40
-41
lines changed

5 files changed

+40
-41
lines changed

casdk-docs/docs/tutorial-basics/carbon-aware-webapi.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Carbon Aware WebApi
22

3-
The Carbon Aware SDK provides an API to get the marginal carbon intensity for a
3+
The Carbon Aware SDK provides an API to get the carbon intensity for a
44
given location and time period. The values reported in the Green Software
5-
Foundation's specification for marginal carbon intensity (Grams per Kilowatt
5+
Foundation's specification for carbon intensity (Grams per Kilowatt
66
Hour).
77

88
**_Highly Recommended_** - This user interface is best for when you can change
@@ -131,11 +131,11 @@ This endpoint fetches only the most recently generated forecast for all provided
131131
locations. It uses the "dataStartAt" and "dataEndAt" parameters to scope the
132132
forecasted data points (if available for those times). If no start or end time
133133
boundaries are provided, the entire forecast dataset is used. The scoped data
134-
points are used to calculate average marginal carbon intensities of the
135-
specified "windowSize" and the optimal marginal carbon intensity window is
134+
points are used to calculate average carbon intensities of the
135+
specified "windowSize" and the optimal carbon intensity window is
136136
identified.
137137

138-
The forecast data represents what the data source predicts future marginal
138+
The forecast data represents what the data source predicts future
139139
carbon intesity values to be, not actual measured emissions data (as future
140140
values cannot be known).
141141

@@ -154,7 +154,7 @@ Parameters:
154154
current forecast data points after this time. Must be within the forecast
155155
data point timestamps. Defaults to the latest time in the forecast data. If
156156
neither `dataStartAt` nor `dataEndAt` are provided, all forecasted data
157-
points are used in calculating the optimal marginal carbon intensity window.
157+
points are used in calculating the optimal carbon intensity window.
158158
4. `windowSize`: The estimated duration (in minutes) of the workload. Defaults
159159
to the duration of a single forecast data point.
160160

@@ -163,7 +163,7 @@ https://<server_name>/emissions/forecasts/current?location=northeurope&dataStart
163163
```
164164

165165
The response is an array of forecasts (one per requested location) with their
166-
optimal marginal carbon intensity windows.
166+
optimal carbon intensity windows.
167167

168168
```json
169169
[
@@ -202,7 +202,7 @@ optimal marginal carbon intensity windows.
202202
### POST emissions/forecasts/batch
203203

204204
This endpoint takes a batch of requests for historical forecast data, fetches
205-
them, and calculates the optimal marginal carbon intensity windows for each
205+
them, and calculates the optimal carbon intensity windows for each
206206
using the same parameters available to the '/emissions/forecasts/current'
207207
endpoint.
208208

@@ -227,7 +227,7 @@ Parameters:
227227
to the duration of a single forecast data point
228228

229229
If neither `dataStartAt` nor `dataEndAt` are provided, all forecasted data
230-
points are used in calculating the optimal marginal carbon intensity window.
230+
points are used in calculating the optimal carbon intensity window.
231231

232232
```json
233233
[
@@ -249,7 +249,7 @@ points are used in calculating the optimal marginal carbon intensity window.
249249
```
250250

251251
The response is an array of forecasts (one per requested location) with their
252-
optimal marginal carbon intensity windows.
252+
optimal carbon intensity windows.
253253

254254
```json
255255
[
@@ -310,7 +310,7 @@ https://<server_name>/emissions/average-carbon-intensity?location=eastus&startTi
310310
```
311311

312312
The response is a single object that contains the information about the request
313-
and the average marginal carbon intensity
313+
and the average carbon intensity
314314

315315
```json
316316
{
@@ -330,7 +330,7 @@ location and time period.
330330
This endpoint only supports batching across a single location with different
331331
time boundaries. If multiple locations are provided, an error is returned. For
332332
each item in the request array, the application returns a corresponding object
333-
containing the location, time boundaries, and average marginal carbon intensity.
333+
containing the location, time boundaries, and average carbon intensity.
334334

335335
Parameters:
336336

@@ -364,7 +364,7 @@ Parameters:
364364
```
365365

366366
The response is an array of CarbonIntensityDTO objects which each have a
367-
location, start time, end time, and the average marginal carbon intensity over
367+
location, start time, end time, and the average carbon intensity over
368368
that time period.
369369

370370
```json

casdk-docs/docs/tutorial-extras/carbon-aware-library.md

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Carbon Aware Library
22

3-
The Carbon Aware SDK provides a C\# Client Library to get the marginal carbon
3+
The Carbon Aware SDK provides a C\# Client Library to get the carbon
44
intensity for a given location and time period. The values reported in the Green
5-
Software Foundation's specification for marginal carbon intensity (Grams per
5+
Software Foundation's specification for carbon intensity (Grams per
66
Kilowatt Hour).
77

88
**_Recommended_** - This user interface is best for when you need a consumable
@@ -247,8 +247,7 @@ var data = await this._emissionsHandler.GetAverageCarbonIntensityAsync(
247247
);
248248
```
249249

250-
The response is a single double value representing the calculated average
251-
marginal carbon intensity g/kWh.
250+
The response is a single double value representing the calculated average carbon intensity g/kWh.
252251

253252
```csharp
254253
345.434
@@ -269,11 +268,11 @@ This function fetches only the most recently generated forecast for all provided
269268
locations. It uses the "dataStartAt" and "dataEndAt" parameters to scope the
270269
forecasted data points (if available for those times). If no start or end time
271270
boundaries are provided, the entire forecast dataset is used. The scoped data
272-
points are used to calculate average marginal carbon intensities of the
273-
specified "windowSize" and the optimal marginal carbon intensity window is
271+
points are used to calculate average carbon intensities of the
272+
specified "windowSize" and the optimal carbon intensity window is
274273
identified.
275274

276-
The forecast data represents what the data source predicts future marginal
275+
The forecast data represents what the data source predicts future
277276
carbon intensity values to be, not actual measured emissions data (as future
278277
values cannot be known).
279278

@@ -292,7 +291,7 @@ Parameters:
292291
current forecast data points after this time. Must be within the forecast
293292
data point timestamps. Defaults to the latest time in the forecast data. If
294293
neither `dataStartAt` nor `dataEndAt` are provided, all forecasted data
295-
points are used in calculating the optimal marginal carbon intensity window.
294+
points are used in calculating the optimal carbon intensity window.
296295
4. `windowSize`: The estimated duration (in minutes) of the workload. Defaults
297296
to the duration of a single forecast data point.
298297

@@ -306,7 +305,7 @@ var data = await this._forecastHandler.GetCurrentForecastAsync(
306305
```
307306

308307
The response is an array of `EmissionsForecast` objects (one per requested
309-
location) with their optimal marginal carbon intensity windows.
308+
location) with their optimal carbon intensity windows.
310309

311310
```csharp
312311
[
@@ -347,7 +346,7 @@ location) with their optimal marginal carbon intensity windows.
347346
### GetForecastByDateAsync
348347

349348
This function takes a requests for historical forecast data, fetches it, and
350-
calculates the optimal marginal carbon intensity window. This endpoint is useful
349+
calculates the optimal carbon intensity window. This endpoint is useful
351350
for back-testing what one might have done in the past, if they had access to the
352351
current forecast at the time.
353352

@@ -367,7 +366,7 @@ Parameters:
367366
to the duration of a single forecast data point
368367

369368
If neither `dataStartAt` nor `dataEndAt` are provided, all forecasted data
370-
points are used in calculating the optimal marginal carbon intensity window.
369+
points are used in calculating the optimal carbon intensity window.
371370

372371
```csharp
373372
var data = await this._forecastHandler.GetForecastByDateAsync(
@@ -379,7 +378,7 @@ var data = await this._forecastHandler.GetForecastByDateAsync(
379378
);
380379
```
381380

382-
The response is an `EmissionsForecast` object with the optimal marginal carbon
381+
The response is an `EmissionsForecast` object with the optimal carbon
383382
intensity window.
384383

385384
```csharp

src/CarbonAware.WebApi/src/Controllers/CarbonAwareController.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -88,21 +88,21 @@ public async Task<IActionResult> GetEmissionsDataForLocationByTime(
8888
}
8989

9090
/// <summary>
91-
/// Retrieves the most recent forecasted data and calculates the optimal marginal carbon intensity window.
91+
/// Retrieves the most recent forecasted data and calculates the optimal carbon intensity window.
9292
/// </summary>
9393
/// <param name="parameters">The request object <see cref="EmissionsForecastCurrentParametersDTO"/></param>
9494
/// <remarks>
9595
/// This endpoint fetches only the most recently generated forecast for all provided locations. It uses the "dataStartAt" and
9696
/// "dataEndAt" parameters to scope the forecasted data points (if available for those times). If no start or end time
97-
/// boundaries are provided, the entire forecast dataset is used. The scoped data points are used to calculate average marginal
98-
/// carbon intensities of the specified "windowSize" and the optimal marginal carbon intensity window is identified.
97+
/// boundaries are provided, the entire forecast dataset is used. The scoped data points are used to calculate average
98+
/// carbon intensities of the specified "windowSize" and the optimal carbon intensity window is identified.
9999
///
100-
/// The forecast data represents what the data source predicts future marginal carbon intensity values to be,
100+
/// The forecast data represents what the data source predicts future carbon intensity values to be,
101101
/// not actual measured emissions data (as future values cannot be known).
102102
///
103103
/// This endpoint is useful for determining if there is a more carbon-optimal time to use electricity predicted in the future.
104104
/// </remarks>
105-
/// <returns>An array of forecasts (one per requested location) with their optimal marginal carbon intensity windows.</returns>
105+
/// <returns>An array of forecasts (one per requested location) with their optimal carbon intensity windows.</returns>
106106
/// <response code="200">Returns the requested forecast objects</response>
107107
/// <response code="400">Returned if any of the input parameters are invalid</response>
108108
/// <response code="500">Internal server error</response>
@@ -126,14 +126,14 @@ public async Task<IActionResult> GetCurrentForecastData([FromQuery] EmissionsFor
126126
/// </summary>
127127
/// <remarks>
128128
/// This endpoint takes a batch of requests for historical forecast data, fetches them, and calculates the optimal
129-
/// marginal carbon intensity windows for each using the same parameters available to the '/emissions/forecasts/current'
129+
/// carbon intensity windows for each using the same parameters available to the '/emissions/forecasts/current'
130130
/// endpoint.
131131
///
132132
/// This endpoint is useful for back-testing what one might have done in the past, if they had access to the
133133
/// current forecast at the time.
134134
/// </remarks>
135135
/// <param name="requestedForecasts"> Array of requested forecasts.</param>
136-
/// <returns>An array of forecasts with their optimal marginal carbon intensity window.</returns>
136+
/// <returns>An array of forecasts with their optimal carbon intensity window.</returns>
137137
/// <response code="200">Returns the requested forecast objects</response>
138138
/// <response code="400">Returned if any of the input parameters are invalid</response>
139139
/// <response code="500">Internal server error</response>
@@ -169,7 +169,7 @@ public async Task<IActionResult> BatchForecastDataAsync([FromBody] IEnumerable<E
169169
/// </remarks>
170170
/// <param name="parameters">The request object <see cref="CarbonIntensityParametersDTO"/></param>
171171
/// <returns>A single object that contains the location, time boundaries and average carbon intensity value.</returns>
172-
/// <response code="200">Returns a single object that contains the information about the request and the average marginal carbon intensity</response>
172+
/// <response code="200">Returns a single object that contains the information about the request and the average carbon intensity</response>
173173
/// <response code="400">Returned if any of the requested items are invalid</response>
174174
/// <response code="500">Internal server error</response>
175175
[Produces("application/json", "application/json; charset=utf-8")]
@@ -202,11 +202,11 @@ public async Task<IActionResult> GetAverageCarbonIntensity([FromQuery] CarbonInt
202202
/// </summary>
203203
/// <remarks>
204204
/// The application only supports batching across a single location with different time boundaries. If multiple locations are provided, an error is returned.
205-
/// For each item in the request array, the application returns a corresponding object containing the location, time boundaries, and average marginal carbon intensity.
205+
/// For each item in the request array, the application returns a corresponding object containing the location, time boundaries, and average carbon intensity.
206206
/// </remarks>
207-
/// <param name="requestedCarbonIntensities"> Array of inputs where each contains a "location", "startDate", and "endDate" for which to calculate average marginal carbon intensity. </param>
208-
/// <returns>An array of CarbonIntensityDTO objects which each have a location, start time, end time, and the average marginal carbon intensity over that time period.</returns>
209-
/// <response code="200">Returns an array of objects where each contains location, time boundaries and the corresponding average marginal carbon intensity</response>
207+
/// <param name="requestedCarbonIntensities"> Array of inputs where each contains a "location", "startDate", and "endDate" for which to calculate average carbon intensity. </param>
208+
/// <returns>An array of CarbonIntensityDTO objects which each have a location, start time, end time, and the average carbon intensity over that time period.</returns>
209+
/// <response code="200">Returns an array of objects where each contains location, time boundaries and the corresponding average carbon intensity</response>
210210
/// <response code="400">Returned if any of the requested items are invalid</response>
211211
/// <response code="500">Internal server error</response>
212212
[Produces("application/json", "application/json; charset=utf-8")]

src/CarbonAware.WebApi/src/Models/CarbonIntensityDTO.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public record CarbonIntensityDTO
2222
[JsonPropertyName("endTime")]
2323
public DateTimeOffset? EndTime { get => _endTime; set => _endTime = value?.ToUniversalTime(); }
2424

25-
/// <summary>Value of the marginal carbon intensity in grams per kilowatt-hour.</summary>
25+
/// <summary>Value of the carbon intensity in grams per kilowatt-hour.</summary>
2626
/// <example>345.434</example>
2727
[JsonPropertyName("carbonIntensity")]
2828
public double CarbonIntensity { get; set; }

src/GSF.CarbonAware/src/Handlers/IForecastHandler.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ namespace GSF.CarbonAware.Handlers;
55
public interface IForecastHandler
66
{
77
/// <summary>
8-
/// Retrieves the most recent forecasted data and calculates the optimal marginal carbon intensity window.
8+
/// Retrieves the most recent forecasted data and calculates the optimal carbon intensity window.
99
/// </summary>
1010
/// <param name="locations">Array of locations where the workflow is run (ex: ["eastus", "westus"])</param>
1111
/// <param name="dataStartAt">Start time boundary of forecasted data points. Ignores current forecast data points before this time (ex: 2022-03-01T15:30:00Z)</param>
@@ -15,13 +15,13 @@ public interface IForecastHandler
1515
Task<IEnumerable<EmissionsForecast>> GetCurrentForecastAsync(string[] locations, DateTimeOffset? dataStartAt = null, DateTimeOffset? dataEndAt = null, int? windowSize = null);
1616

1717
/// <summary>
18-
/// Retrieves the historical forecasted data for the given date range and calculates the optimal marginal carbon intensity window.
18+
/// Retrieves the historical forecasted data for the given date range and calculates the optimal carbon intensity window.
1919
/// </summary>
2020
/// <param name="location">String location where the workflow is run (ex: "eastus")</param>
2121
/// <param name="dataStartAt">Start time boundary of forecasted data points. Ignores current forecast data points before this time (ex: 2022-03-01T15:30:00Z)</param>
2222
/// <param name="dataEndAt">End time boundary of forecasted data points. Ignores current forecast data points after this time (ex: 2022-03-01T18:30:00Z)</param>
2323
/// <param name="requestedAt">The timestamp used to access the most recently generated forecast as of that time. (ex: 2022-03-01T18:30:00Z)</param>
2424
/// <param name="windowSize">The estimated duration (in minutes) of the workload.</param>
25-
/// <returns>An <see cref="EmissionsForecast"/> with the optimal marginal carbon intensity window.</returns>
25+
/// <returns>An <see cref="EmissionsForecast"/> with the optimal carbon intensity window.</returns>
2626
Task<EmissionsForecast> GetForecastByDateAsync(string location, DateTimeOffset? dataStartAt = null, DateTimeOffset? dataEndAt = null, DateTimeOffset? requestedAt = null, int? windowSize = null);
2727
}

0 commit comments

Comments
 (0)