<commit_before>package main

import "math"

func calculatePosterior(res Fingerprint, ps FullParameters) (string, map[string]float64) {
	if !ps.Loaded {
		ps, _ = openParameters(res.Group)
	}
	macs := []string{}
	W := make(map[string]int)
	for v2 := range res.WifiFingerprint {
		macs = append(macs, res.WifiFingerprint[v2].Mac)
		W[res.WifiFingerprint[v2].Mac] = res.WifiFingerprint[v2].Rssi
	}
	n, inNetworkAlready := hasNetwork(ps.NetworkMacs, macs)
	// Debug.Println(n, inNetworkAlready, ps.NetworkLocs[n])
	if !inNetworkAlready {
		Warning.Println("Not in network")
		Debug.Println(n, inNetworkAlready, ps.NetworkLocs[n], res)
	}

	PBayes1 := make(map[string]float64)<commit_msg>Fix issue #78, posterior returns immedietly with one location<commit_after>package main

import "math"

func calculatePosterior(res Fingerprint, ps FullParameters) (string, map[string]float64) {
	if !ps.Loaded {
		ps, _ = openParameters(res.Group)
	}
	macs := []string{}
	W := make(map[string]int)
	for v2 := range res.WifiFingerprint {
		macs = append(macs, res.WifiFingerprint[v2].Mac)
		W[res.WifiFingerprint[v2].Mac] = res.WifiFingerprint[v2].Rssi
	}
	n, inNetworkAlready := hasNetwork(ps.NetworkMacs, macs)
	// Debug.Println(n, inNetworkAlready, ps.NetworkLocs[n])
	if !inNetworkAlready {
		Warning.Println("Not in network")
		Debug.Println(n, inNetworkAlready, ps.NetworkLocs[n], res)
	}

	if len(ps.NetworkLocs[n]) == 1 {
		for key := range ps.NetworkLocs[n] {
			PBayesMix := make(map[string]float64)
			PBayesMix[key] = 1
			return key, PBayesMix
		}
	}

	PBayes1 := make(map[string]float64)
{'fraction_non_alphanumeric': 0.14276689829437778, 'fraction_numerical': 0.015161086544535692, 'mean_word_length': 5.211764705882353, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '171853', 'n_tokens_mistral': 652, 'n_tokens_neox': 612, 'n_words': 113}