BmnRoot
Loading...
Searching...
No Matches
sim_crawler Namespace Reference

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)
 

Function Documentation

◆ getConfigFilePath()

sim_crawler.getConfigFilePath ( )

Definition at line 62 of file sim_crawler.py.

Referenced by parse_name_and_write().

◆ 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().

◆ printProgress()

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().

◆ 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().

Variable Documentation

◆ beam_to_particle

dict sim_crawler.beam_to_particle
Initial value:
1= {
2 "bi": "Bi",
3 "pb": "Pb",
4 "au": "Au",
5 "xe": "Xe",
6 "ag": "Ag",
7 "kr": "Kr",
8 "ar": "Ar",
9 "c" : "C",
10 "d" : "d",
11 "p" : "p"
12}

Definition at line 29 of file sim_crawler.py.

◆ config

sim_crawler.config = json.load(open("sim_crawler.json"))

Definition at line 279 of file sim_crawler.py.

◆ conn

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.

◆ cursor

sim_crawler.cursor = conn.cursor()

Definition at line 289 of file sim_crawler.py.

◆ datefmt

sim_crawler.datefmt

Definition at line 276 of file sim_crawler.py.

◆ dst_directory

str sim_crawler.dst_directory = "/eos/nica/bmn/sim/dst"

Definition at line 12 of file sim_crawler.py.

◆ exclude_extensions

dict sim_crawler.exclude_extensions
Initial value:
1= {
2 ".out"
3}

Definition at line 56 of file sim_crawler.py.

◆ exist_validity

list sim_crawler.exist_validity = [0] * len(existing_files)

Definition at line 296 of file sim_crawler.py.

◆ existing_files

list sim_crawler.existing_files = [x[0] for x in existing_files_full]

Definition at line 294 of file sim_crawler.py.

◆ existing_files_full

sim_crawler.existing_files_full = cursor.fetchall()

Definition at line 292 of file sim_crawler.py.

◆ filemode

sim_crawler.filemode

Definition at line 276 of file sim_crawler.py.

◆ filename

sim_crawler.filename

Definition at line 276 of file sim_crawler.py.

◆ format

sim_crawler.format

Definition at line 276 of file sim_crawler.py.

Referenced by parse_name_and_write(), printProgress(), and recurse_path().

◆ generator_list

sim_crawler.generator_list = list(name_to_generator.values())

Definition at line 27 of file sim_crawler.py.

◆ level

sim_crawler.level

Definition at line 276 of file sim_crawler.py.

◆ log_level

sim_crawler.log_level = logging.INFO

Definition at line 60 of file sim_crawler.py.

◆ name_to_generator

dict sim_crawler.name_to_generator
Initial value:
1= {
2 "unigen": "UNIGEN",
3 "dcmsmm": "DCMSMM",
4 "dcm-smm": "DCMSMM",
5 "urqmd": "UrQMD",
6 "dqgsm": "DCMQGSM",
7 "dcmqgsm": "DCMQGSM",
8 "dcm-qgsm": "DCMQGSM",
9 "rqmd": "RQMD",
10 "jam": "RQMD"
11}

Definition at line 16 of file sim_crawler.py.

◆ simulation_directory

str sim_crawler.simulation_directory = "/eos/nica/bmn/sim/gen"

Definition at line 11 of file sim_crawler.py.

◆ target_to_particle

dict sim_crawler.target_to_particle
Initial value:
1= {
2 "csi": "CsI",
3 "pb": "Pb",
4 "au": "Au",
5 "cs": "Cs",
6 "xe": "Xe",
7 "sn": "Sn",
8 "ag": "Ag",
9 "cu": "Cu",
10 "al": "Al",
11 "c" : "C",
12 "p" : "p"
13}

Definition at line 42 of file sim_crawler.py.

◆ val

sim_crawler.val = len(exist_validity)

Definition at line 310 of file sim_crawler.py.