3.1.2.12. opengate.helpers

3.1.2.12.1. Module Contents

3.1.2.12.1.1. Functions

fatal(s)

warning(s)

raise_except(s)

assert_equal_dic(d1, d2[, name])

g4_units(→ float)

g4_best_unit(value, unit_type)

assert_key(key, d)

assert_keys(keys, d)

indent(amount, text[, ch])

Prefix the text with indent spaces

assert_unique_element_name(elements, name)

make_builders(class_names)

Consider a list of Classname. For each, it build a key/value, with:

read_mac_file_to_commands(filename)

check_filename_type(filename)

get_random_folder_name([size, create])

import_gaga_phsp()

import_garf()

get_rnd_seed(seed)

DDF()

Debug print current Function name

DD(arg)

Debug print variable name and its value

print_dic(dic)

print_opengate_info()

Print information about OpenGate and the environment

3.1.2.12.1.2. Attributes

color_error

color_warning

color_ok

opengate.helpers.color_error[source]
opengate.helpers.color_warning[source]
opengate.helpers.color_ok[source]
opengate.helpers.fatal(s)[source]
opengate.helpers.warning(s)[source]
opengate.helpers.raise_except(s)[source]
opengate.helpers.assert_equal_dic(d1, d2, name='')[source]
opengate.helpers.g4_units(name: str) float[source]
opengate.helpers.g4_best_unit(value, unit_type)[source]
opengate.helpers.assert_key(key: str, d: box.Box)[source]
opengate.helpers.assert_keys(keys: list, d: box.Box)[source]
opengate.helpers.indent(amount, text, ch=' ')[source]

Prefix the text with indent spaces https://stackoverflow.com/questions/8234274/how-to-indent-the-contents-of-a-multi-line-string

opengate.helpers.assert_unique_element_name(elements, name)[source]
opengate.helpers.make_builders(class_names)[source]

Consider a list of Classname. For each, it build a key/value, with: - the type of the class as key - and a lambda function that create an object of this class as value

opengate.helpers.read_mac_file_to_commands(filename)[source]
opengate.helpers.check_filename_type(filename)[source]
opengate.helpers.get_random_folder_name(size=8, create=True)[source]
opengate.helpers.import_gaga_phsp()[source]
opengate.helpers.import_garf()[source]
opengate.helpers.get_rnd_seed(seed)[source]
opengate.helpers.DDF()[source]

Debug print current Function name

opengate.helpers.DD(arg)[source]

Debug print variable name and its value

opengate.helpers.print_dic(dic)[source]
opengate.helpers.print_opengate_info()[source]

Print information about OpenGate and the environment