Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace hyperrun with superrun #99

Merged
merged 4 commits into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions axidence/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
}


allow_hyperrun_suffix = ["Paired"]
allow_superrun_suffix = ["Paired"]


default_assign_appended_attributes: dict = {}
Expand Down Expand Up @@ -155,8 +155,8 @@ def assign_plugin_attributes(
if hasattr(old_instance, "loop_over"):
new_plugin.loop_over = old_instance.loop_over + snake

if suffix in allow_hyperrun_suffix:
new_plugin.allow_hyperrun = True
if suffix in allow_superrun_suffix and new_plugin.depends_on:
new_plugin.allow_superrun = True

return new_plugin

Expand Down
2 changes: 1 addition & 1 deletion axidence/plugins/cuts/cut_pairing_exists.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class PairingExists(CutPlugin):
cut_description = (
"Whether isolated S2 influenced by pairing, and whether the event is considered as AC event"
)
allow_hyperrun = True
allow_superrun = True

def cut_by(self, events_paired):
return np.isin(events_paired["event_type"], [1, 3])
4 changes: 2 additions & 2 deletions axidence/plugins/pairing/events_paired.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class EventsForcePaired(OverlapWindowPlugin):
provides = "events_paired"
data_kind = "events_paired"
save_when = strax.SaveWhen.EXPLICIT
allow_hyperrun = True
allow_superrun = True

paring_time_interval = straxen.URLConfig(
default=int(1e8),
Expand Down Expand Up @@ -58,7 +58,7 @@ class EventInfosPaired(Events):
provides = "event_infos_paired"
data_kind = "events_paired"
save_when = strax.SaveWhen.EXPLICIT
allow_hyperrun = True
allow_superrun = True

ambience_fields = straxen.URLConfig(
default=["lh_before", "s0_before", "s1_before", "s2_before", "s2_near"],
Expand Down
8 changes: 4 additions & 4 deletions axidence/plugins/pairing/peaks_paired.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class PeaksPaired(ExhaustPlugin, DownChunkingPlugin):
data_kind = immutabledict(zip(provides, provides))
save_when = immutabledict(zip(provides, [strax.SaveWhen.EXPLICIT, strax.SaveWhen.ALWAYS]))
rechunk_on_save = immutabledict(zip(provides, [False, True]))
allow_hyperrun = True
allow_superrun = True

pairing_seed = straxen.URLConfig(
default=None,
Expand Down Expand Up @@ -261,7 +261,7 @@ def digitize2d(data_sample, bin_edges, n_bins):
data_sample: array, data waiting for binning
"""
digit = np.zeros(len(data_sample), dtype=int)
# `x_dig` is within [0, len(bin_edges[0])-1]
# `x_dig` is within [0, len(bin_edges[0]) - 1]
x_dig = np.digitize(data_sample[:, 0], bin_edges[0][1:])
for xd in np.unique(x_dig):
digit[x_dig == xd] = (
Expand Down Expand Up @@ -726,7 +726,7 @@ class PeakProximityPaired(PeakProximity):
provides = "peak_proximity_paired"
data_kind = "peaks_paired"
save_when = strax.SaveWhen.EXPLICIT
allow_hyperrun = True
allow_superrun = True

use_origin_n_competing = straxen.URLConfig(
default=False,
Expand Down Expand Up @@ -786,7 +786,7 @@ class PeakPositionsPaired(Plugin):
depends_on = "peaks_paired"
provides = "peak_positions_paired"
save_when = strax.SaveWhen.EXPLICIT
allow_hyperrun = True
allow_superrun = True

def infer_dtype(self):
return peak_positions_dtype()
Expand Down
4 changes: 2 additions & 2 deletions tests/test_pairing.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def setUpClass(cls) -> None:

def test_pairing(self):
"""Test the computing of pairing plugins."""
hyperrun_name = "__" + self.run_id
superrun_name = "_" + self.run_id
subrun_ids = [self.run_id]
data_type = "event_basics"
self.st.make(self.run_id, data_type, save=data_type)
Expand All @@ -41,7 +41,7 @@ def test_pairing(self):
meta["start"],
meta["end"],
)
self.st.define_run(hyperrun_name, subrun_ids)
self.st.define_run(superrun_name, subrun_ids)
self.st.check_superrun()
plugins = [
"peaks_paired",
Expand Down
Loading