Skip to content
10 changes: 6 additions & 4 deletions pisa/core/container.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,12 @@ def link_containers(self, key, names):
% (set(names) - set(self.names))
)
containers = [self.__getitem__(name) for name in link_names]
logging.trace('Linking containers %s into %s'%(link_names, key))
new_container = VirtualContainer(key, containers)
self.linked_containers.append(new_container)

if len(containers) > 0:
logging.trace('Linking containers %s into %s'%(link_names, key))
new_container = VirtualContainer(key, containers)
self.linked_containers.append(new_container)
else:
logging.warning("None of the containers exist, skipping %s"%(key))

def unlink_containers(self):
"""Unlink all container"""
Expand Down
1 change: 1 addition & 0 deletions pisa/core/map.py
Original file line number Diff line number Diff line change
Expand Up @@ -1217,6 +1217,7 @@ def fluctuate(self, method, random_state=None, jumpahead=None):
loc=orig_hist[valid_mask], scale=sigma[valid_mask],
random_state=random_state
)
gauss = np.clip(gauss, a_min=0, a_max=None)

hist_vals = np.empty_like(orig_hist, dtype=np.float64)
hist_vals[valid_mask] = poisson.rvs(
Expand Down
3 changes: 3 additions & 0 deletions pisa/stages/utils/kde.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ def __init__(
coszen_name="reco_coszen",
oversample=10,
coszen_reflection=0.25,
adaptive=True,
alpha=0.1,
stack_pid=True,
stash_hists=False,
Expand All @@ -70,6 +71,7 @@ def __init__(
self.oversample = int(oversample)
self.coszen_reflection = float(coszen_reflection)
self.alpha = float(alpha)
self.adaptive = adaptive
self.stack_pid = stack_pid
self.stash_hists = stash_hists
self.stash_valid = False
Expand Down Expand Up @@ -185,6 +187,7 @@ def apply_function(self):
bw_method=self.bw_method,
coszen_name=self.coszen_name,
coszen_reflection=self.coszen_reflection,
adaptive=self.adaptive,
alpha=self.alpha,
oversample=self.oversample,
use_cuda=False,
Expand Down