Skip to content

Commit 90cc7e2

Browse files
authored
Merge pull request #30 from marimo-team/aka/optimization-import-to-top
optimization: move import marimo as mo to top of notebook
2 parents b16b20d + 8646a4e commit 90cc7e2

File tree

6 files changed

+36
-36
lines changed

6 files changed

+36
-36
lines changed

optimization/01_least_squares.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313
app = marimo.App()
1414

1515

16+
@app.cell
17+
def _():
18+
import marimo as mo
19+
return (mo,)
20+
21+
1622
@app.cell(hide_code=True)
1723
def _(mo):
1824
mo.md(
@@ -113,11 +119,5 @@ def _(mo):
113119
return
114120

115121

116-
@app.cell
117-
def _():
118-
import marimo as mo
119-
return (mo,)
120-
121-
122122
if __name__ == "__main__":
123123
app.run()

optimization/02_linear_program.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@
1515
app = marimo.App()
1616

1717

18+
@app.cell
19+
def _():
20+
import marimo as mo
21+
return (mo,)
22+
23+
1824
@app.cell(hide_code=True)
1925
def _(mo):
2026
mo.md(
@@ -259,11 +265,5 @@ def _(mo, prob, x):
259265
return
260266

261267

262-
@app.cell
263-
def _():
264-
import marimo as mo
265-
return (mo,)
266-
267-
268268
if __name__ == "__main__":
269269
app.run()

optimization/04_quadratic_program.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@
1515
app = marimo.App()
1616

1717

18+
@app.cell
19+
def _():
20+
import marimo as mo
21+
return (mo,)
22+
23+
1824
@app.cell(hide_code=True)
1925
def _(mo):
2026
mo.md(
@@ -255,11 +261,5 @@ def plot_contours(P, G, h, q, x_star):
255261
return (plot_contours,)
256262

257263

258-
@app.cell
259-
def _():
260-
import marimo as mo
261-
return (mo,)
262-
263-
264264
if __name__ == "__main__":
265265
app.run()

optimization/05_portfolio_optimization.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@
1616
app = marimo.App()
1717

1818

19+
@app.cell
20+
def _():
21+
import marimo as mo
22+
return (mo,)
23+
24+
1925
@app.cell(hide_code=True)
2026
def _(mo):
2127
mo.md(r"""# Portfolio optimization""")
@@ -247,11 +253,5 @@ def _(gamma, gamma_vals, markers_on, np, plt, prob, ret, risk):
247253
return midx, spstats, x
248254

249255

250-
@app.cell
251-
def _():
252-
import marimo as mo
253-
return (mo,)
254-
255-
256256
if __name__ == "__main__":
257257
app.run()

optimization/06_convex_optimization.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313
app = marimo.App()
1414

1515

16+
@app.cell
17+
def _():
18+
import marimo as mo
19+
return (mo,)
20+
21+
1622
@app.cell(hide_code=True)
1723
def _(mo):
1824
mo.md(
@@ -80,11 +86,5 @@ def _(x):
8086
return
8187

8288

83-
@app.cell
84-
def _():
85-
import marimo as mo
86-
return (mo,)
87-
88-
8989
if __name__ == "__main__":
9090
app.run()

optimization/07_sdp.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@
1414
app = marimo.App()
1515

1616

17+
@app.cell
18+
def _():
19+
import marimo as mo
20+
return (mo,)
21+
22+
1723
@app.cell(hide_code=True)
1824
def _(mo):
1925
mo.md(r"""# Semidefinite program""")
@@ -118,11 +124,5 @@ def _():
118124
return (wigglystuff,)
119125

120126

121-
@app.cell
122-
def _():
123-
import marimo as mo
124-
return (mo,)
125-
126-
127127
if __name__ == "__main__":
128128
app.run()

0 commit comments

Comments
 (0)