Skip to content

Commit

Permalink
fixed 3.10 incompatible iso format
Browse files Browse the repository at this point in the history
  • Loading branch information
jbaron committed Aug 19, 2024
1 parent d7f4aaa commit b57b100
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ description = "A fast algo-trading platform with support for machine learning ba
readme = "README.md"
requires-python = ">=3.10, <3.12"
classifiers = [
"Development Status :: 3 - Beta",
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
Expand Down
4 changes: 2 additions & 2 deletions roboquant/monetary.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class ECBConversion(CurrencyConverter):
__file_name = Path.home() / ".roboquant" / "eurofxref-hist.csv"

def __init__(self):
self.rates: Dict[Currency, List[Any]] = {EUR: [(datetime.fromisoformat("2000-01-01T15:00:00Z"), 1.0)]}
self.rates: Dict[Currency, List[Any]] = {EUR: [(datetime.fromisoformat("2000-01-01T15:00:00+00:00"), 1.0)]}
if not self.exists():
self.download()
self.parse()
Expand Down Expand Up @@ -90,7 +90,7 @@ def parse(self):

header_len = len(currencies)
for row in csv_reader:
d = datetime.fromisoformat(row[0] + "T15:00:00Z")
d = datetime.fromisoformat(row[0] + "T15:00:00+00:00")
for idx in range(header_len):
v = row[idx + 1]
if v and v != "N/A":
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_monetary.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def test_static_conversion(self):
Amount.register_converter(NoConversion())

def test_ecb_conversion(self):
now = datetime.fromisoformat("2020-01-01T00:00:00Z")
now = datetime.fromisoformat("2020-01-01T00:00:00+00:00")
converter = ECBConversion()
Amount.register_converter(converter)
amt1 = Amount(GBP, 100.0)
Expand Down

0 comments on commit b57b100

Please sign in to comment.