Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clean up resource-id vs origin-id in provenance #194

Merged
merged 1 commit into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions docs/_data/components/schemas/array-max-monitored-elements.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ realtime-limits-snapshot:
<<: *max
description: Real-time limits
items:
$ref: ./realtime-limit-item.yaml
$ref: './realtime-limit-item.yaml#/normal'

realtime-limits-detailed-snapshot:
type: object
Expand All @@ -220,7 +220,7 @@ realtime-limits-detailed-snapshot:
<<: *max
description: Real-time limits including provenance.
items:
$ref: ./realtime-limit-item-detailed.yaml
$ref: './realtime-limit-item.yaml#/detailed'

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

required:
- proposal-header
Expand Down
30 changes: 1 addition & 29 deletions docs/_data/components/schemas/forecast-limit-period.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,34 +23,6 @@ proposal:
- $ref: '#/period'
- $ref: ./limit-proposal.yaml

proposal-considered:

description: Details a proposal that was considered by the Clearinghouse run.
allOf:
- $ref: '#/proposal'
- type: object
properties:
source:
$ref: ./data-provenance.yaml
proposal-disposition:
description: |

Despite a proposal being accepted by TROLIE, the downstream
Clearinghouse logic may still disqualify a proposal. This might
occur if, for example, the upper and lower reasonability limits are
not aligned between TROLIE and the Clearinghouse. To aid
troubleshooting, the specification requires that TROLIE instances
explicitly indicate if the proposal was `Used` in the determination
of the limit or was `Rejected`.

type: string
enum:
- Used
- Rejected
required:
- source
- proposal-disposition

snapshot:
allOf:
- $ref: '#/period'
Expand All @@ -61,4 +33,4 @@ snapshot-detailed:
description: Period detailed limits including provenance
allOf:
- $ref: '#/snapshot'
- $ref: ./limit-provenance.yaml
- $ref: './limit-provenance.yaml#/forecast'
126 changes: 69 additions & 57 deletions docs/_data/components/schemas/limit-provenance.yaml
Original file line number Diff line number Diff line change
@@ -1,63 +1,75 @@
type: object
description: Given a limit value, a set of data defining the provenance of that limit.
properties:
proposals-considered:
description: |

The forecast proposals provided by the Ratings Providers during the
Forecast Window for this limits snapshot.

type: array
maxItems: &max-proposals 10
items:
allOf:
- $ref: 'forecast-limit-period.yaml#/proposal-considered'
- type: object
properties:
resource-id:
$ref: ./resource-id.yaml

temporary-aar-exceptions:
description: |

The temporary AAR exceptions for the facility that were active when this
snapshot was generated.

type: array
maxItems: *max-proposals
items:
$ref: ./resource-id.yaml

overrides:
type: array
minItems: 0
maxItems: *max-proposals
items:
type: object
properties:
override:
$ref: ./limit-data.yaml
override-reason:
type: string
description:
forecast: &forecast
type: object
description: Contains the provenance data for a given limit.
properties: &props
proposals-considered: &considered
description: |

The ratings proposals provided by the Ratings Providers that were
considered when determining the limits of the facility for a specific
period.

If `resource-id` is not provided for a proposal, the ratings proposal is
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@getorymckeag this PR is mostly a yaml refactoring so that I could get this text to show up in both Forecast and RT detailed limits snapshots.

assumed to be for the overall facility nominated by the `resource-id` of
this limit.

If it is provided, it corresponds to the [segment](https://trolie.energy/concepts#segments).

type: array
maxItems: &max-proposals 10
items:
$ref: 'proposal-considered.yaml#/forecast'

temporary-aar-exceptions:
description: |

Indicates that this limit was overridden for some reason, the reason
itself.
The temporary AAR exceptions for the facility that were active when this
snapshot was generated.

format: free-text
maxLength: 500
required:
- override
- override-reason
type: array
maxItems: *max-proposals
items:
$ref: ./resource-id.yaml

additional-data:
description: |
overrides:
type: array
minItems: 0
maxItems: *max-proposals
items:
type: object
properties:
override:
$ref: ./limit-data.yaml
override-reason:
type: string
description:

Implementors may use this object to provide freeform extensions with
additional traceability / provenance data to be included with the limit.
Schema of this object is out of scope of the TROLIE specification.
Indicates that this limit was overridden for some reason, the reason
itself.

format: free-text
maxLength: 500
required:
- override
- override-reason

additional-data:
description: |

Implementors may use this object to provide freeform extensions with
additional traceability / provenance data to be included with the limit.
Schema of this object is out of scope of the TROLIE specification.

type: object

type: object
required:
- proposals-considered

required:
- proposals-considered
real-time:
<<: *forecast
properties:
<<: *props
proposals-considered:
<<: *considered
items:
$ref: 'proposal-considered.yaml#/real-time'
38 changes: 38 additions & 0 deletions docs/_data/components/schemas/proposal-considered.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
provenance:
type: object
properties:
source:
$ref: ./data-provenance.yaml
proposal-disposition:
description: |

Despite a proposal being accepted by TROLIE, the downstream
Clearinghouse logic may still disqualify a proposal. This might
occur if, for example, the upper and lower reasonability limits are
not aligned between TROLIE and the Clearinghouse. To aid
troubleshooting, the specification requires that TROLIE instances
explicitly indicate if the proposal was `Used` in the determination
of the limit or was `Rejected`.

type: string
enum:
- Used
- Rejected
resource-id:
$ref: ./resource-id.yaml
required:
- source
- proposal-disposition

forecast:
description: >
Details a proposal that was considered by the Clearinghouse run.
If `resource-id` is not provided, the ratings data is assumed to be for the
overall facility.
allOf:
- $ref: './forecast-limit-period.yaml#/proposal'
- $ref: '#/provenance'
real-time:
allOf:
- $ref: ./limit-proposal.yaml
- $ref: '#/provenance'
Original file line number Diff line number Diff line change
@@ -1,4 +0,0 @@
type: object
allOf:
- $ref: ./realtime-limit-item.yaml
- $ref: ./limit-provenance.yaml
25 changes: 16 additions & 9 deletions docs/_data/components/schemas/realtime-limit-item.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
type: object
allOf:
- type: object
properties:
resource-id:
$ref: ./resource-id.yaml
- $ref: ./limit-data.yaml
required:
- resource-id
normal:
type: object
allOf:
- type: object
properties:
resource-id:
$ref: ./resource-id.yaml
required:
- resource-id
- $ref: ./limit-data.yaml

detailed:
type: object
allOf:
- $ref: '#/normal'
- $ref: './limit-provenance.yaml#/real-time'
14 changes: 0 additions & 14 deletions docs/_data/components/schemas/realtime-limit-period.yaml

This file was deleted.

37 changes: 36 additions & 1 deletion docs/example-narratives/examples/forecast-limits-detailed.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,42 @@
{
"period-start": "2023-07-12T16:00:00-07:00",
"period-end": "2023-07-12T17:00:00-07:00",
"proposals-considered": [],
"proposals-considered": [
{
"resource-id": "8badf00d-UTILITY-A-SEG-id",
"source": {
"last-updated": "2023-07-12T16:00:00-07:00",
"provider": "UTILITY-A",
"origin-id": "8badf00d-UTILITY-A-correlation-id"
},
"period-start": "2023-07-12T16:00:00-07:00",
"period-end": "2023-07-12T17:00:00-07:00",
"proposal-disposition": "Used",
"continuous-operating-limit": {
"mva": 150
},
"emergency-operating-limits": [
{
"duration-name": "lte",
"limit": {
"mva": 160
}
},
{
"duration-name": "ste",
"limit": {
"mva": 165
}
},
{
"duration-name": "dal",
"limit": {
"mva": 170
}
}
]
}
],
"temporary-aar-exceptions": ["2d8c80e8-f533-4be9-85bf-f7f81eb73d67"],
"override-reason": "Any reason entered by the operator for an override.",
"additional-data": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,11 @@
"period-end":"2025-07-12T16:00:00-07:00",
"proposals-considered": [
{
"resource-id": "8badf00d-UTILITY-A-SEG-id",
"source":{
"last-updated": "2025-07-12T14:10:12-07:00",
"provider": "UTILITY-A"
"provider": "UTILITY-A",
"origin-id": "8badf00d-UTILITY-A-correlation-id"
},
"period-start":"2025-07-12T15:00:00-07:00",
"period-end":"2025-07-12T16:00:00-07:00",
Expand Down Expand Up @@ -74,9 +76,11 @@
}
]
},{
"resource-id": "8badf00d-UTILITY-B-SEG-id",
"source":{
"last-updated": "2025-07-12T14:10:12-07:00",
"provider": "UTILITY-B"
"provider": "UTILITY-B",
"origin-id": "8badf00d-UTILITY-B-correlation-id"
},
"period-start":"2025-07-12T15:00:00-07:00",
"period-end":"2025-07-12T16:00:00-07:00",
Expand Down