icecube / pisa

Monte Carlo-based data analysis
http://icecube.github.io/pisa/
Apache License 2.0
19 stars 47 forks source link

Non-list metrics in analysis.py #667

Closed mvprado0 closed 3 years ago

mvprado0 commented 3 years ago

Whenever the user inputs any metric as a string rather than a list, the metric is taken as metric[0] whenever choosing between the maximum or minimum for the best fit. In this case, it will only grab the first letter of the string and convert it. In some cases, it will convert it incorrectly. For example: Whenever inputting any 'LLH' related metric as a string, it will not be found in METRICS_TO_MAXIMIZE. From the function _fit_grid_scan: if metric[0] in METRICS_TO_MAXIMIZE: best_idx = np.argmax(all_fit_metric_vals) best_idx_grid = np.unravel_index(best_idx, all_fit_metric_vals.shape) else: best_idx = np.argmin(all_fit_metric_vals) best_idx_grid = np.unravel_index(best_idx, all_fit_metric_vals.shape)

philippeller commented 3 years ago

we should then convert this for strings into a 1-element list. Would you care making an according PR fixing this?

mvprado0 commented 3 years ago

Sure