frequenz-floss / frequenz-api-common

Shared protobuf definitions and Python bindings for Frequenz APIs
https://frequenz-floss.github.io/frequenz-api-common/
MIT License
1 stars 12 forks source link

Generalize Energy Message Documentation for Broader Market Use #261

Closed thomas-nicolai-frequenz closed 1 month ago

thomas-nicolai-frequenz commented 1 month ago

What's needed?

The Energy message is being used everywhere in our APIs and is mostly related to trading but in various markets like ancillary service markets alongside spot markets. We need to make this more general.

Summary of Changes:

Generalized the Documentation:

This change ensures that the Energy message documentation is universally applicable across all areas where it's used in our APIs.

Proposed solution

// Frequenz definitions of energy.
//
// Copyright 2023 Frequenz Energy-as-a-Service GmbH
//
// Licensed under the MIT License (the "License");
// you may not use this file except in compliance with the License.

syntax = "proto3";

package frequenz.api.common.v1.market;

import "frequenz/api/common/v1/types/decimal.proto";

// Represents a unit of energy.
//
// !!! note
//     The energy unit is denominated in MWh (Megawatt-hours), which is a unit of
//     energy representing total output over a period. This differs from MW
//     (Megawatts), a unit of power that represents the rate of energy production
//     or consumption. Using MWh allows for consistent measurement across various
//     markets and applications.
message Energy {
  // Energy amount in Megawatt-hours (MWh).
  frequenz.api.common.v1.types.Decimal mwh = 1;
}

Use cases

No response

Alternatives and workarounds

No response

Additional context

No response

thomas-nicolai-frequenz commented 1 month ago

Here is also a diff:

--- Original Protobuf File
+++ Updated Protobuf File
@@ -1,6 +1,6 @@
-// Frequenz definitions of energy for electricity trading.
+// Frequenz definitions of energy.
 //
 // Copyright 2023 Frequenz Energy-as-a-Service GmbH
 //
 // Licensed under the MIT License (the "License");
 // you may not use this file except in compliance with the License.
@@ -10,11 +10,12 @@
 package frequenz.api.common.v1.market;

 import "frequenz/api/common/v1/types/decimal.proto";

-// Represents a single unit of electricity.
+// Represents a unit of energy.
 //
 // !!! note
-//     In these trading orders, the unit of energy is denominated in MWh
-//     (Megawatt-hours) as opposed to MW (Megawatts).  MWh is a unit of energy
-//     representing total output over a period, while MW is a unit of power that
-//     represents the rate of energy production or consumption.
+//     The energy unit is denominated in MWh (Megawatt-hours), which is a unit of
+//     energy representing total output over a period. This differs from MW
+//     (Megawatts), a unit of power that represents the rate of energy production
+//     or consumption. Using MWh allows for consistent measurement across various
+//     markets and applications.
 message Energy {
-   // Represents energy unit in Megawatthours (MWh).
+   // Energy amount in Megawatt-hours (MWh).
   frequenz.api.common.v1.types.Decimal mwh = 1;
 }

@camille-bouvy-frequenz please adjust how you see fit.

camille-bouvy-frequenz commented 1 month ago

Done in #267