def fixed_params_from_fname(fname):
    """
    Gets path to avg result data file and returns fixed params for which simulation was run.
    
    :param fname: path to the averaged simulation results
    :type fname: str
    :return: fixed params of simulation which produced that result. Result is a dictionary in which:
        key: name of parameter
        val: value of that parameter
    :rtype: dict
    """
    
    # from file path get folder name which describes fixed params of saved simulation result
    new = fname[fname.find('Runs'):]
    new = new[:new.find('/')]
    
    new_list = new.split(sep='___')
    new_new_list = []
    for i, param in enumerate(new_list):
        if 'Beta_mortality_pair=' in param:
            beta = float(param[param.find('=(') + 2: param.find(', ')])
            mortality = float(param[param.find(', ') + 2: param.find(')')])
            
            new_new_list.extend((f'beta={beta}', f'mortality={mortality}'))
        elif 'Num_of_infected_cashiers_at_start=' in param:
            infected_at_start = int(param[param.find('=') + 1:])
            new_new_list.append(f'Infected cashiers at start={infected_at_start}')
        
        elif 'Infect_housemates_boolean=' in param:
            new_new_list.append(new_list[i].replace("Infect_housemates_boolean=", "Infect housemates="))
        
        else:
            new_new_list.append(new_list[i].replace('_', ' '))
    
    my_dict = {}
    for param in new_new_list:
        key = param[: param.find('=')]
        if key == 'Grid_size':
            key = 'Grid size'
        val = param[param.find('=') + 1:]
        my_dict[key] = val
    
    return my_dict