Conversation
…y criteria (#27) Adds SmurfUtilMixin.keep_channels_subset, a single-call helper that disables currently-on channels in a band that fail user-supplied criteria. Filters combine with logical AND: - subbands: iterable of subband numbers to keep - freq_min_mhz / freq_max_mhz: resonator frequency band-pass - channels_to_keep: explicit allow-list (e.g. TES-like channels surviving an external analyze_iv pass) With no filters supplied the call is a no-op. Composes existing helpers (which_on, get_subband_from_channel, channel_to_freq, channel_off); no new low-level API is introduced. Mirrors the caller-supplies-the-metric pattern of turn_off_noisy_channels and check_lock.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SmurfUtilMixin.keep_channels_subset(band, subbands=None, freq_min_mhz=None, freq_max_mhz=None, channels_to_keep=None)inpython/pysmurf/client/util/smurf_util.py, sitting next toband_off/channel_off.which_on) that fail any supplied filter; filters combine with logical AND; no-op when no filters are supplied.which_on,get_subband_from_channel,channel_to_freq,channel_off); no new low-level API introduced.turn_off_noisy_channelsandcheck_lock.Closes #27.
Usage
The three examples from the original issue:
The IV/TES-quality criterion is intentionally left to the caller —
analyze_ivalready returns metrics, so policy (whichR_n/p_transis "TES-like") stays in calling code:Test plan
flake8 --count python/clean (matches CI)@set_action()decorator, and docstringpython -m py_compilecleanS.keep_channels_subset(band, subbands=range(13, 16)), verifyS.which_on(band)afterward returns only channels whoseS.get_subband_from_channel(band, ch)is in {13, 14, 15}freq_min_mhz/freq_max_mhzagainstS.channel_to_freq(band)band_off/channel_offbehavior unchanged