diff --git a/miniscope_io/logging.py b/miniscope_io/logging.py index 3fba3eb3..3d7b3307 100644 --- a/miniscope_io/logging.py +++ b/miniscope_io/logging.py @@ -93,7 +93,7 @@ def _file_handler( def _rich_handler() -> RichHandler: rich_handler = RichHandler(rich_tracebacks=True, markup=True) rich_formatter = logging.Formatter( - "[bold green]\[%(name)s][/bold green] %(message)s", + r"[bold green]\[%(name)s][/bold green] %(message)s", datefmt="[%y-%m-%dT%H:%M:%S]", ) rich_handler.setFormatter(rich_formatter) diff --git a/miniscope_io/stream_daq.py b/miniscope_io/stream_daq.py index 83dd5abc..5caa0fb8 100644 --- a/miniscope_io/stream_daq.py +++ b/miniscope_io/stream_daq.py @@ -800,7 +800,7 @@ def _handle_frame( self.logger.debug("Saving header metadata") try: self._buffered_writer.append( - list(header.model_dump().values()) + [time.time()] + list(header.model_dump(warnings=False).values()) + [time.time()] ) except Exception as e: self.logger.exception(f"Exception saving headers: \n{e}") diff --git a/tests/test_stream_daq.py b/tests/test_stream_daq.py index e6889b9a..62a57301 100644 --- a/tests/test_stream_daq.py +++ b/tests/test_stream_daq.py @@ -123,6 +123,7 @@ def test_csv_output(tmp_path, default_streamdaq, write_metadata, caplog): default_streamdaq.capture(source="fpga", metadata=None, show_video=False) assert not output_csv.exists() + # This is a helper function for test_continuous_and_termination() that is currently skipped """ def capture_wrapper(default_streamdaq, source, show_video, continuous): @@ -132,8 +133,10 @@ def capture_wrapper(default_streamdaq, source, show_video, continuous): pass # expected """ -@pytest.mark.skip("Needs to be implemented." - "Temporary skipped because tests fail in some OS (See GH actions).") + +@pytest.mark.skip( + "Needs to be implemented. Temporary skipped because tests fail in some OS (See GH actions)." +) @pytest.mark.timeout(10) def test_continuous_and_termination(tmp_path, default_streamdaq): """ @@ -162,6 +165,7 @@ def test_continuous_and_termination(tmp_path, default_streamdaq): """ pass + def test_metadata_plotting(tmp_path, default_streamdaq): """ Setting the capture kwarg ``show_metadata == True`` should plot the frame metadata