From e102dbbd6ed8bcb5518ef02dddeeb512d2747e94 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 19 Dec 2023 16:42:17 -0500 Subject: [PATCH] [pre-commit.ci] pre-commit autoupdate (#779) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [pre-commit.ci] pre-commit autoupdate updates: - [github.com/psf/black: 23.11.0 → 23.12.0](https://github.com/psf/black/compare/23.11.0...23.12.0) - [github.com/pre-commit/mirrors-mypy: v1.7.0 → v1.7.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.7.0...v1.7.1) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Dacheng Xu --- .pre-commit-config.yaml | 4 ++-- strax/context.py | 6 +++--- strax/mailbox.py | 6 +++--- strax/plugins/plugin.py | 6 +++--- strax/run_selection.py | 6 +++--- tests/test_multi_output.py | 12 ++++++------ tests/test_superruns.py | 12 ++++++------ 7 files changed, 26 insertions(+), 26 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 61093dfed..82d421c43 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,7 +10,7 @@ repos: - id: check-added-large-files - repo: https://github.com/psf/black - rev: 23.11.0 + rev: 23.12.0 hooks: - id: black args: [--safe, --line-length=100, --preview] @@ -24,7 +24,7 @@ repos: - id: docformatter - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.7.0 + rev: v1.7.1 hooks: - id: mypy additional_dependencies: [ diff --git a/strax/context.py b/strax/context.py index 59d4c0289..68b2b37a1 100644 --- a/strax/context.py +++ b/strax/context.py @@ -709,9 +709,9 @@ def _get_plugins( """ # Check all config options are taken by some registered plugin class # (helps spot typos) - all_opts = set().union(*[ - pc.takes_config.keys() for pc in self._plugin_class_registry.values() - ]) + all_opts = set().union( + *[pc.takes_config.keys() for pc in self._plugin_class_registry.values()] + ) for k in self.config: if not (k in all_opts or k in self.context_config["free_options"]): self.log.warning(f"Option {k} not taken by any registered plugin") diff --git a/strax/mailbox.py b/strax/mailbox.py index 1e437f5a5..173bda707 100644 --- a/strax/mailbox.py +++ b/strax/mailbox.py @@ -237,9 +237,9 @@ def _can_fetch(self): # If someone is still waiting for a message we already have # (so they just haven't woken up yet), don't fetch a new message. - if len(self._mailbox) and any([ - x is not None and x <= self._lowest_msg_number for x in self._subscriber_waiting_for - ]): + if len(self._mailbox) and any( + [x is not None and x <= self._lowest_msg_number for x in self._subscriber_waiting_for] + ): return False # Everyone is waiting for the new chunk or not at all. diff --git a/strax/plugins/plugin.py b/strax/plugins/plugin.py index 326cc4389..b3d1b0421 100644 --- a/strax/plugins/plugin.py +++ b/strax/plugins/plugin.py @@ -477,9 +477,9 @@ class IterDone(Exception): inputs[d], back_to_buffer = inputs[d].split( t=this_chunk_end, allow_early_split=True ) - self.input_buffer[d] = strax.Chunk.concatenate([ - back_to_buffer, self.input_buffer[d] - ]) + self.input_buffer[d] = strax.Chunk.concatenate( + [back_to_buffer, self.input_buffer[d]] + ) max_passes_left -= 1 else: raise RuntimeError( diff --git a/strax/run_selection.py b/strax/run_selection.py index fb9ac1507..ffd3db686 100644 --- a/strax/run_selection.py +++ b/strax/run_selection.py @@ -143,9 +143,9 @@ def scan_runs( if isinstance(doc["source"], list): doc["source"] = ",".join(doc["source"]) - doc["tags"] = ",".join([ - t["name"] if isinstance(t, dict) else t for t in doc.get("tags", []) - ]) + doc["tags"] = ",".join( + [t["name"] if isinstance(t, dict) else t for t in doc.get("tags", [])] + ) # Set a default livetime if we have start and stop if ( diff --git a/tests/test_multi_output.py b/tests/test_multi_output.py index 2c99fab49..d8652ccae 100644 --- a/tests/test_multi_output.py +++ b/tests/test_multi_output.py @@ -251,17 +251,17 @@ def test_double_dependency_notlazy(self): def test_double_dependency_multiprocess(self): """Tests if double dependency of a plugin on another plugin leads to dead lock in processing.""" - self.mystrax.set_context_config({ - "timeout": 120, "allow_lazy": False, "allow_multiprocess": True - }) + self.mystrax.set_context_config( + {"timeout": 120, "allow_lazy": False, "allow_multiprocess": True} + ) self._test_double_dependency(max_workers=2) def test_double_dependency_inline_plugins(self): """Tests if double dependency of a plugin on another plugin leads to dead lock in processing.""" - self.mystrax.set_context_config({ - "timeout": 120, "allow_lazy": False, "allow_multiprocess": True - }) + self.mystrax.set_context_config( + {"timeout": 120, "allow_lazy": False, "allow_multiprocess": True} + ) self._test_double_dependency(max_workers=2, make_data_type="zipped_records_classified") self.mystrax.is_stored(run_id, "even_recs_classified") diff --git a/tests/test_superruns.py b/tests/test_superruns.py index 827a5aeb9..b8ef96f1b 100644 --- a/tests/test_superruns.py +++ b/tests/test_superruns.py @@ -211,9 +211,9 @@ def test_rechnunking_and_loading(self): # three chunks next_subrun_id = int(self.subrun_ids[-1]) + 1 for run_id in range(next_subrun_id, next_subrun_id + 2): - self.context.set_config({ - "secret_time_offset": int(endtime + self.offset_between_subruns) - }) + self.context.set_config( + {"secret_time_offset": int(endtime + self.offset_between_subruns)} + ) rr = self.context.get_array(str(run_id), "records") self._write_run_doc( run_id, @@ -325,9 +325,9 @@ def _create_subruns(self, n_subruns=3): self.now + datetime.timedelta(0, int(endtime)), ) - self.context.set_config({ - "secret_time_offset": int(endtime + self.offset_between_subruns) - }) + self.context.set_config( + {"secret_time_offset": int(endtime + self.offset_between_subruns)} + ) assert self.context.is_stored(run_id, "records") def _write_run_doc(self, run_id, time, endtime):