Skip to content

Commit

Permalink
remove useless len check
Browse files Browse the repository at this point in the history
empty dict will be ignored, so it really only saves us a get, a
conditional and a dict
  • Loading branch information
fitnr committed Dec 16, 2014
1 parent 9187818 commit 0014c08
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions buoyant/buoy.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ def _setup_ndbc_dt(dt_string):


def _set_obs(cls, xml):
"""Store observation data in the Buoy class."""
# Add observation meta, ignoring id
for key, value in xml.items():
if key != 'id':
Expand All @@ -117,9 +118,6 @@ def _set_obs(cls, xml):
# And add any other metadata that might be in the attributes
units, meta = {}, {}
for node in xml:
if len(node.items()) == 0:
continue

attribs = dict(node.items())
name = NAMES.get(node.tag, node.tag)

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
setup(
name='buoyant',

version='0.2.0',
version='0.2.1',

description='buoy data from the NOAA',

Expand Down

0 comments on commit 0014c08

Please sign in to comment.