Skip to content

Commit

Permalink
Merge pull request #169 from trolie/168-rt-slim
Browse files Browse the repository at this point in the history
add slim RT limits snapshot and proposal
  • Loading branch information
getorymckeag authored Oct 3, 2024
2 parents c88ca5a + 140d257 commit f2529b2
Show file tree
Hide file tree
Showing 11 changed files with 134 additions and 27 deletions.
2 changes: 1 addition & 1 deletion docs/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ GEM
rb-fsevent (0.11.2)
rb-inotify (0.11.1)
ffi (~> 1.0)
rexml (3.3.7)
rexml (3.3.8)
rouge (3.30.0)
rubyzip (2.3.2)
safe_yaml (1.0.5)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
slim:
type: array
title: Slim Period
minItems: 1
maxItems: 11 # 1 continuous + 10 max emergency durations
items:
type: number
9 changes: 2 additions & 7 deletions docs/_data/components/schemas/array-max-forecast-periods.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ forecast-limit-item: &limit
type: array
maxItems: 300
items:
$ref: 'forecast-limit-period.yaml#/snapshot-slim'
$ref: 'forecast-limit-period.yaml#/snapshot'
required:
- resource-id
- periods
Expand All @@ -34,12 +34,7 @@ resource-forecast-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
$ref: 'array-max-emergency-ratings.yaml#/slim'

missing-forecast:
<<: *limit
Expand Down
45 changes: 30 additions & 15 deletions docs/_data/components/schemas/array-max-monitored-elements.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ common-proposal-status:
size of `incomplete-facilities`, since the latter has a pre-defined
upper bound for performance and application security reasons.
⚠️ **The Ratings Provider should check that this value is zero when they
believe they have completed their submission process.️** ⚠️
The Ratings Provider should check that this value is zero when they
believe they have completed their submission process.
type: integer
format: uint16
Expand Down Expand Up @@ -222,6 +222,18 @@ realtime-limits-detailed-snapshot:
items:
$ref: ./realtime-limit-item-detailed.yaml

realtime-limits-snapshot-slim:
type: object
description: A snapshot of the realtime limits for a monitoring set.
properties:
snapshot-header:
$ref: ./headers.yaml#/real-time-snapshot-header
limits:
<<: *max
description: Real-time limits
items:
$ref: 'array-max-emergency-ratings.yaml#/slim'

realtime-proposal:
type: object
properties:
Expand All @@ -231,24 +243,27 @@ realtime-proposal:
<<: *max
description: Real-Time Ratings Proposals
items:
type: object
description: >
Real-time ratings data for a segment.
allOf:
- type: object
properties:
resource-id:
$ref: ./resource-id.yaml
- $ref: ./limit-proposal.yaml
required:
- resource-id
- continuous-operating-limit
- emergency-operating-limits
$ref: 'realtime-limit-period.yaml#/proposal'

required:
- proposal-header
- ratings

realtime-proposal-slim:
type: object
description: Used to propose real-time ratings for a set of resources.
properties:
proposal-header:
$ref: ./headers.yaml#/real-time-proposal-header
ratings:
<<: *max
description: Real-Time Ratings Proposals
items:
$ref: "array-max-emergency-ratings.yaml#/slim"
required:
- proposal-header
- ratings

seasonal-ratings-proposal:
type: object
properties:
Expand Down
4 changes: 2 additions & 2 deletions docs/_data/components/schemas/forecast-limit-period.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ proposal-considered:
- source
- proposal-disposition

snapshot-slim:
snapshot:
allOf:
- $ref: '#/period'
- $ref: ./limit-data.yaml
Expand All @@ -60,5 +60,5 @@ snapshot-detailed:
type: object
description: Period detailed limits including provenance
allOf:
- $ref: '#/snapshot-slim'
- $ref: '#/snapshot'
- $ref: ./limit-provenance.yaml
14 changes: 14 additions & 0 deletions docs/_data/components/schemas/realtime-limit-period.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
proposal:
type: object
description: >
Real-time ratings data for a segment.
allOf:
- type: object
properties:
resource-id:
$ref: ./resource-id.yaml
- $ref: ./limit-proposal.yaml
required:
- resource-id
- continuous-operating-limit
- emergency-operating-limits
2 changes: 1 addition & 1 deletion docs/_data/components/schemas/seasonal-rating-period.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ snapshot:
description: Proposes the continuous and emergency ratings for the specified Season.
title: Seasonal Rating Proposal
allOf:
- $ref: 'forecast-limit-period.yaml#/snapshot-slim'
- $ref: 'forecast-limit-period.yaml#/snapshot'
- type: object
properties:
season-name:
Expand Down
5 changes: 5 additions & 0 deletions docs/_data/paths/limits_realtime-snapshot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ get:
$ref: "../components/schemas/array-max-monitored-elements.yaml#/realtime-limits-detailed-snapshot"
example:
$ref: '../../example-narratives/examples/realtime-limit-set-detailed.json'
application/vnd.trolie.realtime-limits-snapshot-slim.v1+json:
schema:
$ref: "../components/schemas/array-max-monitored-elements.yaml#/realtime-limits-snapshot-slim"
example:
$ref: '../../example-narratives/examples/realtime-limit-set-slim.json'
headers:
$ref: '../openapi-split.yaml#/components/responses/204/headers'
'304':
Expand Down
7 changes: 6 additions & 1 deletion docs/_data/paths/rating-proposals_realtime.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@ post:
$ref: "../components/schemas/array-max-monitored-elements.yaml#/realtime-proposal"
example:
$ref: ../../example-narratives/examples/realtime-proposal.json
application/vnd.trolie.rating-realtime-proposal-slim.v1+json:
schema:
$ref: "../components/schemas/array-max-monitored-elements.yaml#/realtime-proposal-slim"
example:
$ref: ../../example-narratives/examples/realtime-proposal-slim-patch.json
responses:
'202':
description: |
Expand All @@ -105,7 +110,7 @@ post:
schema:
$ref: ../components/schemas/array-max-monitored-elements.yaml#/real-time-proposal-status
example:
$ref: ../../example-narratives/examples/realtime-proposal-status.json
$ref: ../../example-narratives/examples/realtime-proposal-status.json
headers:
$ref: '../openapi-split.yaml#/components/responses/204/headers'

Expand Down
33 changes: 33 additions & 0 deletions docs/example-narratives/examples/realtime-limit-set-slim.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"snapshot-header": {
"snapshot-provenance": {
"provider": "X-AMPL",
"last-updated": "2023-07-12T15:05:43.044267100-07:00",
"origin-id": "//trolie.example.com/snapshots/2024-08-05T11%3a00%3a00-07%3a00"
},
"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" }
]
}
]
},
"limits": [
[ 160, 170 ],
[ 155, 160 ]
]
}
33 changes: 33 additions & 0 deletions docs/example-narratives/examples/realtime-proposal-slim-patch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"proposal-header" : {
"source": {
"last-updated": "2025-10-31T15:05:43.044267100-07:00",
"provider": "UTILITY-A",
"origin-id": "5aeacb25-9b65-4738-8a00-ac10afa63640"
},
"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]
]
}

0 comments on commit f2529b2

Please sign in to comment.