Skip to content

Commit fef7cad

Browse files
committed
cradle job
1 parent 55f61af commit fef7cad

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

book/marimo/Experiment1.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import pandas as pd
1010
import plotly.io as pio
1111
import polars as pl
12+
from cvxsimulator import interpolate
1213

1314
# Ensure Plotly works with Marimo
1415
pio.renderers.default = "plotly_mimetype"
@@ -28,7 +29,7 @@ def _():
2829
@app.cell
2930
def _():
3031
# this cell should be made obsolete by the Simulator accepting polar frames
31-
from cvx.simulator import interpolate
32+
# from cvx.simulator import interpolate
3233
# from cvx.simulator.builder import polars2pandas
3334

3435
# print(prices_pl)
@@ -38,6 +39,7 @@ def _():
3839
prices = prices_pd.apply(interpolate)
3940
# print(prices)
4041
# return
42+
return prices
4143

4244

4345
@app.function
@@ -59,14 +61,14 @@ def _():
5961

6062

6163
@app.cell
62-
def _(fast, slow):
64+
def _(fast, slow, prices):
6365
pos = 5e6 * prices.apply(f, fast=fast.value, slow=slow.value).fillna(0.0)
6466
return (pos,)
6567

6668

6769
@app.cell
68-
def _(pos):
69-
from cvx.simulator import Portfolio
70+
def _(pos, prices):
71+
from cvxsimulator import Portfolio
7072
# builder = Builder(prices=prices, initial_aum=1e8)
7173

7274
# for t, state in builder:

0 commit comments

Comments
 (0)