Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@

## Upgrading

<!-- Here goes notes on how to upgrade from previous versions, including deprecations and what they should be replaced with -->
* Rename CLI trade and order functions for clarity
* Rename `receive_trades` to `receive_public_trades`
* Rename `receive_orders` to `receive_gridpool_orders`

## New Features

* Print tags and filled (instead of open) quantity for gridpool orders in CLI tool.

<!-- Here goes the main new features and examples or instructions on how to use them -->

## Bug Fixes

<!-- Here goes notable bug fixes that are worth a special mention or explanation -->
22 changes: 12 additions & 10 deletions src/frequenz/client/electricity_trading/cli/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
create_order as run_create_order,
)
from frequenz.client.electricity_trading.cli.etrading import (
list_gridpool_trades as run_list_gridpool_trades,
list_gridpool_orders as run_list_gridpool_orders,
)
from frequenz.client.electricity_trading.cli.etrading import (
list_orders as run_list_orders,
list_gridpool_trades as run_list_gridpool_trades,
)
from frequenz.client.electricity_trading.cli.etrading import (
list_trades as run_list_trades,
list_public_trades as run_list_public_trades,
)

TZ = ZoneInfo("Europe/Berlin")
Expand All @@ -48,9 +48,9 @@ def cli() -> None:
@click.option("--url", required=True, type=str)
@click.option("--key", required=True, type=str)
@click.option("--start", default=None, type=iso)
def receive_trades(url: str, key: str, *, start: datetime) -> None:
"""List and/or stream trades."""
asyncio.run(run_list_trades(url=url, key=key, delivery_start=start))
def receive_public_trades(url: str, key: str, *, start: datetime) -> None:
"""List and/or stream public trades."""
asyncio.run(run_list_public_trades(url=url, key=key, delivery_start=start))


@cli.command()
Expand All @@ -59,7 +59,7 @@ def receive_trades(url: str, key: str, *, start: datetime) -> None:
@click.option("--gid", required=True, type=int)
@click.option("--start", default=None, type=iso)
def receive_gridpool_trades(url: str, key: str, gid: int, *, start: datetime) -> None:
"""List and/or stream orders."""
"""List and/or stream gridpool trades."""
asyncio.run(
run_list_gridpool_trades(url=url, key=key, gid=gid, delivery_start=start)
)
Expand All @@ -70,9 +70,11 @@ def receive_gridpool_trades(url: str, key: str, gid: int, *, start: datetime) ->
@click.option("--key", required=True, type=str)
@click.option("--start", default=None, type=iso)
@click.option("--gid", required=True, type=int)
def receive_orders(url: str, key: str, *, start: datetime, gid: int) -> None:
"""List and/or stream orders."""
asyncio.run(run_list_orders(url=url, key=key, delivery_start=start, gid=gid))
def receive_gridpool_orders(url: str, key: str, *, start: datetime, gid: int) -> None:
"""List and/or stream gridpool orders."""
asyncio.run(
run_list_gridpool_orders(url=url, key=key, delivery_start=start, gid=gid)
)


@cli.command()
Expand Down
8 changes: 4 additions & 4 deletions src/frequenz/client/electricity_trading/cli/etrading.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ def check_delivery_start(
raise ValueError("Delivery period must be a multiple of `duration`.")


async def list_trades(url: str, key: str, *, delivery_start: datetime) -> None:
"""List trades and stream new trades.
async def list_public_trades(url: str, key: str, *, delivery_start: datetime) -> None:
"""List trades and stream new public trades.

If delivery_start is provided, list historical trades and stream new trades
for the 15 minute delivery period starting at delivery_start.
Expand Down Expand Up @@ -116,10 +116,10 @@ async def list_gridpool_trades(
print_trade(trade)


async def list_orders(
async def list_gridpool_orders(
url: str, key: str, *, delivery_start: datetime, gid: int
) -> None:
"""List orders and stream new orders.
"""List orders and stream new gridpool orders.

If delivery_start is provided, list historical orders and stream new orders
for the 15 minute delivery period starting at delivery_start.
Expand Down
Loading