-
Notifications
You must be signed in to change notification settings - Fork 0
feat: POWER-4980 - Apparent power and Icing forecast update #124
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
8d80974
feat(python): Quantity enum
Prebz98 5fb884e
feat(dotnet): Apparent power, quantity field and historical endpoints
Prebz98 44a1266
feat(python): Apparent power and icing forecast update
Prebz98 fba5886
feat(dotnet): Icing forecast
Prebz98 afb7d97
feat(dotnet): Apparent power
Prebz98 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
...i.Client/HeimdallPower.Api.Client/CapacityMonitoring/Facilities/CircuitRatingsResponse.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| namespace HeimdallPower.Api.Client.CapacityMonitoring.Facilities; | ||
|
|
||
| public record CircuitRatingsResponse | ||
| { | ||
| /// <summary> | ||
| /// A human-readable label identifying the rating returned by this endpoint, independent of the quantity parameter. | ||
| /// </summary> | ||
| /// <example>Circuit rating</example> | ||
| public required string Metric { get; init; } | ||
|
|
||
| /// <summary> | ||
| /// The unit of the values in the response. Depends on the requested quantity: | ||
| /// "Ampere" for current (default), "MVA" for apparent_power. | ||
| /// </summary> | ||
| /// <example>Ampere</example> | ||
| public required string Unit { get; init; } | ||
|
|
||
| /// <summary> | ||
| /// List of circuit ratings within the requested time range. | ||
| /// </summary> | ||
| public required List<CircuitRatingDto> CircuitRatings { get; init; } | ||
| } | ||
22 changes: 22 additions & 0 deletions
22
...ower.Api.Client/HeimdallPower.Api.Client/CapacityMonitoring/Lines/HeimdallAarsResponse.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| namespace HeimdallPower.Api.Client.CapacityMonitoring.Lines; | ||
|
|
||
| public record HeimdallAarsResponse | ||
| { | ||
| /// <summary> | ||
| /// A human-readable label identifying the rating returned by this endpoint, independent of the quantity parameter. | ||
| /// </summary> | ||
| /// <example>Heimdall AAR</example> | ||
| public required string Metric { get; init; } | ||
|
|
||
| /// <summary> | ||
| /// The unit of the values in the response. Depends on the requested quantity: | ||
| /// "Ampere" for current (default), "MVA" for apparent_power. | ||
| /// </summary> | ||
| /// <example>Ampere</example> | ||
| public required string Unit { get; init; } | ||
|
|
||
| /// <summary> | ||
| /// List of Heimdall AAR values within the requested time range. May be empty if no data exists for the period. | ||
| /// </summary> | ||
| public required List<HeimdallAarDto> HeimdallAars { get; init; } | ||
|
Prebz98 marked this conversation as resolved.
|
||
| } | ||
22 changes: 22 additions & 0 deletions
22
...ower.Api.Client/HeimdallPower.Api.Client/CapacityMonitoring/Lines/HeimdallDlrsResponse.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| namespace HeimdallPower.Api.Client.CapacityMonitoring.Lines; | ||
|
|
||
| public record HeimdallDlrsResponse | ||
| { | ||
| /// <summary> | ||
| /// A human-readable label identifying the rating returned by this endpoint, independent of the quantity parameter. | ||
| /// </summary> | ||
| /// <example>Heimdall DLR</example> | ||
| public required string Metric { get; init; } | ||
|
|
||
| /// <summary> | ||
| /// The unit of the values in the response. Depends on the requested quantity: | ||
| /// "Ampere" for current (default), "MVA" for apparent_power. | ||
| /// </summary> | ||
| /// <example>Ampere</example> | ||
| public required string Unit { get; init; } | ||
|
|
||
| /// <summary> | ||
| /// List of Heimdall DLR values within the requested time range. May be empty if no data exists for the period. | ||
| /// </summary> | ||
| public required List<HeimdallDlrDto> HeimdallDlrs { get; init; } | ||
|
Prebz98 marked this conversation as resolved.
|
||
| } | ||
27 changes: 27 additions & 0 deletions
27
dotnet/HeimdallPower.Api.Client/HeimdallPower.Api.Client/CapacityMonitoring/Quantity.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| namespace HeimdallPower.Api.Client.CapacityMonitoring; | ||
|
|
||
| /// <summary> | ||
| /// Controls which physical quantity is returned by a rating endpoint. | ||
| /// </summary> | ||
| public enum Quantity | ||
| { | ||
| /// <summary> | ||
| /// Values in amperes (default). | ||
| /// </summary> | ||
| Current, | ||
|
|
||
| /// <summary> | ||
| /// Values converted to three-phase apparent power in MVA using S = sqrt(3) * V * I / 1,000,000. | ||
| /// The line's operational voltage is used when set and positive; otherwise the nominal voltage is used. | ||
| /// </summary> | ||
| ApparentPower, | ||
| } | ||
|
|
||
| internal static class QuantityExtensions | ||
| { | ||
| public static string ToQueryValue(this Quantity quantity) => quantity switch | ||
| { | ||
| Quantity.ApparentPower => "apparent_power", | ||
| _ => "current", | ||
| }; | ||
| } |
23 changes: 23 additions & 0 deletions
23
...allPower.Api.Client/HeimdallPower.Api.Client/GridInsights/Lines/ApparentPowersResponse.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| using HeimdallPower.Api.Client.GridInsights.Lines.Dtos; | ||
|
|
||
| namespace HeimdallPower.Api.Client.GridInsights.Lines; | ||
|
|
||
| public record ApparentPowersResponse | ||
| { | ||
| /// <summary> | ||
| /// The kind of data this response contains. | ||
| /// </summary> | ||
| /// <example>Apparent power</example> | ||
| public required string Metric { get; init; } | ||
|
|
||
| /// <summary> | ||
| /// The unit of the values in the response. | ||
| /// </summary> | ||
| /// <example>MVA</example> | ||
| public required string Unit { get; init; } | ||
|
|
||
| /// <summary> | ||
| /// List of apparent power values within the requested time range. May be empty if no data exists for the period. | ||
| /// </summary> | ||
| public required IReadOnlyCollection<ApparentPowerDto> ApparentPowers { get; init; } | ||
| } |
16 changes: 16 additions & 0 deletions
16
...dallPower.Api.Client/HeimdallPower.Api.Client/GridInsights/Lines/Dtos/ApparentPowerDto.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| namespace HeimdallPower.Api.Client.GridInsights.Lines.Dtos; | ||
|
|
||
| public record ApparentPowerDto | ||
| { | ||
| /// <summary> | ||
| /// Time (in UTC) when the underlying current was measured. | ||
| /// </summary> | ||
| /// <example>2024-07-01T12:00:00.001Z</example> | ||
| public DateTimeOffset Timestamp { get; init; } | ||
|
|
||
| /// <summary> | ||
| /// The apparent power derived for the line at the given time, in MVA. | ||
| /// </summary> | ||
| /// <example>156.7</example> | ||
| public double Value { get; init; } | ||
| } |
15 changes: 15 additions & 0 deletions
15
....Api.Client/HeimdallPower.Api.Client/GridInsights/Lines/Dtos/IcingForecastDataPointDto.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| namespace HeimdallPower.Api.Client.GridInsights.Lines.Dtos; | ||
|
|
||
| public record IcingForecastDataPointDto | ||
| { | ||
| /// <summary> | ||
| /// Time (UTC) for this forecast data point. | ||
| /// </summary> | ||
| /// <example>2024-01-15T08:33:00Z</example> | ||
| public DateTimeOffset Timestamp { get; init; } | ||
|
|
||
| /// <summary> | ||
| /// The forecasted ice weight at this time point. | ||
| /// </summary> | ||
| public required MeasurementResult IceWeight { get; init; } | ||
| } |
14 changes: 14 additions & 0 deletions
14
...dallPower.Api.Client/HeimdallPower.Api.Client/GridInsights/Lines/Dtos/IcingForecastDto.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| namespace HeimdallPower.Api.Client.GridInsights.Lines.Dtos; | ||
|
|
||
| public record IcingForecastDto | ||
| { | ||
| /// <summary> | ||
| /// The peak ice weight across all span phases and all forecast time points. | ||
| /// </summary> | ||
| public required MaxIcingForecastDto Max { get; init; } | ||
|
|
||
| /// <summary> | ||
| /// List of spans on the line with their icing forecast data. | ||
| /// </summary> | ||
| public required IReadOnlyCollection<SpanIcingForecastDto> Spans { get; init; } | ||
| } |
9 changes: 9 additions & 0 deletions
9
...lPower.Api.Client/HeimdallPower.Api.Client/GridInsights/Lines/Dtos/MaxIcingForecastDto.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| namespace HeimdallPower.Api.Client.GridInsights.Lines.Dtos; | ||
|
|
||
| public record MaxIcingForecastDto | ||
| { | ||
| /// <summary> | ||
| /// The peak ice weight across all span phases and all forecast time points. | ||
| /// </summary> | ||
| public required SpanPhaseMeasurementResult IceWeight { get; init; } | ||
| } |
15 changes: 15 additions & 0 deletions
15
...Power.Api.Client/HeimdallPower.Api.Client/GridInsights/Lines/Dtos/SpanIcingForecastDto.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| namespace HeimdallPower.Api.Client.GridInsights.Lines.Dtos; | ||
|
|
||
| public record SpanIcingForecastDto | ||
| { | ||
| /// <summary> | ||
| /// The id of the span. | ||
| /// </summary> | ||
| /// <example>00000000-0000-0000-0000-000000000000</example> | ||
| public Guid SpanId { get; init; } | ||
|
|
||
| /// <summary> | ||
| /// List of span phases (conductors) within this span with their icing forecast. | ||
| /// </summary> | ||
| public required IReadOnlyCollection<SpanPhaseIcingForecastDto> SpanPhases { get; init; } | ||
| } |
15 changes: 15 additions & 0 deletions
15
....Api.Client/HeimdallPower.Api.Client/GridInsights/Lines/Dtos/SpanPhaseIcingForecastDto.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| namespace HeimdallPower.Api.Client.GridInsights.Lines.Dtos; | ||
|
|
||
| public record SpanPhaseIcingForecastDto | ||
| { | ||
| /// <summary> | ||
| /// The id of the span phase. | ||
| /// </summary> | ||
| /// <example>00000000-0000-0000-0000-000000000000</example> | ||
| public Guid SpanPhaseId { get; init; } | ||
|
|
||
| /// <summary> | ||
| /// Forecasted icing data points for this span phase. Covers 72 hours in 30-minute intervals (144 data points). | ||
| /// </summary> | ||
| public required IReadOnlyCollection<IcingForecastDataPointDto> Forecast { get; init; } | ||
| } |
23 changes: 23 additions & 0 deletions
23
...dallPower.Api.Client/HeimdallPower.Api.Client/GridInsights/Lines/IcingForecastResponse.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| using HeimdallPower.Api.Client.GridInsights.Lines.Dtos; | ||
|
|
||
| namespace HeimdallPower.Api.Client.GridInsights.Lines; | ||
|
|
||
| public record IcingForecastResponse | ||
| { | ||
| /// <summary> | ||
| /// The kind of data this response contains. | ||
| /// </summary> | ||
| /// <example>Icing forecast</example> | ||
| public required string Metric { get; init; } | ||
|
|
||
| /// <summary> | ||
| /// The unit of ice weight measurements. <c>kg/m</c> for metric, <c>lb/ft</c> for imperial. | ||
| /// </summary> | ||
| /// <example>kg/m</example> | ||
| public required string Unit { get; init; } | ||
|
|
||
| /// <summary> | ||
| /// Icing forecast for the line organized by spans and span phases. | ||
| /// </summary> | ||
| public required IcingForecastDto Icing { get; init; } | ||
| } |
23 changes: 23 additions & 0 deletions
23
...wer.Api.Client/HeimdallPower.Api.Client/GridInsights/Lines/LatestApparentPowerResponse.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| using HeimdallPower.Api.Client.GridInsights.Lines.Dtos; | ||
|
|
||
| namespace HeimdallPower.Api.Client.GridInsights.Lines; | ||
|
|
||
| public record LatestApparentPowerResponse | ||
| { | ||
| /// <summary> | ||
| /// The kind of data this response contains. | ||
| /// </summary> | ||
| /// <example>Apparent power</example> | ||
| public required string Metric { get; init; } | ||
|
|
||
| /// <summary> | ||
| /// The unit of the value in the response. | ||
| /// </summary> | ||
| /// <example>MVA</example> | ||
| public required string Unit { get; init; } | ||
|
|
||
| /// <summary> | ||
| /// The most recent apparent power measurement for the line. | ||
| /// </summary> | ||
| public required ApparentPowerDto ApparentPower { get; init; } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.