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:

  1. create the runtime directory, if necessary
  2. clean the runtime directory from previous output files, if requested by the clean parameter
  3. create folders DATA_IN and DATA_OUT inside the runtime directory
  4. copy the SCIATRAN executable sciaexec to the runtime directory
  5. copy all required input files (e.g., profiles, cross-sections, …) to the folder DATA_IN, and update the runtime configuration accordingly
  6. create SCIATRAN parameter files from the updated runtime configuration cfg and store them in the runtime directory
  7. save SCIATRAN configuration as sciaconf.json in 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.log file(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_OUT directory 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.