added error catching for no cands
This commit is contained in:
parent
7490569987
commit
918e026f55
|
@ -13,9 +13,12 @@ def process(directory):
|
|||
dirname = os.path.basename(subdir)
|
||||
if dirname == '':
|
||||
dirname = os.path.basename(os.path.dirname(subdir))
|
||||
mainCSV = pd.read_csv(os.path.join(subdir, f"{dirname}.csv"))
|
||||
candCSV = pd.read_csv(os.path.join(subdir, "cands","results_a.csv"))
|
||||
merge(mainCSV, candCSV, os.path.join(subdir, f"{dirname}_merged.csv"))
|
||||
try:
|
||||
mainCSV = pd.read_csv(os.path.join(subdir, f"{dirname}.csv"))
|
||||
candCSV = pd.read_csv(os.path.join(subdir, "cands","results_a.csv"))
|
||||
merge(mainCSV, candCSV, os.path.join(subdir, f"{dirname}_merged.csv"))
|
||||
except FileNotFoundError:
|
||||
logger.error(f"{dirname} has no candidates!")
|
||||
|
||||
def merge(mainDF:pd.DataFrame, candDF:pd.DataFrame, outname):
|
||||
#add new columns to main dataframe
|
||||
|
|
Loading…
Reference in a new issue