mcstasscript.interface.functions.Configurator
mcstasscript.interface.functions.Configurator¶
- class mcstasscript.interface.functions.Configurator(*args)¶
Class for setting the configuration file for McStasScript.
- configuration_file_name¶
absolute path of configuration file
- Type
str
- set_mcstas_path(string)¶
sets mcstas path
- set_mcrun_path(string)¶
sets mcrun path
- set_mcxtrace_path(string)¶
sets mcxtrace path
- set_mxrun_path(string)¶
sets mxrun path
- set_line_length(int)¶
sets maximum line length to given int
- _write_yaml(dict)¶
internal method, writes a configuration yaml file with dict content
- _read_yaml()¶
internal method, reads a configuration yaml file and returns a dict
- _create_new_config_file()¶
internal method, creates default configuration file
- __init__(*args)¶
Initialization of configurator, checks that the configuration file actually exists, and if it does not, creates a default configuration file.
- Parameters
name ((optional) custom) – Custom name for configuration file for testing purposes
Methods
__init__
(*args)Initialization of configurator, checks that the configuration file actually exists, and if it does not, creates a default configuration file.
set_line_length
(line_length)Sets maximum line length for output
set_mcrun_path
(path)Sets the path to mcrun
set_mcstas_path
(path)Sets the path to McStas
set_mcxtrace_path
(path)Sets the path to McXtrace
set_mxrun_path
(path)Sets the path to mxrun
- set_line_length(line_length)¶
Sets maximum line length for output
- Parameters
line_length (int) – maximum line length for output
- set_mcrun_path(path)¶
Sets the path to mcrun
- Parameters
path (str) – Path to the mcrun executable
- set_mcstas_path(path)¶
Sets the path to McStas
- Parameters
path (str) – Path to the mcstas directory containing “sources”, “optics”, …
- set_mcxtrace_path(path)¶
Sets the path to McXtrace
- Parameters
path (str) – Path to the mcxtrace directory containing “sources”, “optics”, …
- set_mxrun_path(path)¶
Sets the path to mxrun
- Parameters
path (str) – Path to the mxrun executable