Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Sep 20, 2024
1 parent 38c48de commit 9d06ad1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
6 changes: 3 additions & 3 deletions strax/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -808,8 +808,8 @@ def convert_tuple_to_list(init_func_input):

@export
def convert_structured_array_to_df(structured_array, log=None):
"""
Convert a structured numpy array to a pandas DataFrame.
"""Convert a structured numpy array to a pandas DataFrame.
Parameters:
structured_array (numpy.ndarray): The structured array to be converted.
Returns:
Expand All @@ -821,7 +821,7 @@ def convert_structured_array_to_df(structured_array, log=None):
import logging

log = logging.getLogger("strax_array_to_df")

data_dict = {}
converted_cols = []
for name in structured_array.dtype.names:
Expand Down
7 changes: 5 additions & 2 deletions tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def test_core(allow_multiprocess, max_workers, processor):

@processing_conditions
def test_core_df(allow_multiprocess, max_workers, processor, caplog):
"""Test that get_df works with N-dimensional data"""
"""Test that get_df works with N-dimensional data."""
mystrax = strax.Context(
storage=[],
register=[Records, Peaks],
Expand All @@ -47,7 +47,10 @@ def test_core_df(allow_multiprocess, max_workers, processor, caplog):
p = mystrax.get_single_plugin(run_id, "records")
assert len(df.loc[0, "data"]) == 200
assert len(df) == p.config["recs_per_chunk"] * p.config["n_chunks"]
assert "contain non-scalar entries. Some pandas functions (e.g., groupby, apply) might not perform as expected on these columns." in caplog.text
assert (
"contain non-scalar entries. Some pandas functions (e.g., groupby, apply) might not perform as expected on these columns."
in caplog.text
)


def test_post_office_state():
Expand Down

0 comments on commit 9d06ad1

Please sign in to comment.