Skip to content

Commit

Permalink
Fix priors bug in pad_simulation_labels (#45)
Browse files Browse the repository at this point in the history
Co-authored-by: Jonathan de Bruin <[email protected]>
  • Loading branch information
PeterLombaers and J535D165 authored Dec 9, 2022
1 parent d9f865c commit 0676ca0
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions asreviewcontrib/insights/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,14 @@ def pad_simulation_labels(state_obj, priors=False):
# get the labels
labels = state_obj.get_labels(priors=priors).to_list()

if not priors:
n_used_records = n_records - state_obj.n_priors
else:
n_used_records = n_records

# if less labels than records, check if all labels available
if len(labels) < n_records:
if len(labels) < n_used_records:

labels = labels + np.zeros(n_records - len(labels)).tolist()
labels = labels + np.zeros(n_used_records - len(labels)).tolist()

return labels

0 comments on commit 0676ca0

Please sign in to comment.