Skip to content

Commit

Permalink
MNT: Replace format() calls with f strings in asserts
Browse files Browse the repository at this point in the history
  • Loading branch information
dopplershift committed Mar 8, 2024
1 parent 11519d4 commit e8e53f3
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/metpy/io/nexrad.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down

0 comments on commit e8e53f3

Please sign in to comment.