Skip to content

Commit

Permalink
snek-ipy-load: also add np and plt variables
Browse files Browse the repository at this point in the history
  • Loading branch information
paugier committed Nov 18, 2022
1 parent 6c84fd1 commit c62b635
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/snek5000/util/console.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,13 @@ def start_ipython_load_sim():
argv = ["--matplotlib", "-i", "-c"]
code = dedent(
"""
import numpy as np
import matplotlib.pyplot as plt
from fluidsim import load
print("Loading simulation")
sim = load()
params = sim.params
print("`sim` and `params` variables are available")
print("`sim`, `params`, `np` and `plt` variables are available")
"""
)
argv.append("; ".join(code.strip().split("\n")))
Expand Down

0 comments on commit c62b635

Please sign in to comment.