Operating Modes
rappture2web supports two operating modes for running tool simulations.
Classic mode (default)
In classic mode:
User fills in inputs and clicks Simulate
rappture2web creates a
driver.xmlwith the input valuesThe tool command runs as a subprocess:
python script.py driver.xmlThe script reads
driver.xml, computes, and writesrun.xmlrappture2web parses
run.xmland displays the outputs
This mode is compatible with any Rappture tool — including tools written in TCL, Fortran, C, or Python 2 — because it uses the standard Rappture file I/O protocol.
rappture2web /path/to/tool/
Library mode
In library mode:
The tool script receives the server URL as
sys.argv[1]rp_libraryreads inputs viaGET /api/inputsEach
rx['output...'] = valuecall streams the output to the browser in real time viaPOST /api/outputrx.close()signals completion
This mode requires the tool script to use rappture2web.rp_library:
import rappture2web.rp_library as Rappture
Enable with:
rappture2web /path/to/tool/ --library-mode
Advantages of library mode:
Live streaming: outputs appear in the browser as they are computed
Progress updates:
Rappture.Utils.progress(pct, msg)shows in the UINo file I/O: no driver.xml or run.xml on disk
Choosing a mode
Criterion |
Classic mode |
Library mode |
|---|---|---|
Tool language |
Any (TCL, Python 2/3, C, Fortran) |
Python 3 only |
Output streaming |
After completion |
Real-time |
Progress bar |
Not supported |
Supported |
NanoHUB compatibility |
Full (uses native Rappture) |
Requires |
UQ support |
Yes |
Yes |