Skip to content

Commit

Permalink
Add docs cross-linking to APIs (#571)
Browse files Browse the repository at this point in the history
For APIs now we can use cross-referencing, which is more user-friendly
but also easier to maintain as we only need to update the version we
want to point to in one place (the `mkdocs.yml` file).

- mkdocs: Add cross-linking object inventory for APIs
- Change links to the source with links to the docs
  • Loading branch information
llucax authored Aug 9, 2023
2 parents a0c7a11 + 62a4639 commit fd18523
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 10 deletions.
2 changes: 2 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,9 @@ plugins:
import:
# See https://mkdocstrings.github.io/python/usage/#import for details
- https://docs.python.org/3/objects.inv
- https://frequenz-floss.github.io/frequenz-api-common/v0.3/objects.inv
- https://frequenz-floss.github.io/frequenz-channels-python/v0.14/objects.inv
- https://frequenz-floss.github.io/frequenz-api-microgrid/v0.15/objects.inv
- https://grpc.github.io/grpc/python/objects.inv
- https://networkx.org/documentation/stable/objects.inv
- https://numpy.org/doc/stable/objects.inv
Expand Down
32 changes: 24 additions & 8 deletions src/frequenz/sdk/microgrid/component/_component_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,9 @@ class BatteryData(ComponentData):
This is the lower limit of the range within which power requests are allowed for the
battery.
More details [here](https://github.com/frequenz-floss/frequenz-api-common/blob/v0.3.0/proto/frequenz/api/common/metrics.proto#L37-L91).
See [`frequenz.api.common.metrics_pb2.Metric.system_inclusion_bounds`][] and
[`frequenz.api.common.metrics_pb2.Metric.system_exclusion_bounds`][] for more
details.
"""

power_exclusion_lower_bound: float
Expand All @@ -146,7 +148,9 @@ class BatteryData(ComponentData):
This is the lower limit of the range within which power requests are not allowed for
the battery.
More details [here](https://github.com/frequenz-floss/frequenz-api-common/blob/v0.3.0/proto/frequenz/api/common/metrics.proto#L37-L91).
See [`frequenz.api.common.metrics_pb2.Metric.system_inclusion_bounds`][] and
[`frequenz.api.common.metrics_pb2.Metric.system_exclusion_bounds`][] for more
details.
"""

power_inclusion_upper_bound: float
Expand All @@ -155,7 +159,9 @@ class BatteryData(ComponentData):
This is the upper limit of the range within which power requests are allowed for the
battery.
More details [here](https://github.com/frequenz-floss/frequenz-api-common/blob/v0.3.0/proto/frequenz/api/common/metrics.proto#L37-L91).
See [`frequenz.api.common.metrics_pb2.Metric.system_inclusion_bounds`][] and
[`frequenz.api.common.metrics_pb2.Metric.system_exclusion_bounds`][] for more
details.
"""

power_exclusion_upper_bound: float
Expand All @@ -164,7 +170,9 @@ class BatteryData(ComponentData):
This is the upper limit of the range within which power requests are not allowed for
the battery.
More details [here](https://github.com/frequenz-floss/frequenz-api-common/blob/v0.3.0/proto/frequenz/api/common/metrics.proto#L37-L91).
See [`frequenz.api.common.metrics_pb2.Metric.system_inclusion_bounds`][] and
[`frequenz.api.common.metrics_pb2.Metric.system_exclusion_bounds`][] for more
details.
"""
# pylint: enable=line-too-long

Expand Down Expand Up @@ -228,7 +236,9 @@ class InverterData(ComponentData):
This is the lower limit of the range within which power requests are allowed for the
inverter.
More details [here](https://github.com/frequenz-floss/frequenz-api-common/blob/v0.3.0/proto/frequenz/api/common/metrics.proto#L37-L91).
See [`frequenz.api.common.metrics_pb2.Metric.system_inclusion_bounds`][] and
[`frequenz.api.common.metrics_pb2.Metric.system_exclusion_bounds`][] for more
details.
"""

active_power_exclusion_lower_bound: float
Expand All @@ -237,7 +247,9 @@ class InverterData(ComponentData):
This is the lower limit of the range within which power requests are not allowed for
the inverter.
More details [here](https://github.com/frequenz-floss/frequenz-api-common/blob/v0.3.0/proto/frequenz/api/common/metrics.proto#L37-L91).
See [`frequenz.api.common.metrics_pb2.Metric.system_inclusion_bounds`][] and
[`frequenz.api.common.metrics_pb2.Metric.system_exclusion_bounds`][] for more
details.
"""

active_power_inclusion_upper_bound: float
Expand All @@ -246,7 +258,9 @@ class InverterData(ComponentData):
This is the upper limit of the range within which power requests are allowed for the
inverter.
More details [here](https://github.com/frequenz-floss/frequenz-api-common/blob/v0.3.0/proto/frequenz/api/common/metrics.proto#L37-L91).
See [`frequenz.api.common.metrics_pb2.Metric.system_inclusion_bounds`][] and
[`frequenz.api.common.metrics_pb2.Metric.system_exclusion_bounds`][] for more
details.
"""

active_power_exclusion_upper_bound: float
Expand All @@ -255,7 +269,9 @@ class InverterData(ComponentData):
This is the upper limit of the range within which power requests are not allowed for
the inverter.
More details [here](https://github.com/frequenz-floss/frequenz-api-common/blob/v0.3.0/proto/frequenz/api/common/metrics.proto#L37-L91).
See [`frequenz.api.common.metrics_pb2.Metric.system_inclusion_bounds`][] and
[`frequenz.api.common.metrics_pb2.Metric.system_exclusion_bounds`][] for more
details.
"""
# pylint: enable=line-too-long

Expand Down
8 changes: 6 additions & 2 deletions src/frequenz/sdk/timeseries/battery_pool/_result_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ class PowerMetrics:
When exclusion bounds are present, they will exclude a subset of the inclusion
bounds.
More details [here](https://github.com/frequenz-floss/frequenz-api-common/blob/v0.3.0/proto/frequenz/api/common/metrics.proto#L37-L91).
See [`frequenz.api.common.metrics_pb2.Metric.system_inclusion_bounds`][] and
[`frequenz.api.common.metrics_pb2.Metric.system_exclusion_bounds`][] for more
details.
"""

exclusion_bounds: Bounds
Expand All @@ -46,6 +48,8 @@ class PowerMetrics:
This is the range within which power requests are NOT allowed by the battery pool.
If present, they will be a subset of the inclusion bounds.
More details [here](https://github.com/frequenz-floss/frequenz-api-common/blob/v0.3.0/proto/frequenz/api/common/metrics.proto#L37-L91).
See [`frequenz.api.common.metrics_pb2.Metric.system_inclusion_bounds`][] and
[`frequenz.api.common.metrics_pb2.Metric.system_exclusion_bounds`][] for more
details.
"""
# pylint: enable=line-too-long

0 comments on commit fd18523

Please sign in to comment.