From 931aadf82327d0fc0033adb05f43ec4af4c67982 Mon Sep 17 00:00:00 2001 From: Christopher Atkins Date: Tue, 24 Sep 2024 14:23:55 +0000 Subject: [PATCH 1/2] add slim forecast proposal --- docs/Gemfile.lock | 2 +- .../schemas/array-max-forecast-periods.yaml | 10 +++++ .../schemas/array-max-monitored-elements.yaml | 14 ++++++ docs/_data/components/schemas/headers.yaml | 23 +++++++++- .../paths/rating-proposals_forecasts.yaml | 5 +++ .../forecast-ratings-proposal-slim-patch.json | 45 +++++++++++++++++++ 6 files changed, 96 insertions(+), 3 deletions(-) create mode 100644 docs/example-narratives/examples/forecast-ratings-proposal-slim-patch.json diff --git a/docs/Gemfile.lock b/docs/Gemfile.lock index 26f2dc9..3f4ebb5 100644 --- a/docs/Gemfile.lock +++ b/docs/Gemfile.lock @@ -270,7 +270,7 @@ GEM concurrent-ruby (~> 1.0) unicode-display_width (1.8.0) uri (0.13.1) - webrick (1.8.1) + webrick (1.8.2) PLATFORMS x86_64-linux diff --git a/docs/_data/components/schemas/array-max-forecast-periods.yaml b/docs/_data/components/schemas/array-max-forecast-periods.yaml index 188345f..fad7d76 100644 --- a/docs/_data/components/schemas/array-max-forecast-periods.yaml +++ b/docs/_data/components/schemas/array-max-forecast-periods.yaml @@ -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: diff --git a/docs/_data/components/schemas/array-max-monitored-elements.yaml b/docs/_data/components/schemas/array-max-monitored-elements.yaml index c04df7a..6af4574 100644 --- a/docs/_data/components/schemas/array-max-monitored-elements.yaml +++ b/docs/_data/components/schemas/array-max-monitored-elements.yaml @@ -55,6 +55,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 diff --git a/docs/_data/components/schemas/headers.yaml b/docs/_data/components/schemas/headers.yaml index 30ba693..3ae9a00 100644 --- a/docs/_data/components/schemas/headers.yaml +++ b/docs/_data/components/schemas/headers.yaml @@ -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: | @@ -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: | @@ -57,6 +57,25 @@ forecast-proposal-header: - default-emergency-durations - power-system-resources +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: description: Details about the snapshot provided by the Clearinghouse provider. properties: diff --git a/docs/_data/paths/rating-proposals_forecasts.yaml b/docs/_data/paths/rating-proposals_forecasts.yaml index 956ad42..dfde94e 100644 --- a/docs/_data/paths/rating-proposals_forecasts.yaml +++ b/docs/_data/paths/rating-proposals_forecasts.yaml @@ -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': diff --git a/docs/example-narratives/examples/forecast-ratings-proposal-slim-patch.json b/docs/example-narratives/examples/forecast-ratings-proposal-slim-patch.json new file mode 100644 index 0000000..b60760f --- /dev/null +++ b/docs/example-narratives/examples/forecast-ratings-proposal-slim-patch.json @@ -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] + ] + ] +} \ No newline at end of file From eda14ab2a6e804c1082ff026e975808c5d175e65 Mon Sep 17 00:00:00 2001 From: Christopher Atkins Date: Tue, 24 Sep 2024 15:23:15 +0000 Subject: [PATCH 2/2] adds slim forecast snapshot --- .../schemas/array-max-monitored-elements.yaml | 11 +++++ docs/_data/components/schemas/headers.yaml | 24 ++++++++- .../_data/paths/limits_forecast-snapshot.yaml | 7 ++- .../forecast-limits-slim-active-power.json | 49 +++++++++++++++++++ ...-limits-slim.json => forecast-limits.json} | 0 docs/example-narratives/in-use-forecasts.md | 2 +- 6 files changed, 89 insertions(+), 4 deletions(-) create mode 100644 docs/example-narratives/examples/forecast-limits-slim-active-power.json rename docs/example-narratives/examples/{forecast-limits-slim.json => forecast-limits.json} (100%) diff --git a/docs/_data/components/schemas/array-max-monitored-elements.yaml b/docs/_data/components/schemas/array-max-monitored-elements.yaml index 6af4574..ed69e65 100644 --- a/docs/_data/components/schemas/array-max-monitored-elements.yaml +++ b/docs/_data/components/schemas/array-max-monitored-elements.yaml @@ -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: | diff --git a/docs/_data/components/schemas/headers.yaml b/docs/_data/components/schemas/headers.yaml index 3ae9a00..4f2f27a 100644 --- a/docs/_data/components/schemas/headers.yaml +++ b/docs/_data/components/schemas/headers.yaml @@ -76,9 +76,9 @@ forecast-proposal-slim-header: - default-emergency-durations - power-system-resources -forecast-snapshot-header: +forecast-snapshot-header: &forecast-snapshot-header description: Details about the snapshot provided by the Clearinghouse provider. - properties: + properties: &forecast-snapshot-header-props begins: <<: *begins description: | @@ -96,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. diff --git a/docs/_data/paths/limits_forecast-snapshot.yaml b/docs/_data/paths/limits_forecast-snapshot.yaml index ce1a17b..8d64a5f 100644 --- a/docs/_data/paths/limits_forecast-snapshot.yaml +++ b/docs/_data/paths/limits_forecast-snapshot.yaml @@ -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" diff --git a/docs/example-narratives/examples/forecast-limits-slim-active-power.json b/docs/example-narratives/examples/forecast-limits-slim-active-power.json new file mode 100644 index 0000000..267f52f --- /dev/null +++ b/docs/example-narratives/examples/forecast-limits-slim-active-power.json @@ -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] + ] + ] +} \ No newline at end of file diff --git a/docs/example-narratives/examples/forecast-limits-slim.json b/docs/example-narratives/examples/forecast-limits.json similarity index 100% rename from docs/example-narratives/examples/forecast-limits-slim.json rename to docs/example-narratives/examples/forecast-limits.json diff --git a/docs/example-narratives/in-use-forecasts.md b/docs/example-narratives/in-use-forecasts.md index 8447aa4..fec2811 100644 --- a/docs/example-narratives/in-use-forecasts.md +++ b/docs/example-narratives/in-use-forecasts.md @@ -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: