Skip to content

Commit

Permalink
Merge pull request #167 from trolie/152-slim-forecasts
Browse files Browse the repository at this point in the history
add slim forecast proposal/snapshot
  • Loading branch information
getorymckeag authored Sep 27, 2024
2 parents da622cc + eda14ab commit c88ca5a
Show file tree
Hide file tree
Showing 9 changed files with 184 additions and 6 deletions.
10 changes: 10 additions & 0 deletions docs/_data/components/schemas/array-max-forecast-periods.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,16 @@ resource-forecast-proposal:
items:
$ref: 'forecast-limit-period.yaml#/proposal'

resource-forecast-proposal-slim:
<<: *periods
items:
type: array
title: Forecasted Period
minItems: 1
maxItems: 11 # 1 continuous + 10 max emergency durations
items:
type: number

missing-forecast:
<<: *limit
properties:
Expand Down
25 changes: 25 additions & 0 deletions docs/_data/components/schemas/array-max-monitored-elements.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,17 @@ forecast-limits-snapshot:
items:
$ref: 'array-max-forecast-periods.yaml#/forecast-limit-item'

forecast-limits-slim-snapshot:
type: object
description: A snapshot of the forecast for a monitoring set.
properties:
snapshot-header:
$ref: ./headers.yaml#/forecast-snapshot-slim-header
limits:
<<: *max
items:
$ref: 'array-max-forecast-periods.yaml#/resource-forecast-proposal-slim'

forecast-limits-detailed-snapshot:
type: object
description: |
Expand Down Expand Up @@ -55,6 +66,20 @@ forecast-proposal:
- proposal-header
- ratings

forecast-proposal-slim:
type: object
properties:
proposal-header:
$ref: ./headers.yaml#/forecast-proposal-slim-header
ratings:
<<: *max
description: Forecasted Ratings
items:
$ref: 'array-max-forecast-periods.yaml#/resource-forecast-proposal-slim'
required:
- proposal-header
- ratings

common-proposal-status:
type: object
properties: &common-proposal-status-props
Expand Down
47 changes: 43 additions & 4 deletions docs/_data/components/schemas/headers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ real-time-proposal-header:
appropriate metadata from the
Clearinghouse Provider's perspective.
forecast-proposal-header:
forecast-proposal-header: &forecast-proposal-header
<<: *common-header
description: |
Expand All @@ -36,7 +36,7 @@ forecast-proposal-header:
appropriate metadata from the
Clearinghouse Provider's perspective.
properties:
properties: &forecast-proposal-header-props
<<: *common-header-props
begins: &begins
description: |
Expand All @@ -57,9 +57,28 @@ forecast-proposal-header:
- default-emergency-durations
- power-system-resources

forecast-snapshot-header:
description: Details about the snapshot provided by the Clearinghouse provider.
forecast-proposal-slim-header:
<<: *forecast-proposal-header
properties:
<<: *forecast-proposal-header-props
ends:
<<: *begins
description: |
RFC 3339 date-time string with *no fractional seconds component* that
indicates that last period for each individual resource proposal,
identifying the appropriate operational window for this proposal.
required:
- begins
- ends
- source
- default-emergency-durations
- power-system-resources

forecast-snapshot-header: &forecast-snapshot-header
description: Details about the snapshot provided by the Clearinghouse provider.
properties: &forecast-snapshot-header-props
begins:
<<: *begins
description: |
Expand All @@ -77,6 +96,26 @@ forecast-snapshot-header:
- begins
- snapshot-provenance
- power-system-resources
- default-emergency-durations

forecast-snapshot-slim-header:
<<: *forecast-snapshot-header
properties:
<<: *forecast-snapshot-header-props
ends:
<<: *begins
description: |
RFC 3339 date-time string with *no fractional seconds component* that
indicates that last period for each individual resource proposal,
identifying the appropriate operational window for this proposal.
required:
- begins
- ends
- snapshot-provenance
- power-system-resources
- default-emergency-durations

real-time-snapshot-header:
description: Details about the snapshot provided by the Clearinghouse provider.
Expand Down
7 changes: 6 additions & 1 deletion docs/_data/paths/limits_forecast-snapshot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,12 @@ get:
schema:
$ref: "../components/schemas/array-max-monitored-elements.yaml#/forecast-limits-snapshot"
example:
$ref: '../../example-narratives/examples/forecast-limits-slim.json'
$ref: '../../example-narratives/examples/forecast-limits.json'
application/vnd.trolie.forecast-limits-slim-snapshot.v1+json:
schema:
$ref: "../components/schemas/array-max-monitored-elements.yaml#/forecast-limits-slim-snapshot"
example:
$ref: '../../example-narratives/examples/forecast-limits-slim-active-power.json'
application/vnd.trolie.forecast-limits-detailed-snapshot.v1+json:
schema:
$ref: "../components/schemas/array-max-monitored-elements.yaml#/forecast-limits-detailed-snapshot"
Expand Down
5 changes: 5 additions & 0 deletions docs/_data/paths/rating-proposals_forecasts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ patch:
$ref: ../components/schemas/array-max-monitored-elements.yaml#/forecast-proposal
example:
$ref: ../../example-narratives/examples/forecast-ratings-proposal-patch.json
application/vnd.trolie.rating-forecast-proposal-slim.v1+json:
schema:
$ref: ../components/schemas/array-max-monitored-elements.yaml#/forecast-proposal-slim
example:
$ref: ../../example-narratives/examples/forecast-ratings-proposal-slim-patch.json

responses:
'202':
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"snapshot-header": {
"begins": "2023-07-12T16:00:00-07:00",
"ends": "2023-07-12T18:00:00-07:00",
"snapshot-provenance": {
"provider":"X-AMPL",
"last-updated": "2023-07-12T16:00:00-07:00",
"origin-id": "//trolie.example.com/snapshots/2024-08-05T11%3a00%3a00-07%3a00"
},
"default-emergency-durations": [
{
"name": "lte",
"duration-minutes": 240
},
{
"name": "ste",
"duration-minutes": 30
},
{
"name": "dal",
"duration-minutes": 15
}
],
"power-system-resources": [
{ "resource-id": "8badf00d",
"alternate-identifiers": [
{"name": "segmentX", "authority": "TO-NERC-ID"},
{"name": "LINE1 SEG-X", "authority": "RC-NERC-ID", "mrid": "8badf00d"}
]
},
{ "resource-id": "f34d3d",
"alternate-identifiers": [
{"name": "segmentY", "authority": "TO-NERC-ID"},
{"name": "LINE2 SEG-Y", "authority": "RC-NERC-ID", "mrid": "8badf00d"}
]
}
]
},
"limits": [
[
[160, 1.0, 170, 1.0, 180, 1.0, 190, 1.0],
[161, 1.0, 171, 1.0, 181, 1.0, 191, 1.0]
],
[
[140, 1.0, 150, 1.0, 160, 1.0, 170, 1.0],
[141, 1.0, 151, 1.0, 161, 1.0, 171, 1.0]
]
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"proposal-header" : {
"source": {
"last-updated": "2025-10-31T15:05:43.044267100-07:00",
"provider": "UTILITY-A",
"origin-id": "5aeacb25-9b65-4738-8a00-ac10afa63640"
},
"begins": "2025-11-01T01:00:00-05:00",
"ends": "2025-11-01T05:00:00-05:00",
"default-emergency-durations": [
{
"name": "emergency",
"duration-minutes": 240
}
],
"power-system-resources": [
{ "resource-id": "8badf00d",
"alternate-identifiers": [
{"name": "segmentX", "authority": "TO-NERC-ID"},
{"name": "LINE1 SEG-X", "authority": "RC-NERC-ID", "mrid": "8badf00d"}
]
},
{ "resource-id": "f34d3d",
"alternate-identifiers": [
{"name": "segmentY", "authority": "TO-NERC-ID"},
{"name": "LINE2 SEG-Y", "authority": "RC-NERC-ID", "mrid": "8badf00d"}
]
}
]
},
"ratings": [
[
[160, 170],
[155, 160],
[145, 150],
[140, 145]
],
[
[160, 170],
[155, 160],
[145, 150],
[140, 145]
]
]
}
2 changes: 1 addition & 1 deletion docs/example-narratives/in-use-forecasts.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ curl -H "Accept: application/vnd.trolie.forecast-limit-set-slim.v1+json" \
This will return the current version of the in-use ratings for the next 240 hours into output.json. See the following for an example:

```json
{% include_relative examples/forecast-limits-slim.json %}
{% include_relative examples/forecast-limits.json %}
```

The above example assumes the next 240 hours as determined by the computer clock where TROLIE server is running. Given that there are edge cases in time and the user’s clocks are likely slightly off from the TROLIE server's clock, it is recommended to specify the times more explicitly to ensure that users are getting what is expected. This may be done by specifying the "offset-period-start" parameter, like in the following example:
Expand Down

0 comments on commit c88ca5a

Please sign in to comment.