diff --git a/strax/utils.py b/strax/utils.py index df13d9bf..49971807 100644 --- a/strax/utils.py +++ b/strax/utils.py @@ -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: @@ -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: diff --git a/tests/test_core.py b/tests/test_core.py index c09cb907..3ce990b3 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -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], @@ -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():