Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#779)
Browse files Browse the repository at this point in the history
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/psf/black: 23.11.0 → 23.12.0](psf/black@23.11.0...23.12.0)
- [github.com/pre-commit/mirrors-mypy: v1.7.0 → v1.7.1](pre-commit/mirrors-mypy@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 <dx2227@columbia.edu>
  • Loading branch information
pre-commit-ci[bot] and dachengx committed Dec 19, 2023
1 parent b2a5d32 commit e102dbb
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 26 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Expand Up @@ -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]
Expand All @@ -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: [
Expand Down
6 changes: 3 additions & 3 deletions strax/context.py
Expand Up @@ -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")
Expand Down
6 changes: 3 additions & 3 deletions strax/mailbox.py
Expand Up @@ -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.
Expand Down
6 changes: 3 additions & 3 deletions strax/plugins/plugin.py
Expand Up @@ -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(
Expand Down
6 changes: 3 additions & 3 deletions strax/run_selection.py
Expand Up @@ -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 (
Expand Down
12 changes: 6 additions & 6 deletions tests/test_multi_output.py
Expand Up @@ -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")

Expand Down
12 changes: 6 additions & 6 deletions tests/test_superruns.py
Expand Up @@ -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,
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit e102dbb

Please sign in to comment.