Skip to content

Commit

Permalink
refactor to remove use of allOf
Browse files Browse the repository at this point in the history
see extraneous elements are permitted due to use of `allOf` #162
  • Loading branch information
catkins-miso committed Nov 6, 2024
1 parent 043eb3a commit ebd92c7
Show file tree
Hide file tree
Showing 12 changed files with 128 additions and 329 deletions.
6 changes: 3 additions & 3 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'
$ref: 'period-limit.yaml#/snapshot'
required:
- resource-id
- periods
Expand All @@ -20,7 +20,7 @@ forecast-limit-item-detailed:
periods:
<<: *periods
items:
$ref: 'forecast-limit-period.yaml#/snapshot-detailed'
$ref: 'period-limit.yaml#/snapshot-detailed'

resource-forecast-proposal:
<<: *limit
Expand All @@ -29,7 +29,7 @@ resource-forecast-proposal:
periods:
<<: *periods
items:
$ref: 'forecast-limit-period.yaml#/proposal'
$ref: './period-limit.yaml#/proposal'

resource-forecast-proposal-slim:
<<: *periods
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ realtime-limits-snapshot: &realtime-limit-snapshot
<<: *max
description: Real-time limits
items:
$ref: './realtime-limit-item.yaml#/normal'
$ref: './period-limit.yaml#/rt-normal'
required:
- snapshot-header
- limits
Expand Down Expand Up @@ -360,7 +360,7 @@ realtime-limits-detailed-snapshot-elide-psr: &realtime-limit-detailed
<<: *max
description: Real-time limits including provenance.
items:
$ref: './realtime-limit-item.yaml#/detailed'
$ref: './period-limit.yaml#/rt-detailed'
provenance:
<<: *max
items:
Expand Down
36 changes: 0 additions & 36 deletions docs/_data/components/schemas/forecast-limit-period.yaml

This file was deleted.

11 changes: 0 additions & 11 deletions docs/_data/components/schemas/limit-data.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion docs/_data/components/schemas/limit-proposal.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
type: object
allOf:
- $ref: ./limit-data.yaml
- $ref: ./period-limit.yaml#/limit-data
- type: object
properties:
current-source:
Expand Down
4 changes: 1 addition & 3 deletions docs/_data/components/schemas/limit-provenance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@ forecast:
description: Contains the provenance data for a given limit.
properties:
additional-data:
type: object
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

required:
- proposals-considered
118 changes: 118 additions & 0 deletions docs/_data/components/schemas/period-limit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
period: &period
type: object
properties: &period-props
period-start:
$ref: ./period-start.yaml
period-end:
$ref: ./period-start.yaml
required:
- period-start
- period-end

limit-data:
type: object
properties: &limit-data-properties
continuous-operating-limit:
$ref: ./limit.yaml
emergency-operating-limits:
$ref: ./array-max-emergency-durations.yaml#/limit-value-set
limiting-analysis:
$ref: ./limiting-analysis.yaml
required:
- continuous-operating-limit
- emergency-operating-limits

proposal:
<<: *period
title: Forecasted Period
description: |
A Forecasted Period contains proposed limits for a power system object,
e.g., a segment, that were forecasted for a particular Period in a Forecast
Window. The status of the proposal as determined by the Clearinghouse is
also included.
properties:
<<: [*period-props, *limit-data-properties]
current-source:
$ref: ./quality-class-current-source.yaml
inputs-used:
description: |
Optional list of quantities used as input to the ratings determination.
The particular information exchange determines which values may be expected
as well as the conventions used to represent those values. This property
is included to prescribe a way to include these inputs.
type: array
minItems: 1
maxItems: 50
items:
type: object
properties:
name:
type: string
format: free-text
maxLength: 50
value:
type: object
description: >
This could be any value: a bit, float, integer, string, etc.
unit:
type: string
description: |
If the `value` is dimensionless, this property should not be
provided. Since we are not specifying which inputs shall be
provided, we cannot specify a definitive list of units, but
implementors are encouraged to use UnitSymbol from CIM when
appropriate: The CIM may not include appropriate units for
all inputs, e.g., wind speed, degrees Fahrenheit, etc.
format: unit
maxLength: 50
required:
- name
- value
required: &snapshot-required
- period-start
- period-end
- continuous-operating-limit
- emergency-operating-limits

snapshot: &snapshot
<<: *period
properties: &snapshot-props
<<: [*period-props, *limit-data-properties]
required: *snapshot-required

snapshot-detailed:
<<: *snapshot
description: Period detailed limits including provenance
properties:
<<: *snapshot-props
additional-data: &additional-data
type: object
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.
required: *snapshot-required

rt-normal: &rt-normal
type: object
properties: &rt-normal-props
<<: *limit-data-properties
resource-id:
$ref: ./resource-id.yaml
required: &rt-normal-required
- resource-id
- continuous-operating-limit
- emergency-operating-limits

rt-detailed:
<<: *rt-normal
properties:
<<: *rt-normal-props
additional-data: *additional-data
required: *rt-normal-required
2 changes: 1 addition & 1 deletion docs/_data/components/schemas/proposal-considered.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ forecast:
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: './period-limit.yaml#/proposal'
- $ref: '#/provenance'
real-time:
allOf:
Expand Down
16 changes: 0 additions & 16 deletions docs/_data/components/schemas/realtime-limit-item.yaml

This file was deleted.

4 changes: 2 additions & 2 deletions docs/_data/components/schemas/seasonal-rating-period.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ proposal:
description: Proposes the continuous and emergency ratings for the specified Season.
title: Seasonal Rating Proposal
allOf:
- $ref: 'forecast-limit-period.yaml#/proposal'
- $ref: 'period-limit.yaml#/proposal'
- type: object
properties:
season-name:
Expand Down 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'
- $ref: 'period-limit.yaml#/snapshot'
- type: object
properties:
season-name:
Expand Down
Loading

0 comments on commit ebd92c7

Please sign in to comment.