pyatran.runtime.setup_runtime¶
-
pyatran.runtime.setup_runtime(cfg, sciaexec, dirname=None, basepath='/tmp', clean_log=True, clean_output=True, symlink_exec=False)[source]¶ Setup a runtime directory for SCIATRAN.
This function will prepare a new runtime directory for SCIATRAN, given the configuration dict
cfg. It will perform the following steps:- create the runtime directory, if necessary
- clean the runtime directory from previous output files, if
requested by the
cleanparameter - create folders
DATA_INandDATA_OUTinside the runtime directory - copy the SCIATRAN executable
sciaexecto the runtime directory - copy all required input files (e.g., profiles, cross-sections,
…) to the folder
DATA_IN, and update the runtime configuration accordingly - create SCIATRAN parameter files from the updated runtime
configuration
cfgand store them in the runtime directory - save SCIATRAN configuration as
sciaconf.jsonin the runtime directory
Parameters: cfg : dictionary
The configuration from which the SCIATRAN parameter files (
*.inp) shall be generated.sciaexec : str
Path to the SCIATRAN executable which shall be copied to the runtime directory.
dirname : str, optional
Name of the runtime directory to be created. Defaults to a random name.
basepath : str, optional
Directory in which the runtime directory is to be created. Defaults to
/tmp.clean_log : bool, optional
If True, the
errors.logfile(s) in the runtime directory (if it exists already) will be deleted. Defaults to True.clean_output : bool, optional
If True, the contents of the
DATA_OUTdirectory inside the runtime directory, if existing, will be cleaned. Defaults to True.symlink_exec : bool, optional
If True, the SCIATRAN executable will be sym-linked into the runtime directory; if False, the file will be physically copied. Defaults to False.
Returns: runpath : str
Full path to the runtime directory created.