summaryrefslogtreecommitdiff
path: root/finance/visualize.py
diff options
context:
space:
mode:
authorxengineering <me@xengineering.eu>2024-09-08 12:46:20 +0200
committerxengineering <me@xengineering.eu>2024-09-08 17:21:32 +0200
commit7521277860b377e3e9ec7b6d5a62c4c2c14d694f (patch)
tree56dd44a017a9e5085fbbb0ae9efdf4f20551be13 /finance/visualize.py
parent4e8d17c8d0b7d5406d3a9df8c320b5cbabb9d330 (diff)
downloadfinance-py-7521277860b377e3e9ec7b6d5a62c4c2c14d694f.tar
finance-py-7521277860b377e3e9ec7b6d5a62c4c2c14d694f.tar.zst
finance-py-7521277860b377e3e9ec7b6d5a62c4c2c14d694f.zip
Use list[tuple[datetime, Decimal]] consistently
This type is useful for finance-py in general. It is often required to handle money in datetime context. Using this type consistently makes the code easier to read and maintain.
Diffstat (limited to 'finance/visualize.py')
-rw-r--r--finance/visualize.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/finance/visualize.py b/finance/visualize.py
index c7a7c60..66943c7 100644
--- a/finance/visualize.py
+++ b/finance/visualize.py
@@ -5,12 +5,12 @@ import matplotlib.pyplot
def display(
- simulated: tuple[list[datetime], list[Decimal]],
+ simulated: list[tuple[datetime, Decimal]],
measured: list[tuple[datetime, Decimal]],
) -> None:
matplotlib.pyplot.plot(
- list(simulated[0]), # type: ignore
- [float(i) for i in simulated[1]],
+ [i[0] for i in simulated], # type: ignore
+ [float(i[1]) for i in simulated],
label="Simulated",
)
matplotlib.pyplot.plot(