opengate.utility ================ .. py:module:: opengate.utility Attributes ---------- .. autoapisummary:: opengate.utility.g4_units Functions --------- .. autoapisummary:: opengate.utility.assert_equal_dic opengate.utility.ensure_directory_exists opengate.utility.get_material_name_variants opengate.utility.g4_best_unit opengate.utility.assert_key opengate.utility.assert_keys opengate.utility.indent opengate.utility.assert_unique_element_name opengate.utility.make_builders opengate.utility.read_mac_file_to_commands opengate.utility.ensure_filename_is_str opengate.utility.get_random_folder_name opengate.utility.get_rnd_seed opengate.utility.DDF opengate.utility.DD opengate.utility.print_dic opengate.utility.get_release_date opengate.utility.print_opengate_info Module Contents --------------- .. py:function:: assert_equal_dic(d1, d2, name='') .. py:function:: ensure_directory_exists(directory) .. py:data:: g4_units .. py:function:: get_material_name_variants(material_name) Get different variants of a material name, e.g. with/without prepended G4_, only first letter capital. Intended to bridge inconsistencies in naming conventions. .. py:function:: g4_best_unit(value, unit_type) .. py:function:: assert_key(key: str, d: box.Box) .. py:function:: assert_keys(keys: list, d: box.Box) .. py:function:: indent(amount, text, ch=' ') Prefix the text with indent spaces https://stackoverflow.com/questions/8234274/how-to-indent-the-contents-of-a-multi-line-string .. py:function:: assert_unique_element_name(elements, name) .. py:function:: make_builders(class_names) 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 .. py:function:: read_mac_file_to_commands(filename) .. py:function:: ensure_filename_is_str(filename) .. py:function:: get_random_folder_name(size=8, create=True) .. py:function:: get_rnd_seed(seed) .. py:function:: DDF() Debug print current Function name .. py:function:: DD(arg) Debug print variable name and its value .. py:function:: print_dic(dic) .. py:function:: get_release_date(opengate_version) .. py:function:: print_opengate_info() Print information about OpenGate and the environment