Add dates to /quantitative as needed. (#6078)

* Add dates to /quantitative as needed.

Run new black

* Fix tests

* Pycharm is weird sometimes

* uncommit

* Add default window + error handling + mistake

---------

Co-authored-by: Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com>
This commit is contained in:
James Maslek
2024-02-15 12:07:06 -05:00
committed by GitHub
parent fa5dedf4a5
commit 3893338534
4 changed files with 118 additions and 36 deletions

View File

@@ -129,8 +129,8 @@ def test_quantitative_omega_ratio(params, data_type, obb):
@parametrize(
"params, data_type",
[
({"data": "", "target": "close", "window": "5"}, "equity"),
({"data": "", "target": "high", "window": "10"}, "crypto"),
({"data": "", "target": "close", "window": "5", "index": "date"}, "equity"),
({"data": "", "target": "high", "window": "10", "index": "date"}, "crypto"),
],
)
@pytest.mark.integration
@@ -180,8 +180,20 @@ def test_quantitative_unitroot_test(params, data_type, obb):
@parametrize(
"params, data_type",
[
({"data": "", "target": "close", "rfr": "", "window": ""}, "equity"),
({"data": "", "target": "high", "rfr": "0.5", "window": "250"}, "crypto"),
(
{"data": "", "target": "close", "rfr": "", "window": "", "index": "date"},
"equity",
),
(
{
"data": "",
"target": "high",
"rfr": "0.5",
"window": "250",
"index": "date",
},
"crypto",
),
],
)
@pytest.mark.integration
@@ -204,6 +216,7 @@ def test_quantitative_sharpe_ratio(params, data_type, obb):
"target_return": "",
"window": "",
"adjusted": "",
"index": "date",
},
"equity",
),
@@ -214,6 +227,7 @@ def test_quantitative_sharpe_ratio(params, data_type, obb):
"target_return": "0.5",
"window": "275",
"adjusted": "true",
"index": "date",
},
"crypto",
),
@@ -232,7 +246,7 @@ def test_quantitative_sortino_ratio(params, data_type, obb):
@parametrize(
"params, data_type",
[
({"data": "", "target": "close", "window": "220"}, "equity"),
({"data": "", "target": "close", "window": "220", "index": "date"}, "equity"),
],
)
@pytest.mark.integration
@@ -255,6 +269,7 @@ def test_quantitative_skewness(params, data_type, obb):
"target": "close",
"window": "10",
"quantile_pct": "",
"index": "date",
},
"equity",
),
@@ -264,6 +279,7 @@ def test_quantitative_skewness(params, data_type, obb):
"target": "high",
"window": "50",
"quantile_pct": "0.6",
"index": "date",
},
"crypto",
),