Skip to content

Commit

Permalink
revert: optimizer tests
Browse files Browse the repository at this point in the history
  • Loading branch information
platonfloria committed May 9, 2024
1 parent 24e6f0e commit cd41774
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 141 deletions.
12 changes: 0 additions & 12 deletions resources/NBTest/NBTest_002_CPCandOptimizer.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2732,8 +2732,6 @@
"r = O.margp_optimizer(\"WETH\", result=O.MO_DEBUG)\n",
"assert isinstance(r, dict)\n",
"prices0 = r[\"price_estimates_t\"]\n",
"dtknfromp_f = r[\"dtknfromp_f\"]\n",
"assert np.linalg.norm(dtknfromp_f(np.log10(prices0))) < 1e-6\n",
"assert not prices0 is None, f\"prices0 must not be None [{prices0}]\"\n",
"r1 = O.arb(\"WETH\")\n",
"r2 = O.SelfFinancingConstraints.arb(\"WETH\")\n",
Expand Down Expand Up @@ -2794,16 +2792,6 @@
"prices0"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "30424c63",
"metadata": {},
"outputs": [],
"source": [
"dtknfromp_f(np.log10(prices0))"
]
},
{
"cell_type": "code",
"execution_count": 115,
Expand Down
4 changes: 0 additions & 4 deletions resources/NBTest/NBTest_002_CPCandOptimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1278,8 +1278,6 @@
r = O.margp_optimizer("WETH", result=O.MO_DEBUG)
assert isinstance(r, dict)
prices0 = r["price_estimates_t"]
dtknfromp_f = r["dtknfromp_f"]
assert np.linalg.norm(dtknfromp_f(np.log10(prices0))) < 1e-6
assert not prices0 is None, f"prices0 must not be None [{prices0}]"
r1 = O.arb("WETH")
r2 = O.SelfFinancingConstraints.arb("WETH")
Expand All @@ -1293,8 +1291,6 @@

prices0

dtknfromp_f(np.log10(prices0))

f = O.optimize("WETH", result=O.MO_DTKNFROMPF, params=dict(verbose=True, debug=False))
r3 = f(prices0, islog10=False)
assert np.all(r3 == (0,0))
Expand Down
Loading

0 comments on commit cd41774

Please sign in to comment.