From e8e53f33d89626f200036c5e7bed1bbf0cb300e4 Mon Sep 17 00:00:00 2001 From: Ryan May Date: Fri, 8 Mar 2024 11:57:04 -0700 Subject: [PATCH] MNT: Replace format() calls with f strings in asserts --- src/metpy/io/nexrad.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/metpy/io/nexrad.py b/src/metpy/io/nexrad.py index 33ddb6bdbbb..8125b327110 100644 --- a/src/metpy/io/nexrad.py +++ b/src/metpy/io/nexrad.py @@ -1848,10 +1848,10 @@ def _unpack_symblock(self, start, offset): log.debug('Symbology block info: %s', blk) self.sym_block = [] - assert blk.divider == -1, ('Bad divider for symbology block: {:d} should be -1' - .format(blk.divider)) - assert blk.block_id == 1, ('Bad block ID for symbology block: {:d} should be 1' - .format(blk.block_id)) + assert blk.divider == -1, (f'Bad divider for symbology block: {blk.divider} should ' + 'be -1') + assert blk.block_id == 1, (f'Bad block ID for symbology block: {blk.block_id} should ' + 'be 1') for _ in range(blk.nlayer): layer_hdr = self._buffer.read_struct(self.sym_layer_fmt) assert layer_hdr.divider == -1 @@ -1872,10 +1872,10 @@ def _unpack_symblock(self, start, offset): def _unpack_graphblock(self, start, offset): self._buffer.jump_to(start, offset) hdr = self._buffer.read_struct(self.graph_block_fmt) - assert hdr.divider == -1, ('Bad divider for graphical block: {:d} should be -1' - .format(hdr.divider)) - assert hdr.block_id == 2, ('Bad block ID for graphical block: {:d} should be 1' - .format(hdr.block_id)) + assert hdr.divider == -1, (f'Bad divider for graphical block: {hdr.divider} should ' + f'be -1') + assert hdr.block_id == 2, (f'Bad block ID for graphical block: {hdr.block_id} should ' + 'be 1') self.graph_pages = [] for page in range(hdr.num_pages): page_num = self._buffer.read_int(2, 'big', signed=False)