sim_utils
utils.sim_utils
            NSTAT_MATCH
  
      module-attribute
  
NSTAT_MATCH = 'NSTAT\\s*\\d*\\s*\\d*'
JSON_TYPE
              Bases: Enum
Class defining custom JSON types
Source code in yaptide/utils/sim_utils.py
                39 40 41 42 43  |  | 
            Editor
  
      class-attribute
      instance-attribute
  
Editor = auto()
            Files
  
      class-attribute
      instance-attribute
  
Files = auto()
adjust_primaries_for_fluka_files
adjust_primaries_for_fluka_files(
    payload_files_dict, ntasks=None
)
Adjusts number of primaries in *.inp file for FLUKA
Source code in yaptide/utils/sim_utils.py
              141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166  |  | 
adjust_primaries_for_shieldhit_files
adjust_primaries_for_shieldhit_files(
    payload_files_dict, ntasks=None
)
Adjusts number of primaries in beam.dat file for SHIELD-HIT12A
Source code in yaptide/utils/sim_utils.py
              116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138  |  | 
adjust_primaries_in_editor_dict
adjust_primaries_in_editor_dict(
    payload_editor_dict, ntasks=None
)
Replaces number of primaries in payload_editor_dict
if ntasks parameter is provided, it is used over one
provided in payload_editor_dict
Source code in yaptide/utils/sim_utils.py
              78 79 80 81 82 83 84 85 86 87 88 89 90 91 92  |  | 
adjust_primaries_in_files_dict
adjust_primaries_in_files_dict(
    payload_files_dict, ntasks=None
)
Replaces number of primaries in payload_files_dict
if ntasks parameter is provided, it is used over one
provided in payload_files_dict
Source code in yaptide/utils/sim_utils.py
              95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113  |  | 
check_and_convert_payload_to_files_dict
check_and_convert_payload_to_files_dict(payload_dict)
Convert payload data to dictionary with filenames and contents for Editor type projects Otherwise return empty dictionary
Source code in yaptide/utils/sim_utils.py
              63 64 65 66 67 68 69 70 71 72 73 74 75  |  | 
convert_editor_dict_to_files_dict
convert_editor_dict_to_files_dict(editor_dict, parser_type)
Convert payload data to dictionary with filenames and contents for Editor type projects Otherwise return empty dictionary
Source code in yaptide/utils/sim_utils.py
              53 54 55 56 57 58 59 60  |  | 
estimators_to_list
estimators_to_list(estimators_dict, dir_path)
Convert simulation output to JSON dictionary representation (to be consumed by UI)
Source code in yaptide/utils/sim_utils.py
              16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36  |  | 
files_dict_with_adjusted_primaries
files_dict_with_adjusted_primaries(
    payload_dict, ntasks=None
)
Replaces number of primaries in payload_dict
if ntasks parameter is provided, it is used over one
provided in payload_dict
returns dict with input files and full number of requested primaries
Source code in yaptide/utils/sim_utils.py
              169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186  |  | 
get_json_type
get_json_type(payload_dict)
Returns type of provided JSON
Source code in yaptide/utils/sim_utils.py
              46 47 48 49 50  |  | 
simulation_input_files
simulation_input_files(path)
Function returning a dictionary with simulation input filenames as keys and their content as values
Source code in yaptide/utils/sim_utils.py
              208 209 210 211 212 213 214 215 216 217 218  |  | 
simulation_logfiles
simulation_logfiles(path)
Function returning simulation logfile
Source code in yaptide/utils/sim_utils.py
              196 197 198 199 200 201 202 203 204 205  |  | 
write_simulation_input_files
write_simulation_input_files(files_dict, output_dir)
Save files from provided dict (filenames as keys and content as values) into the provided directory
Source code in yaptide/utils/sim_utils.py
              189 190 191 192 193  |  |