Skip to content

Commit

Permalink
Merge pull request #60 from IEAWindTask37/move-data-schema-to-common
Browse files Browse the repository at this point in the history
move data schemas to common definitions
  • Loading branch information
bayc authored Aug 28, 2024
2 parents 47058b7 + 43e7c8c commit 2b95857
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 76 deletions.
51 changes: 50 additions & 1 deletion windIO/plant/common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,53 @@ definitions:
decimal:
type: number
minimum: 0
maximum: 1
maximum: 1

multi_dimensional_data:
oneOf:
- $ref: "#/definitions/dimensional_data"
- $ref: "#/definitions/nondimensional_data"

dimensional_data:
title: Data with custom dimensions
type: object
properties:
data:
type: array
items:
type: [array, number]
dims:
type: array

nondimensional_data:
title: Data with custom dimensions
type: object
properties:
data:
type: number
dims:
type: array
maxItems: 0

multi_dimensional_coordinate:
oneOf:
- $ref: "#/definitions/dimensional_coordinate"
- $ref: "#/definitions/nondimensional_coordinate"

dimensional_coordinate:
title: Data with custom dimensions
type: array
items:
oneOf:
- type: number
-
type: "string"
format: "date-time"

nondimensional_coordinate:
title: Data with custom dimensions
oneOf:
- type: number
-
type: "string"
format: "date-time"
101 changes: 26 additions & 75 deletions windIO/plant/energy_resource.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,85 +40,85 @@ properties:
properties:
time:
description: Timestamps for the data points
$ref: "#/definitions/multi_dimensional_coordinate"
$ref: "common.yaml#/definitions/multi_dimensional_coordinate"
wind_direction:
title: Wind directions
description: Wind directions in degrees, [0,360]
oneOf:
- $ref: "#/definitions/multi_dimensional_data"
- $ref: "#/definitions/multi_dimensional_coordinate"
- $ref: "common.yaml#/definitions/multi_dimensional_data"
- $ref: "common.yaml#/definitions/multi_dimensional_coordinate"
wind_speed:
description: Wind speeds in m/s
oneOf:
- $ref: "#/definitions/multi_dimensional_data"
- $ref: "#/definitions/multi_dimensional_coordinate"
- $ref: "common.yaml#/definitions/multi_dimensional_data"
- $ref: "common.yaml#/definitions/multi_dimensional_coordinate"
wind_turbine:
title: Wind turbine IDs
description: Wind turbine id
$ref: "#/definitions/multi_dimensional_coordinate"
$ref: "common.yaml#/definitions/multi_dimensional_coordinate"
x:
title: West-East position
oneOf:
- $ref: "#/definitions/multi_dimensional_data"
- $ref: "#/definitions/multi_dimensional_coordinate"
- $ref: "common.yaml#/definitions/multi_dimensional_data"
- $ref: "common.yaml#/definitions/multi_dimensional_coordinate"
y:
title: South-North position
oneOf:
- $ref: "#/definitions/multi_dimensional_data"
- $ref: "#/definitions/multi_dimensional_coordinate"
- $ref: "common.yaml#/definitions/multi_dimensional_data"
- $ref: "common.yaml#/definitions/multi_dimensional_coordinate"
height:
title: Reference height
oneOf:
- $ref: "#/definitions/multi_dimensional_data"
- $ref: "#/definitions/multi_dimensional_coordinate"
- $ref: "common.yaml#/definitions/multi_dimensional_data"
- $ref: "common.yaml#/definitions/multi_dimensional_coordinate"
probability:
description: Probability of flow cases [0,1]
$ref: "#/definitions/multi_dimensional_data"
$ref: "common.yaml#/definitions/multi_dimensional_data"
weibull_a:
title: Weibull scale
$ref: "#/definitions/multi_dimensional_data"
$ref: "common.yaml#/definitions/multi_dimensional_data"
weibull_k:
title: Weibull shape
$ref: "#/definitions/multi_dimensional_data"
$ref: "common.yaml#/definitions/multi_dimensional_data"
sector_probability:
title: probability of wind directions
description: Probability of wind sector [0,1]
$ref: "#/definitions/multi_dimensional_data"
$ref: "common.yaml#/definitions/multi_dimensional_data"
turbulence_intensity:
title: Turbulence intensity
$ref: "#/definitions/multi_dimensional_data"
$ref: "common.yaml#/definitions/multi_dimensional_data"
reference_height:
title: Reference height
type: number
shear:
title: Shear
$ref: "#/definitions/shear"
$ref: "common.yaml#/definitions/shear"
LMO:
title: Monin–Obukhov length (m)
$ref: "#/definitions/multi_dimensional_data"
$ref: "common.yaml#/definitions/multi_dimensional_data"
z0:
title: Roughness height (m)
$ref: "#/definitions/multi_dimensional_data"
$ref: "common.yaml#/definitions/multi_dimensional_data"
k:
title: Turbulent kinetic energy
$ref: "#/definitions/multi_dimensional_data"
$ref: "common.yaml#/definitions/multi_dimensional_data"
epsilon:
title: Turbulent dissipation
$ref: "#/definitions/multi_dimensional_data"
$ref: "common.yaml#/definitions/multi_dimensional_data"
potential_temperature:
title: Potential Temperature (K)
$ref: "#/definitions/multi_dimensional_data"
$ref: "common.yaml#/definitions/multi_dimensional_data"
friction_velocity:
title: Friction velocity (m/s)
$ref: "#/definitions/multi_dimensional_data"
$ref: "common.yaml#/definitions/multi_dimensional_data"
ground_temperature:
title: Ground Temperature (K)
description: Temperature of the ground in Kelvin
$ref: "#/definitions/multi_dimensional_data"
$ref: "common.yaml#/definitions/multi_dimensional_data"
stability:
title: Stability of the atmosphere
description: Roughness length in meters
$ref: "#/definitions/multi_dimensional_data"
$ref: "common.yaml#/definitions/multi_dimensional_data"
capping_inversion:
title: Capping Inversion
type: boolean
Expand All @@ -144,55 +144,6 @@ definitions:
title: Shear ref height
type: number

multi_dimensional_data:
oneOf:
- $ref: "#/definitions/dimensional_data"
- $ref: "#/definitions/nondimensional_data"

dimensional_data:
title: Data with custom dimensions
type: object
properties:
data:
type: array
items:
type: [array, number]
dims:
type: array

nondimensional_data:
title: Data with custom dimensions
type: object
properties:
data:
type: number
dims:
type: array
maxItems: 0

multi_dimensional_coordinate:
oneOf:
- $ref: "#/definitions/dimensional_coordinate"
- $ref: "#/definitions/nondimensional_coordinate"

dimensional_coordinate:
title: Data with custom dimensions
type: array
items:
oneOf:
- type: number
-
type: "string"
format: "date-time"

nondimensional_coordinate:
title: Data with custom dimensions
oneOf:
- type: number
-
type: "string"
format: "date-time"

# speedup:
# title: Speedup
# type: object
Expand Down

0 comments on commit 2b95857

Please sign in to comment.