Skip to content

Commit cbc06b6

Browse files
committed
docs: update release notes for v0.4.0 API features
Signed-off-by: Mathias L. Baumann <[email protected]>
1 parent b802d77 commit cbc06b6

File tree

4 files changed

+20
-14
lines changed

4 files changed

+20
-14
lines changed

RELEASE_NOTES.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@ Initial release of the Frequenz Market Metering API client for Python.
77
## New Features
88

99
- `MarketMeteringApiClient`: Main client class for connecting to the Market Metering service
10-
- `stream_samples()`: Async iterator for streaming metering samples from Market Locations
10+
- `upsert_samples()`: Bidirectional streaming for upserting metering samples.
11+
- `create_market_location()`: Create a new Market Location.
12+
- `update_market_location()`: Update an existing Market Location.
13+
- `activate_market_location()`: Activate a Market Location.
14+
- `deactivate_market_location()`: Deactivate a Market Location.
15+
- `list_market_locations()`: List Market Locations with filtering and pagination.
1116
- `stream()`: Channel-based receiver for streaming with automatic reconnection
1217
- CLI tool (`marketmetering-cli`) for quick access to metering data
1318
- Support for multiple market identifier types:

mkdocs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,9 @@ plugins:
102102
- mkdocstrings:
103103
default_handler: python
104104
handlers:
105-
paths: ["src"]
106105
python:
107106
options:
107+
paths: ["src"]
108108
docstring_section_style: spacy
109109
inherited_members: true
110110
merge_init_into_class: false
@@ -116,7 +116,7 @@ plugins:
116116
show_source: true
117117
show_symbol_type_toc: true
118118
signature_crossrefs: true
119-
inventories:
119+
import:
120120
# TODO(cookiecutter): You might want to add other external references here
121121
# See https://mkdocstrings.github.io/python/usage/#import for details
122122
- https://docs.python.org/3/objects.inv

src/frequenz/client/marketmetering/_client.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
MarketLocation,
2626
MarketLocationEntry,
2727
MarketLocationRef,
28+
MarketLocationSample,
2829
MarketLocationSeries,
2930
MarketLocationsFilter,
3031
MarketLocationUpdate,
@@ -34,7 +35,6 @@
3435
ResamplingOptions,
3536
RevisionSelection,
3637
UpsertResult,
37-
MarketLocationSample,
3838
)
3939

4040
DEFAULT_PORT = 443
@@ -311,9 +311,9 @@ async def upsert_samples(
311311
UpsertResult objects indicating success or failure for each sample.
312312
"""
313313

314-
async def request_generator() -> AsyncIterator[
315-
pb.UpsertMarketLocationSamplesStreamRequest
316-
]:
314+
async def request_generator() -> (
315+
AsyncIterator[pb.UpsertMarketLocationSamplesStreamRequest]
316+
):
317317
async for ml_ref, series in samples_stream:
318318
for sample in series.samples:
319319
yield pb.UpsertMarketLocationSamplesStreamRequest(

src/frequenz/client/marketmetering/types.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
pagination_params_pb2 as pagination_params_pb,
1313
)
1414
from frequenz.api.marketmetering.v1alpha1 import marketmetering_pb2 as pb
15-
from google.protobuf import struct_pb2
16-
from google.protobuf import field_mask_pb2
15+
from google.protobuf import field_mask_pb2, struct_pb2
1716
from google.protobuf.timestamp_pb2 import Timestamp
1817

1918

@@ -691,11 +690,13 @@ def from_protobuf(
691690
# Here we assume it's always present or defaults to 0.
692691
revision=pb_obj.revision,
693692
update_time=update_time,
694-
resampling_method=ResamplingMethod(pb_obj.resampling_method)
695-
if isinstance(pb_obj, pb.MarketLocationSampleDetail)
696-
# Fallback to UNSPECIFIED if it's a simple MarketLocationSample
697-
# which does not have this field.
698-
else ResamplingMethod.UNSPECIFIED,
693+
resampling_method=(
694+
ResamplingMethod(pb_obj.resampling_method)
695+
if isinstance(pb_obj, pb.MarketLocationSampleDetail)
696+
# Fallback to UNSPECIFIED if it's a simple MarketLocationSample
697+
# which does not have this field.
698+
else ResamplingMethod.UNSPECIFIED
699+
),
699700
)
700701

701702
def to_protobuf(self) -> pb.MarketLocationSample:

0 commit comments

Comments
 (0)