Skip to content

Commit

Permalink
fix: info tab did not display QMap metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmueller committed Jan 23, 2020
1 parent 2542970 commit 772899a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
0.6.4
- fix: info tab did not display QMap metadata
0.6.3
- fix: support JPK data recorded in the "force-modulation" feedback mode
(bump afmformats from 0.5.0 to 0.5.1)
Expand Down
9 changes: 4 additions & 5 deletions pyjibe/fd/tab_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,13 @@ def get_string_rep(name, value, unit):

def has_all_nans(adict):
"""Check whether a dictionary as all-nan values"""
allnan = True
for value in adict.values():
if isinstance(value, numbers.Number):
if not np.isnan(value):
notallnan = True
allnan = False
break
else:
notallnan = True
allnan = False
break
else:
notallnan = False
return notallnan
return allnan
9 changes: 9 additions & 0 deletions tests/test_fd_tab_info.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import numpy as np

import pyjibe.fd.tab_info


def test_all_nan_dict():
assert pyjibe.fd.tab_info.has_all_nans({"a": np.nan, "b": np.nan})
assert not pyjibe.fd.tab_info.has_all_nans({"a": 1, "b": np.nan})
assert not pyjibe.fd.tab_info.has_all_nans({"a": "1", "b": np.nan})

0 comments on commit 772899a

Please sign in to comment.