# libyt API ```{toctree} :hidden: yt_initialize yt_set_parameters yt_set_userparameter field/yt_get_fieldsptr yt_get_particlesptr yt_get_gridsptr yt_getgridinfo yt_commit run-python-function yt_run_interactivemode yt_run_reloadscript yt_run_jupyterkernel yt_free yt_finalize data-type ``` ## Procedure It can break down into five stages: - initialization, - loading simulation data into Python[^1], - do in situ analysis, - free resources allocated by `libyt`, - and finalization. ## libyt API
Stage |
libyt API |
Description |
|---|---|---|
| Initialization | Initialize embedded Python and import inline Python script. | |
| Loading data | Set yt parameters and user specific parameters. | |
| Get fields, particles, and grids information array (ptr), and write corresponding data in. | ||
| Tell libyt you're done. | ||
| In situ analysis | Run Python functions. | |
| Activate interactive prompt. This is only available in interactive mode. | ||
| Enter reloading script phase. This is only available in interactive mode. | ||
| Activate interactive prompt. This is only available in Jupyter kernel mode. | ||
| Reset | Free resources for in situ analysis. | |
| Finalization | Finalize libyt. |