Skip to content

Commit 723b930

Browse files
fix(d3plot): correct printf-style formatting in debug logs (#95)
1 parent a9607ef commit 723b930

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/lasso/dyna/d3plot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6228,7 +6228,7 @@ def write_d3plot(
62286228
# write geometry file
62296229
with open_file_or_filepath(filepath, "wb") as fp:
62306230
n_bytes_written = 0
6231-
msg = "wrote {0} after {1}."
6231+
msg = "wrote %s after %s."
62326232

62336233
# header
62346234
n_bytes_written += self._write_header(fp, write_settings)
@@ -6309,7 +6309,7 @@ def write_d3plot(
63096309
n_bytes_written += fp.write(zero_bytes)
63106310
LOGGER.debug(msg, n_bytes_written, "_zero_byte_padding")
63116311

6312-
msg = "Wrote {0} bytes to geometry file."
6312+
msg = "Wrote %s bytes to geometry file."
63136313
LOGGER.debug(msg, n_bytes_written)
63146314

63156315
# Extra Data Types (for multi solver output)

test/unit_tests/dyna/test_d3plot.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,8 @@ def test_write(self):
342342

343343
# rewrite d3plot
344344
out_filepath = os.path.join(dirpath, "yay.d3plot")
345-
d3plot1.write_d3plot(out_filepath)
345+
with self.assertLogs("lasso.dyna.d3plot", level="DEBUG"):
346+
d3plot1.write_d3plot(out_filepath)
346347

347348
# read it in again and compare
348349
d3plot2 = D3plot(out_filepath, **d3plot_kwargs)

0 commit comments

Comments
 (0)