From c9a34a14b9ba048f3f0e9ffc0cc686ad1c3326b2 Mon Sep 17 00:00:00 2001 From: Allen Mao Date: Fri, 19 Dec 2025 12:47:08 -0800 Subject: [PATCH] fix(d3plot): correct printf-style formatting in debug logs --- src/lasso/dyna/d3plot.py | 4 ++-- test/unit_tests/dyna/test_d3plot.py | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/lasso/dyna/d3plot.py b/src/lasso/dyna/d3plot.py index 2897300..5a6fa26 100644 --- a/src/lasso/dyna/d3plot.py +++ b/src/lasso/dyna/d3plot.py @@ -6228,7 +6228,7 @@ def write_d3plot( # write geometry file with open_file_or_filepath(filepath, "wb") as fp: n_bytes_written = 0 - msg = "wrote {0} after {1}." + msg = "wrote %s after %s." # header n_bytes_written += self._write_header(fp, write_settings) @@ -6309,7 +6309,7 @@ def write_d3plot( n_bytes_written += fp.write(zero_bytes) LOGGER.debug(msg, n_bytes_written, "_zero_byte_padding") - msg = "Wrote {0} bytes to geometry file." + msg = "Wrote %s bytes to geometry file." LOGGER.debug(msg, n_bytes_written) # Extra Data Types (for multi solver output) diff --git a/test/unit_tests/dyna/test_d3plot.py b/test/unit_tests/dyna/test_d3plot.py index f81ad32..47d8ce8 100644 --- a/test/unit_tests/dyna/test_d3plot.py +++ b/test/unit_tests/dyna/test_d3plot.py @@ -342,7 +342,8 @@ def test_write(self): # rewrite d3plot out_filepath = os.path.join(dirpath, "yay.d3plot") - d3plot1.write_d3plot(out_filepath) + with self.assertLogs("lasso.dyna.d3plot", level="DEBUG"): + d3plot1.write_d3plot(out_filepath) # read it in again and compare d3plot2 = D3plot(out_filepath, **d3plot_kwargs)