Skip to content

Commit

Permalink
Fix the dataset str function to allow missing name and sensor keys.
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Raspaud <martin.raspaud@smhi.se>
  • Loading branch information
mraspaud committed Dec 1, 2015
1 parent 0de0bed commit 2f437d1
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions mpop/projectable.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,13 @@ def __str__(self):

def _str_info(self):
res = list()
res.append(self.info["name"] + ": ")
try:
res.append(self.info["name"] + ": ")

if "sensor" in self.info:
res[0] = str(self.info["sensor"]) + "/" + res[0]
if "sensor" in self.info:
res[0] = str(self.info["sensor"]) + "/" + res[0]
except KeyError:
pass

for key in sorted(self.info.keys()):
if key == "wavelength_range":
Expand Down

0 comments on commit 2f437d1

Please sign in to comment.