>>> if a == "something":
... print("run somthing")
TODOs
Problems
[x] Scope problem: originally, every inline function are done in inline script's namespace. When we dynamically load and update these functions, we are in global namespace, but we need to be in module's namespace.
Possible solution:
[x] use inline_script namespace, for every input from user.
[x] use exec and pass in sys.modules["inline_script"].__dict__
[ ] yt.enable_parallelism() might run multiple times, if reloading script does not set correctly.
It's OK to run multiple times, but it's waste of time to do this.
Reload/Refresh Inline Script During Runtime
We might want to analyze the data dynamically and get the response from the inline analysis directly, just like using
ipython
during runtime.Features
Enhancement
~- [ ] Colorful python prompt terminal~ ~- [ ] Indent~
Working Procedure
When to enter and exit interactive mode
try
--> stop if it goes wrongLIBYT_STOP
file --> stop if detectedIn interactive mode
>>>
:TODOs
Problems
inline_script
namespace, for every input from user.exec
and pass insys.modules["inline_script"].__dict__
yt.enable_parallelism()
might run multiple times, if reloading script does not set correctly.ncurses
~ ~- [ ] Erase the current printed console line and To input up arrow key~Makefile
INTERACTIVE_MODE
~- [ ] CleanerMakefile
.~yt Finalize
Try, Except, Finally
try
: execute inline scriptexcept
: only root prints full traceback msg, the other ranks prints no error msg.yt_interactive_mode
.finally
: sync status?%libyt exit
for exit. (temp)libyt command
%libyt
, like%libyt ...
%libyt exit
: exit interactive mode, and enter next iteration of simulation.Tests