Skip to content

Commit

Permalink
MNT: Remove unnecessary use of keys().
Browse files Browse the repository at this point in the history
Unless it adds clarity, it's best to just rely on the fact that
iteration on a dictionary (including conversion to list) uses the keys
anyway.
  • Loading branch information
dopplershift committed Mar 20, 2018
1 parent f758fe0 commit 5247b82
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion metpy/io/nexrad.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ def _read_data(self):
# Check if we have any message segments still in the buffer
if self._msg_buf:
log.warning('Remaining buffered messages segments for message type(s): %s',
' '.join(map(str, self._msg_buf.keys())))
' '.join(map(str, self._msg_buf)))

del self._msg_buf

Expand Down
2 changes: 1 addition & 1 deletion metpy/plots/ctables.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def plot_color_gradients(cmap_category, cmap_list, nrows):
for ax in axes:
ax.set_axis_off()
cmaps = list(ctables.registry.keys())
cmaps = list(ctables.registry)
cmaps = [name for name in cmaps if name[-2:]!='_r']
nrows = len(cmaps)
gradient = np.linspace(0, 1, 256)
Expand Down
2 changes: 1 addition & 1 deletion talks/2015 Unidata Users Workshop.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -846,7 +846,7 @@
"\n",
"# Get the Data\n",
"data = ncss.get_data(query)\n",
"list(data.variables.keys())"
"list(data.variables)"
]
},
{
Expand Down

0 comments on commit 5247b82

Please sign in to comment.