Skip to content

Commit

Permalink
Merge pull request sunpy#7492 from ayshih/ayshih-patch-1
Browse files Browse the repository at this point in the history
Save a repeat access by using the walrus operator
  • Loading branch information
alasdairwilson authored Mar 12, 2024
2 parents 5b6e66c + f857727 commit 7d3cc09
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions sunpy/map/mapbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -2530,8 +2530,7 @@ def plot(self, annotate=True, axes=None, title=True, autoalign=False,
msg = ('Cannot manually specify {0}, as the norm '
'already has {0} set. To prevent this error set {0} on '
'`m.plot_settings["norm"]` or the norm passed to `m.plot`.')
if imshow_args.get('norm', None) is not None:
norm = imshow_args['norm']
if (norm := imshow_args.get('norm', None)) is not None:
if 'vmin' in imshow_args:
if norm.vmin is not None:
raise ValueError(msg.format('vmin'))
Expand Down

0 comments on commit 7d3cc09

Please sign in to comment.