Skip to content

Commit ce39eb9

Browse files
Rename CLI commands for clarity (#108)
Rename the functions to clearly distinguish between gridpool and public order/trades for clarity & consistency
2 parents 32ad220 + 72667d1 commit ce39eb9

File tree

3 files changed

+19
-17
lines changed

3 files changed

+19
-17
lines changed

RELEASE_NOTES.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66

77
## Upgrading
88

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

1113
## New Features
1214

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

15-
<!-- Here goes the main new features and examples or instructions on how to use them -->
16-
1717
## Bug Fixes
1818

1919
<!-- Here goes notable bug fixes that are worth a special mention or explanation -->

src/frequenz/client/electricity_trading/cli/__main__.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@
1717
create_order as run_create_order,
1818
)
1919
from frequenz.client.electricity_trading.cli.etrading import (
20-
list_gridpool_trades as run_list_gridpool_trades,
20+
list_gridpool_orders as run_list_gridpool_orders,
2121
)
2222
from frequenz.client.electricity_trading.cli.etrading import (
23-
list_orders as run_list_orders,
23+
list_gridpool_trades as run_list_gridpool_trades,
2424
)
2525
from frequenz.client.electricity_trading.cli.etrading import (
26-
list_trades as run_list_trades,
26+
list_public_trades as run_list_public_trades,
2727
)
2828

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

5555

5656
@cli.command()
@@ -59,7 +59,7 @@ def receive_trades(url: str, key: str, *, start: datetime) -> None:
5959
@click.option("--gid", required=True, type=int)
6060
@click.option("--start", default=None, type=iso)
6161
def receive_gridpool_trades(url: str, key: str, gid: int, *, start: datetime) -> None:
62-
"""List and/or stream orders."""
62+
"""List and/or stream gridpool trades."""
6363
asyncio.run(
6464
run_list_gridpool_trades(url=url, key=key, gid=gid, delivery_start=start)
6565
)
@@ -70,9 +70,11 @@ def receive_gridpool_trades(url: str, key: str, gid: int, *, start: datetime) ->
7070
@click.option("--key", required=True, type=str)
7171
@click.option("--start", default=None, type=iso)
7272
@click.option("--gid", required=True, type=int)
73-
def receive_orders(url: str, key: str, *, start: datetime, gid: int) -> None:
74-
"""List and/or stream orders."""
75-
asyncio.run(run_list_orders(url=url, key=key, delivery_start=start, gid=gid))
73+
def receive_gridpool_orders(url: str, key: str, *, start: datetime, gid: int) -> None:
74+
"""List and/or stream gridpool orders."""
75+
asyncio.run(
76+
run_list_gridpool_orders(url=url, key=key, delivery_start=start, gid=gid)
77+
)
7678

7779

7880
@cli.command()

src/frequenz/client/electricity_trading/cli/etrading.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ def check_delivery_start(
4141
raise ValueError("Delivery period must be a multiple of `duration`.")
4242

4343

44-
async def list_trades(url: str, key: str, *, delivery_start: datetime) -> None:
45-
"""List trades and stream new trades.
44+
async def list_public_trades(url: str, key: str, *, delivery_start: datetime) -> None:
45+
"""List trades and stream new public trades.
4646
4747
If delivery_start is provided, list historical trades and stream new trades
4848
for the 15 minute delivery period starting at delivery_start.
@@ -116,10 +116,10 @@ async def list_gridpool_trades(
116116
print_trade(trade)
117117

118118

119-
async def list_orders(
119+
async def list_gridpool_orders(
120120
url: str, key: str, *, delivery_start: datetime, gid: int
121121
) -> None:
122-
"""List orders and stream new orders.
122+
"""List orders and stream new gridpool orders.
123123
124124
If delivery_start is provided, list historical orders and stream new orders
125125
for the 15 minute delivery period starting at delivery_start.

0 commit comments

Comments
 (0)