def get_n_runs(slurm_array_file):
    """Reads the run.sh file to figure out how many conformers or rotors were meant to run
    """
    with open(slurm_array_file, 'r') as f:
        for line in f:
            if 'SBATCH --array=' in line:
                token = line.split('-')[-1]
                n_runs = 1 + int(token.split('%')[0])
                return n_runs
    return 0