Fixed issue in combine_samples
@@ -317,6 +317,7 @@ def madminer_event_loader(
this_weights = np.array(weights[current:this_end, benchmark_filter])
# Only return data matching sampling_benchmark
+ this_sampling_ids = None
if sampling_benchmark is not None and sampling_ids is not None:
this_sampling_ids = np.array(sampling_ids[current:this_end])
@@ -337,6 +338,7 @@ def madminer_event_loader(
if len(this_observations) > 0:
if return_sampling_ids:
yield (this_observations, this_weights, this_sampling_ids)
+ else:
yield (this_observations, this_weights)
current += batch_size
@@ -399,6 +401,7 @@ def save_preformatted_events_to_madminer_file(
# Save data
f.create_dataset("samples/weights", data=weights)
f.create_dataset("samples/observations", data=observations)
+ if sampling_benchmarks is not None:
f.create_dataset("samples/sampling_benchmarks", data=sampling_benchmarks)
