|
BmnRoot
|
Functions | |
| getConfigFilePath () | |
| printProgress (iteration, total, prefix='Progress:', suffix='Complete', percent_view=1) | |
| parse_name_and_write (filepath, file_type, file_name, separator, generator_type_dir, conn) | |
| recurse_path (dir_path, generator_type_dir, file_type, conn, existing_files, exist_validity) | |
Variables | |
| str | simulation_directory = "/eos/nica/bmn/sim/gen" |
| str | dst_directory = "/eos/nica/bmn/sim/dst" |
| dict | name_to_generator |
| generator_list = list(name_to_generator.values()) | |
| dict | beam_to_particle |
| dict | target_to_particle |
| dict | exclude_extensions |
| log_level = logging.INFO | |
| format | |
| datefmt | |
| filename | |
| filemode | |
| level | |
| config = json.load(open("sim_crawler.json")) | |
| conn = psycopg2.connect(("dbname=%s user=%s host=%s password=%s") % (config["db_name"], config["db_user"], config["db_host"], config["db_pass"])) | |
| cursor = conn.cursor() | |
| existing_files_full = cursor.fetchall() | |
| list | existing_files = [x[0] for x in existing_files_full] |
| list | exist_validity = [0] * len(existing_files) |
| val = len(exist_validity) | |
| sim_crawler.getConfigFilePath | ( | ) |
Definition at line 62 of file sim_crawler.py.
Referenced by parse_name_and_write().
| sim_crawler.parse_name_and_write | ( | filepath, | |
| file_type, | |||
| file_name, | |||
| separator, | |||
| generator_type_dir, | |||
| conn | |||
| ) |
Definition at line 89 of file sim_crawler.py.
References format, and getConfigFilePath().
Referenced by recurse_path().
| sim_crawler.printProgress | ( | iteration, | |
| total, | |||
prefix = 'Progress:', |
|||
suffix = 'Complete', |
|||
percent_view = 1 |
|||
| ) |
Call in a loop to create terminal progress bar
@params:
iteration - Required : current iteration (Int)
total - Required : total iterations (Int)
Definition at line 66 of file sim_crawler.py.
References format.
Referenced by recurse_path().
| sim_crawler.recurse_path | ( | dir_path, | |
| generator_type_dir, | |||
| file_type, | |||
| conn, | |||
| existing_files, | |||
| exist_validity | |||
| ) |
Definition at line 215 of file sim_crawler.py.
References format, parse_name_and_write(), printProgress(), and recurse_path().
Referenced by recurse_path().
| dict sim_crawler.beam_to_particle |
Definition at line 29 of file sim_crawler.py.
| sim_crawler.config = json.load(open("sim_crawler.json")) |
Definition at line 279 of file sim_crawler.py.
| sim_crawler.conn = psycopg2.connect(("dbname=%s user=%s host=%s password=%s") % (config["db_name"], config["db_user"], config["db_host"], config["db_pass"])) |
Definition at line 283 of file sim_crawler.py.
| sim_crawler.cursor = conn.cursor() |
Definition at line 289 of file sim_crawler.py.
| sim_crawler.datefmt |
Definition at line 276 of file sim_crawler.py.
| str sim_crawler.dst_directory = "/eos/nica/bmn/sim/dst" |
Definition at line 12 of file sim_crawler.py.
| dict sim_crawler.exclude_extensions |
Definition at line 56 of file sim_crawler.py.
| list sim_crawler.exist_validity = [0] * len(existing_files) |
Definition at line 296 of file sim_crawler.py.
| list sim_crawler.existing_files = [x[0] for x in existing_files_full] |
Definition at line 294 of file sim_crawler.py.
| sim_crawler.existing_files_full = cursor.fetchall() |
Definition at line 292 of file sim_crawler.py.
| sim_crawler.filemode |
Definition at line 276 of file sim_crawler.py.
| sim_crawler.filename |
Definition at line 276 of file sim_crawler.py.
| sim_crawler.format |
Definition at line 276 of file sim_crawler.py.
Referenced by parse_name_and_write(), printProgress(), and recurse_path().
| sim_crawler.generator_list = list(name_to_generator.values()) |
Definition at line 27 of file sim_crawler.py.
| sim_crawler.level |
Definition at line 276 of file sim_crawler.py.
| sim_crawler.log_level = logging.INFO |
Definition at line 60 of file sim_crawler.py.
| dict sim_crawler.name_to_generator |
Definition at line 16 of file sim_crawler.py.
| str sim_crawler.simulation_directory = "/eos/nica/bmn/sim/gen" |
Definition at line 11 of file sim_crawler.py.
| dict sim_crawler.target_to_particle |
Definition at line 42 of file sim_crawler.py.
| sim_crawler.val = len(exist_validity) |
Definition at line 310 of file sim_crawler.py.