From b010b39e8a3a35221c72621f6d0223f27270fd93 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 11 May 2026 20:45:29 +0000 Subject: [PATCH 1/2] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/pre-commit-hooks: v5.0.0 → v6.0.0](https://github.com/pre-commit/pre-commit-hooks/compare/v5.0.0...v6.0.0) - https://github.com/psf/black → https://github.com/psf/black-pre-commit-mirror - [github.com/psf/black-pre-commit-mirror: 24.10.0 → 26.3.1](https://github.com/psf/black-pre-commit-mirror/compare/24.10.0...26.3.1) - [github.com/pycqa/docformatter: v1.7.6 → v1.7.8](https://github.com/pycqa/docformatter/compare/v1.7.6...v1.7.8) - [github.com/pre-commit/mirrors-mypy: v1.11.2 → v2.0.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.11.2...v2.0.0) - [github.com/pycqa/flake8: 7.1.1 → 7.3.0](https://github.com/pycqa/flake8/compare/7.1.1...7.3.0) --- .pre-commit-config.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e884a0ae5..68ecf4775 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,29 +2,29 @@ # See https://pre-commit.com/hooks.html for more hooks repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v5.0.0 + rev: v6.0.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer - id: check-yaml - id: check-added-large-files -- repo: https://github.com/psf/black - rev: 24.10.0 +- repo: https://github.com/psf/black-pre-commit-mirror + rev: 26.3.1 hooks: - id: black args: [--safe, --line-length=100, --preview] language_version: python3 - repo: https://github.com/pycqa/docformatter - rev: v1.7.6 + rev: v1.7.8 hooks: - id: docformatter additional_dependencies: [tomli] args: [--config, pyproject.toml] - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.11.2 + rev: v2.0.0 hooks: - id: mypy additional_dependencies: [ @@ -33,7 +33,7 @@ repos: ] - repo: https://github.com/pycqa/flake8 - rev: 7.1.1 + rev: 7.3.0 hooks: - id: flake8 From a6a47cef596dfc12cb718c0fee73658b216d071a Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 11 May 2026 20:45:45 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- strax/context.py | 33 ++++++++++++++-------------- strax/dtypes.py | 14 ++++++------ strax/plugins/plugin.py | 5 +++-- strax/processing/general.py | 10 +++++---- strax/processing/hitlets.py | 9 ++++---- strax/processing/peak_building.py | 19 +++++++++------- strax/processing/peak_merging.py | 1 - strax/processing/peak_properties.py | 5 ++--- strax/processing/pulse_processing.py | 20 ++++++++++------- strax/run_selection.py | 12 +++++----- strax/storage/common.py | 12 +++++----- strax/storage/files.py | 4 ++-- strax/storage/mongo.py | 12 +++++----- strax/utils.py | 7 +++--- tests/test_context.py | 6 +++-- tests/test_hitlet.py | 1 - tests/test_loop_plugins.py | 6 ++--- tests/test_peak_processing.py | 1 - tests/test_storage.py | 5 ++--- tests/test_superruns.py | 2 -- tests/test_utils.py | 23 +++++++++++-------- 21 files changed, 107 insertions(+), 100 deletions(-) diff --git a/strax/context.py b/strax/context.py index 08217055e..6e0272a98 100644 --- a/strax/context.py +++ b/strax/context.py @@ -18,7 +18,6 @@ import strax from strax import CutList - export, __all__ = strax.exporter() __all__.extend(["RUN_DEFAULTS_KEY"]) @@ -1460,8 +1459,9 @@ def _add_saver( target_plugin: strax.Plugin, combining: bool = False, ): - """Adds savers to already existing savers. Checks if data_type can be stored in any storage - frontend. + """Adds savers to already existing savers. + + Checks if data_type can be stored in any storage frontend. :param savers: Dictionary of already existing savers. :param d_to_save: String of the data_type to be saved. @@ -1576,7 +1576,6 @@ def to_absolute_time_range( :param full_range: If True returns full time_range of the run. """ - selection = ( (time_range is None) + (seconds_range is None) @@ -1624,9 +1623,8 @@ def get_iter( ) -> ty.Iterator[strax.Chunk]: """Compute target for run_id and iterate over results. - Do NOT interrupt the iterator (i.e. break): it will keep running stuff - in background threads... - {get_docs} + Do NOT interrupt the iterator (i.e. break): it will keep running stuff in background + threads... {get_docs} """ if hasattr(run_id, "decode"): @@ -1837,9 +1835,9 @@ def make( combining=False, **kwargs, ) -> None: - """Compute target for run_id. Returns nothing (None). + """Compute target for run_id. - {get_docs} + Returns nothing (None). {get_docs} """ kwargs.setdefault("progress_bar", False) @@ -2035,9 +2033,11 @@ def get_zarr( overwrite=True, **kwargs, ): - """Get persistent arrays using zarr. This is useful when loading large amounts of data that - cannot fit in memory zarr is very compatible with dask. Targets are loaded into separate - arrays and runs are merged. the data is added to any existing data in the storage location. + """Get persistent arrays using zarr. + + This is useful when loading large amounts of data that cannot fit in memory zarr is very + compatible with dask. Targets are loaded into separate arrays and runs are merged. the data + is added to any existing data in the storage location. :param run_ids: (Iterable) run ids you wish to load. :param targets: (Iterable) targets to load. @@ -2087,9 +2087,10 @@ def get_zarr( return group def key_for(self, run_id, target, chunk_number=None, combining=False): - """Get the DataKey for a given run and a given target plugin. The DataKey is inferred from - the plugin lineage. The lineage can come either from the _fixed_plugin_cache or computed on - the fly. + """Get the DataKey for a given run and a given target plugin. + + The DataKey is inferred from the plugin lineage. The lineage can come either from the + _fixed_plugin_cache or computed on the fly. :param run_id: run id to get :param target: data type to get @@ -2510,7 +2511,6 @@ def merge_per_chunk_storage( check_is_stored: bool = True, ): """Merge the per-chunked data from the per-chunked dependency into the target storage.""" - if check_is_stored and self.is_stored(run_id, target): raise ValueError(f"Data {target} for {run_id} already exists.") @@ -2894,7 +2894,6 @@ def tree_levels(self): 'class': 'Peaks', 'index': 0, 'order': 1}} """ - context_hash = self._context_hash() if self._fixed_level_cache is not None and context_hash in self._fixed_level_cache: return self._fixed_level_cache[context_hash] diff --git a/strax/dtypes.py b/strax/dtypes.py index 67b5f5956..4bc7df9ee 100644 --- a/strax/dtypes.py +++ b/strax/dtypes.py @@ -1,8 +1,7 @@ """Fundamental dtypes for use in strax. -Note that if you change the dtype titles (comments), numba will crash if -there is an existing numba cache. Clear __pycache__ and restart. -TODO: file numba issue. +Note that if you change the dtype titles (comments), numba will crash if there is an existing numba +cache. Clear __pycache__ and restart. TODO: file numba issue. """ @@ -12,7 +11,6 @@ import numba # noqa: F401 import strax - __all__ = ( "interval_dtype raw_record_dtype record_dtype hit_dtype peak_dtype " "DIGITAL_SUM_WAVEFORM_CHANNEL DEFAULT_RECORD_LENGTH " @@ -134,8 +132,9 @@ def hitlet_dtype(): def hitlet_with_data_dtype(n_samples=2): - """Hitlet dtype with data field. Required within the plugins to compute hitlet properties. + """Hitlet dtype with data field. + Required within the plugins to compute hitlet properties. :param n_samples: Buffer length of the data field. Make sure it can hold the longest hitlet. """ @@ -246,8 +245,9 @@ def peak_dtype( def copy_to_buffer( source: np.ndarray, buffer: np.ndarray, func_name: str, field_names: Optional[Tuple[str]] = None ): - """Copy the data from the source to the destination e.g. raw_records to records. To this end, we - dynamically create the njitted function with the name 'func_name' (should start with "_"). + """Copy the data from the source to the destination e.g. raw_records to records. + + To this end, we dynamically create the njitted function with the name 'func_name' (should start with "_"). :param source: array of input :param buffer: array of buffer to fill with values from input diff --git a/strax/plugins/plugin.py b/strax/plugins/plugin.py index 3a725637b..3f7034cf4 100644 --- a/strax/plugins/plugin.py +++ b/strax/plugins/plugin.py @@ -408,8 +408,9 @@ def source_finished(self): raise RuntimeError("source_finished called on a regular plugin") def _fetch_chunk(self, d, iters, check_end_not_before=None): - """Add a chunk of the datatype d to the input buffer. Return True if this succeeded, False - if the source is exhausted. + """Add a chunk of the datatype d to the input buffer. + + Return True if this succeeded, False if the source is exhausted. :param d: data type to fetch :param iters: iterators that produce data diff --git a/strax/processing/general.py b/strax/processing/general.py index 5332adf30..a2d1321ab 100644 --- a/strax/processing/general.py +++ b/strax/processing/general.py @@ -123,8 +123,9 @@ class NoBreakFound(Exception): @export @numba.njit(nogil=True, cache=True) def _find_break_i(data, safe_break, not_before): - """Return first index of element right of the first gap larger than safe_break in data. Assumes - all x have the same length and are sorted! + """Return first index of element right of the first gap larger than safe_break in data. + + Assumes all x have the same length and are sorted! :param tolerant: if no break found, yield an as good as possible break anyway. @@ -211,8 +212,9 @@ def _fc_in(a_starts, b_starts, a_ends, b_ends, result): @export def split_by_containment(things, containers): - """Return list of thing-arrays contained in each container. Result is returned as a - numba.typed.List or list if containers are empty. + """Return list of thing-arrays contained in each container. + + Result is returned as a numba.typed.List or list if containers are empty. Assumes everything is sorted, and containers are non-overlapping. diff --git a/strax/processing/hitlets.py b/strax/processing/hitlets.py index 148347757..745cd4596 100644 --- a/strax/processing/hitlets.py +++ b/strax/processing/hitlets.py @@ -23,11 +23,10 @@ def create_hitlets_from_hits( :param hits: Hits found in records. :param save_outside_hits: Tuple with left and right hit extension. :param channel_range: Detectors change range from channel map. - :param chunk_start: (optional) start time of a chunk. Ensures that - no hitlet is earlier than this timestamp. - :param chunk_end: (optional) end time of a chunk. Ensures that - no hitlet ends later than this timestamp. - + :param chunk_start: (optional) start time of a chunk. Ensures that no hitlet is earlier than + this timestamp. + :param chunk_end: (optional) end time of a chunk. Ensures that no hitlet ends later than this + timestamp. :return: Hitlets with temporary fields (data, max_goodness_of_split...) """ diff --git a/strax/processing/peak_building.py b/strax/processing/peak_building.py index 402c59fd5..55dca53af 100644 --- a/strax/processing/peak_building.py +++ b/strax/processing/peak_building.py @@ -157,7 +157,6 @@ def store_downsampled_waveform( waveform in the peak. """ - n_samples = len(p["data"]) p_length = p["length"] @@ -255,9 +254,11 @@ def sum_waveform( store_data_start=False, select_peaks_indices=None, ): - """Compute sum waveforms for all peaks in peaks. Only builds summed waveform other regions in - which hits were found. This is required to avoid any bias due to zero-padding and baselining. - Will downsample sum waveforms if they do not fit in per-peak buffer. + """Compute sum waveforms for all peaks in peaks. + + Only builds summed waveform other regions in which hits were found. This is required to avoid + any bias due to zero-padding and baselining. Will downsample sum waveforms if they do not fit in + per-peak buffer. :param peaks: Peaks for which the summed waveform should be build. :param hits: Hits which are inside peaks. Must be sorted according to record_i. @@ -401,8 +402,9 @@ def sum_waveform( @numba.njit(cache=True, nogil=True) def _build_hit_waveform(hit, record, hit_waveform): - """Adds information for overlapping record and hit to hit_waveform. Updates hit_waveform - inplace. Result is still in ADC counts. + """Adds information for overlapping record and hit to hit_waveform. + + Updates hit_waveform inplace. Result is still in ADC counts. :return: Boolean if record saturated within the hit. @@ -477,8 +479,9 @@ def find_hit_integration_bounds( n_channels, allow_bounds_beyond_records=False, ): - """Update (lone) hits to include integration bounds. Please note that time and length of the - original hit are not changed! + """Update (lone) hits to include integration bounds. + + Please note that time and length of the original hit are not changed! :param hits: Hits or lone hits which should be extended by integration bounds. :param excluded_intervals: Regions in which hits should not extend to. E.g. Peaks for lone hits. diff --git a/strax/processing/peak_merging.py b/strax/processing/peak_merging.py index 1e5009d88..74c11d3d0 100644 --- a/strax/processing/peak_merging.py +++ b/strax/processing/peak_merging.py @@ -36,7 +36,6 @@ def merge_peaks( constituent peaks, it being too time-consuming to revert to records/hits. """ - new_peaks, endtime = _merge_peaks( peaks, start_merge_at, diff --git a/strax/processing/peak_properties.py b/strax/processing/peak_properties.py index f7d55744b..de1c1abc9 100644 --- a/strax/processing/peak_properties.py +++ b/strax/processing/peak_properties.py @@ -77,7 +77,6 @@ def compute_widths(peaks): :param peaks: single strax peak(let) or other data-bearing dtype """ - desired_widths = np.linspace(0, 1, len(peaks[0]["width"])) # 0% are width is 0 by definition, and it messes up the calculation below desired_widths = desired_widths[1:] @@ -137,8 +136,8 @@ def compute_area_fraction_top(peaks, n_top_channels): @export def compute_properties(peaks, n_top_channels=0, select_peaks_indices=None): - """Compute properties: median_time, width, area_decile_from_midpoint, - center_time, and area_fraction_top for peaks. + """Compute properties: median_time, width, area_decile_from_midpoint, center_time, and + area_fraction_top for peaks. :param peaks: single strax peak(let) or other data-bearing dtype :param select_peaks_indices: array of integers informing which peaks to compute default to None diff --git a/strax/processing/pulse_processing.py b/strax/processing/pulse_processing.py index 166df869b..8f1d56f98 100644 --- a/strax/processing/pulse_processing.py +++ b/strax/processing/pulse_processing.py @@ -20,8 +20,9 @@ def baseline( records, baseline_samples=40, flip=True, allow_sloppy_chunking=False, fallback_baseline=16000 ): - """Determine baseline as the average of the first baseline_samples of each pulse. Subtract the - pulse data from int(baseline), and store the baseline mean and rms. + """Determine baseline as the average of the first baseline_samples of each pulse. + + Subtract the pulse data from int(baseline), and store the baseline mean and rms. :param baseline_samples: number of samples at start of pulse to average to determine the baseline. @@ -165,8 +166,9 @@ def find_hits( min_amplitude: ty.Union[int, np.ndarray] = 15, min_height_over_noise: ty.Union[int, np.ndarray] = 0, ): - """Return hits (intervals >= threshold) found in records. Hits that straddle record boundaries - are split (perhaps we should fix this?) + """Return hits (intervals >= threshold) found in records. + + Hits that straddle record boundaries are split (perhaps we should fix this?) NB: returned hits are NOT sorted yet! @@ -316,8 +318,9 @@ def _waveforms_to_float(wv, bl): @export def filter_records(r, ir): - """Apply filter with impulse response ir over the records r. Assumes the filter origin is at the - impulse response maximum. + """Apply filter with impulse response ir over the records r. + + Assumes the filter origin is at the impulse response maximum. :param ws: Waveform matrix, must be float :param ir: Impulse response, must have odd length. Will normalize. @@ -338,8 +341,9 @@ def filter_records(r, ir): @export def filter_waveforms(ws, ir, prev_r, next_r): - """Convolve filter with impulse response ir over each row of ws. Assumes the filter origin is at - the impulse response maximum. + """Convolve filter with impulse response ir over each row of ws. + + Assumes the filter origin is at the impulse response maximum. :param ws: Waveform matrix, must be float :param ir: Impulse response, must have odd length. diff --git a/strax/run_selection.py b/strax/run_selection.py index e3f328774..020fbbf12 100644 --- a/strax/run_selection.py +++ b/strax/run_selection.py @@ -26,7 +26,6 @@ def list_available(self, target, runs=None, **kwargs) -> list: :param runs: Runs to check. If None, check all runs. """ - if len(kwargs): # noinspection PyMethodFirstArgAssignment self = self.new_context(**kwargs) @@ -53,8 +52,10 @@ def list_available(self, target, runs=None, **kwargs) -> list: def keys_for_runs( self, target: str, run_ids: ty.Union[np.ndarray, list, tuple, str] ) -> ty.List[strax.DataKey]: - """Get the data-keys for a multitude of runs. If use_per_run_defaults is False which it - preferably is (#246), getting many keys should be fast as we only compute the lineage once. + """Get the data-keys for a multitude of runs. + + If use_per_run_defaults is False which it preferably is (#246), getting many keys should be fast + as we only compute the lineage once. :param run_ids: Runs to get datakeys for :param target: datatype requested @@ -467,8 +468,9 @@ def available_for_run( exclude_targets: ty.Union[None, list, tuple, str] = None, pattern_type: str = "fnmatch", ) -> pd.DataFrame: - """For a given single run, check all the targets if they are stored. Excludes the target if - never stored anyway. + """For a given single run, check all the targets if they are stored. + + Excludes the target if never stored anyway. :param run_id: requested run :param include_targets: targets to include e.g. raw_records, raw_records* or *_nv. If multiple diff --git a/strax/storage/common.py b/strax/storage/common.py index a40e31829..31a9be894 100644 --- a/strax/storage/common.py +++ b/strax/storage/common.py @@ -309,12 +309,12 @@ def find( """Return (str: backend class name, backend-specific) key to get at / write data, or raise exception. - :param key: DataKey of data to load - {data_type: (plugin_name, version, {config_option: value, ...}, ...} - :param write: Set to True if writing new data. The data is immediately - registered, so you must follow up on the write! - :param check_broken: If True, raise DataNotAvailable if data has not - been complete written, or writing terminated with an exception. + :param key: DataKey of data to load {data_type: (plugin_name, version, {config_option: + value, ...}, ...} + :param write: Set to True if writing new data. The data is immediately registered, so you + must follow up on the write! + :param check_broken: If True, raise DataNotAvailable if data has not been complete written, + or writing terminated with an exception. """ message = ( diff --git a/strax/storage/files.py b/strax/storage/files.py index 6b8275343..ae575a4f2 100644 --- a/strax/storage/files.py +++ b/strax/storage/files.py @@ -17,10 +17,10 @@ @export class DataDirectory(StorageFrontend): - """Simplest registry: single directory with FileStore data - sitting in subdirectories. + """Simplest registry: single directory with FileStore data sitting in subdirectories. Run-level metadata is stored in loose json files in the directory. + """ can_define_runs = True diff --git a/strax/storage/mongo.py b/strax/storage/mongo.py index 7764b5b80..21e6c558d 100644 --- a/strax/storage/mongo.py +++ b/strax/storage/mongo.py @@ -36,7 +36,6 @@ def __init__(self, uri: str, database: str, col_name: str): :param col_name: collection name (str) to look for data """ - self.client = MongoClient(uri) self.db = self.client[database] self.col_name = col_name @@ -95,15 +94,15 @@ def _get_metadata(self, key, **kwargs): raise strax.DataNotAvailable def _build_chunk_registry(self, backend_key, dtype): - """Build chunk info in a single registry using only one query to the database. This is much - faster as one does not have to do n-chunk queries to the database. Just one will do. As the - documents-size is limited to 16 MB, it's unlikely that we will run into memory issues (that - we otherwise would not run into). + """Build chunk info in a single registry using only one query to the database. + + This is much faster as one does not have to do n-chunk queries to the database. Just one + will do. As the documents-size is limited to 16 MB, it's unlikely that we will run into + memory issues (that we otherwise would not run into). :param backend_key: strax.DataKey to query the collection for """ - query = backend_key_to_query(backend_key) chunks_registry = self.db[self.col_name].find( {**query, "provides_meta": False}, {"chunk_i": 1, "data": 1} @@ -166,7 +165,6 @@ def __init__(self, uri: str, database: str, col_name: str, *args, **kwargs): :param kwargs: init for StorageFrontend """ - super().__init__(*args, **kwargs) self.client = MongoClient(uri) self.db = self.client[database] diff --git a/strax/utils.py b/strax/utils.py index f59fcf57e..432f39ca3 100644 --- a/strax/utils.py +++ b/strax/utils.py @@ -24,7 +24,6 @@ import deepdiff import copy - # Change numba's caching backend from pickle to dill # I'm sure they don't mind... # Otherwise we get strange errors while caching the @growing_result functions @@ -187,8 +186,9 @@ def merged_dtype(dtypes): @export def merge_arrs(arrs, dtype=None, replacing=False): - """Merge structured arrays of equal length. On field name collisions, data from later arrays is - kept. + """Merge structured arrays of equal length. + + On field name collisions, data from later arrays is kept. replacing=True is usually used when you want to convert arrs into a new dtype @@ -842,7 +842,6 @@ def convert_structured_array_to_df(structured_array, log=None): pandas.DataFrame: The converted DataFrame. """ - if log is None: import logging diff --git a/tests/test_context.py b/tests/test_context.py index f4ef465ca..8e78d48f9 100644 --- a/tests/test_context.py +++ b/tests/test_context.py @@ -116,8 +116,10 @@ def drop(self, data, r, t): def test_accumulate(): - """Test the st.accumulate function. Should add the results and accumulate per chunk. Lets add - channels and verify the results are correct. + """Test the st.accumulate function. + + Should add the results and accumulate per chunk. Lets add channels and verify the results are + correct. :return: None diff --git a/tests/test_hitlet.py b/tests/test_hitlet.py index 5321e50aa..ba8483fea 100644 --- a/tests/test_hitlet.py +++ b/tests/test_hitlet.py @@ -388,7 +388,6 @@ def test_conditional_entropy(data, size_template_and_ind_max_template): the maximum. """ - hitlet = np.zeros(1, dtype=strax.hitlet_with_data_dtype(n_samples=10)) ind_max_template, size_template = strax.stable_sort(size_template_and_ind_max_template) diff --git a/tests/test_loop_plugins.py b/tests/test_loop_plugins.py index 446ee8bc6..658cbd6f3 100644 --- a/tests/test_loop_plugins.py +++ b/tests/test_loop_plugins.py @@ -42,8 +42,9 @@ def _loop_test_inner( force_value_error=False, processor=None, ): - """Test loop plugins for random data. For this test we are going to setup two plugins that will - be looped over and combined into a loop plugin (depending on the target, this may be a multi + """Test loop plugins for random data. + + For this test we are going to setup two plugins that will be looped over and combined into a loop plugin (depending on the target, this may be a multi output plugin). We are going to setup as follows: @@ -52,7 +53,6 @@ def _loop_test_inner( we will add to the big data in the loop plugin """ - if len(big_data) or force_value_error: # Generate some random amount of chunks for the big-data big_chunks = list(rechunk_array_to_arrays(big_data, nchunks)) diff --git a/tests/test_peak_processing.py b/tests/test_peak_processing.py index b667b5a4f..51dbeb2d8 100644 --- a/tests/test_peak_processing.py +++ b/tests/test_peak_processing.py @@ -176,7 +176,6 @@ def test_peak_overflow( :return: None """ - # Set this here, no need to test left and right independently left_extension = 0 # Make a single big peak to contain all the records diff --git a/tests/test_storage.py b/tests/test_storage.py index 101c7e758..4646a1370 100644 --- a/tests/test_storage.py +++ b/tests/test_storage.py @@ -200,9 +200,8 @@ def test_float_remoteness_allowed(self): """It can happen that the pre-defined remoteness identifiers in strax.StorageType are not sufficient, e.g. you have 10 similar but not quite the same performing frontends. - You can set `sf.storage_type` as a float to fix this issue such - that you can order an infinite amount of frontends (the intnum - is only for readability). + You can set `sf.storage_type` as a float to fix this issue such that you can order an + infinite amount of frontends (the intnum is only for readability). """ diff --git a/tests/test_superruns.py b/tests/test_superruns.py index ea58c441c..07bf05b48 100644 --- a/tests/test_superruns.py +++ b/tests/test_superruns.py @@ -136,7 +136,6 @@ def test_create_and_load_superruns(self): Loads and compare data afterwards. Also tests "add_run_id_field" option. """ - subrun_data = self.context.get_array( self.subrun_ids, "peaks", progress_bar=False, add_run_id_field=False ) @@ -247,7 +246,6 @@ def test_rechnunking_and_loading(self): chunk.continuity_check in context.get_iter. """ - self.context.set_config({"recs_per_chunk": 500}) # Make chunks > 1 MB rr = self.context.get_array(self.subrun_ids, "peaks") diff --git a/tests/test_utils.py b/tests/test_utils.py index 329ae0ec1..1010f7d66 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -37,8 +37,9 @@ def test_to_numpy_dtype(): @hst.composite def get_dummy_data(draw, data_length=(0, 10), dt=(1, 10), max_time=(1, 20)): - """Create some dummy array for testing apply selection. Data may be overlapping. + """Create some dummy array for testing apply selection. + Data may be overlapping. :param data_length: desired length of the data :param dt: duration of each sample :return: data @@ -96,13 +97,14 @@ def test_time_selection(d, second_time, second_dt): @settings(deadline=None) @given(get_dummy_data(data_length=(1, 10), dt=(1, 10), max_time=(1, 20))) def test_selection_str(d): - """ - Test selection string. We are going for this example check that - selecting the data based on the data field is the same as if we + """Test selection string. + + We are going for this example check that selecting the data based on the data field is the same as if we were to use a mask NB: data must have some length! :param d: test-data from get_dummy_data :return: None + """ mean_data = np.mean(d["data"]) max_data = np.max(d["data"]) @@ -115,13 +117,14 @@ def test_selection_str(d): @settings(deadline=None) @given(get_dummy_data(data_length=(1, 10), dt=(1, 10), max_time=(1, 20))) def test_selection_function(d): - """ - Test selection string. We are going for this example check that - selecting the data based on the data field is the same as if we + """Test selection string. + + We are going for this example check that selecting the data based on the data field is the same as if we were to use a mask NB: data must have some length! :param d: test-data from get_dummy_data :return: None + """ mean_data = np.mean(d["data"]) max_data = np.max(d["data"]) @@ -136,8 +139,10 @@ def test_selection_function(d): get_dummy_data(data_length=(0, 10), dt=(1, 10), max_time=(1, 20)), ) def test_keep_drop_columns(d): - """Test that the keep/drop_columns option of apply selection works. Also test that it does not - affect the original array (e.g. if it were to use a view instead of a copy). + """Test that the keep/drop_columns option of apply selection works. + + Also test that it does not affect the original array (e.g. if it were to use a view instead of a + copy). :param d: test-data from get_dummy_data :return: None