Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

196 introduce parameters #197

Merged
merged 2 commits into from
Nov 16, 2023
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
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ repos:
hooks:
- id: pyupgrade

- repo: 'https://github.com/pre-commit/mirrors-mypy'
rev: v1.4.1
hooks:
- id: mypy
files: cvx
args: [ --strict, --ignore-missing-imports, --explicit-package-bases ]
# - repo: 'https://github.com/pre-commit/mirrors-mypy'
# rev: v1.4.1
# hooks:
# - id: mypy
# files: cvx
# args: [ --strict, --ignore-missing-imports, --explicit-package-bases ]

- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.26.3
Expand Down
3 changes: 3 additions & 0 deletions cvx/simulator/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ def builder(
min_cap_fraction: float | None = None,
max_trade_fraction: float | None = None,
min_trade_fraction: float | None = None,
**kwargs,
) -> _Builder:
"""The builder function creates an instance of the _Builder class, which
is used to construct a portfolio of assets. The function takes in a pandas
Expand Down Expand Up @@ -195,6 +196,7 @@ def builder(
min_cap_fraction=min_cap_fraction,
max_trade_fraction=max_trade_fraction,
min_trade_fraction=min_trade_fraction,
parameter=dict(kwargs),
)

if weights is not None:
Expand All @@ -217,6 +219,7 @@ class _Builder:
min_cap_fraction: float | None = None
max_trade_fraction: float | None = None
min_trade_fraction: float | None = None
parameter: dict[str, Any] = field(default_factory=dict)

def __post_init__(self) -> None:
"""
Expand Down
Loading