Skip to content

Commit

Permalink
temp fix to support mypyc compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
bsdz committed Jan 10, 2024
1 parent f685c5a commit 26ebf04
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@ nbconvert = "^7.2.9"
profile = "black"

[build-system]
requires = ["poetry-core>=1.0.0", "setuptools==69.0.2", "mypy==1.7.1", "pandas-stubs==2.1.4.231227"]
requires = ["poetry-core>=1.0.0", "setuptools==69.0.2", "mypy==1.8.0", "pandas-stubs==2.1.4.231227"]
build-backend = "poetry.core.masonry.api"
12 changes: 7 additions & 5 deletions yabte/backtest/asset.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from dataclasses import dataclass
from decimal import Decimal
from enum import Flag, auto

# from enum import Flag, auto
from typing import TypeAlias

import pandas as pd
Expand All @@ -9,10 +10,11 @@
__all__ = ["Asset"]


class AssetDataFieldInfo(Flag):
AVAILABLE_AT_CLOSE = auto()
AVAILABLE_AT_OPEN = auto()
REQUIRED = auto()
# use normal class until mypy supports flags
class AssetDataFieldInfo:
AVAILABLE_AT_CLOSE: int = 1
AVAILABLE_AT_OPEN: int = 2
REQUIRED: int = 4


_FI = AssetDataFieldInfo
Expand Down

0 comments on commit 26ebf04

Please sign in to comment.