MCPcopy Create free account
hub / github.com/NSLS2/PyXRF / _is_row_missing

Function _is_row_missing

pyxrf/model/load_data_from_db.py:2837–2852  ·  view source on GitHub ↗

Determine if the row is missing. Different versions of Databroker will return differnent value types.

(row_data)

Source from the content-addressed store, hash-verified

2835 data_primary = hdr.primary["data"]
2836
2837 def _is_row_missing(row_data):
2838 """
2839 Determine if the row is missing. Different versions of Databroker will return differnent value types.
2840 """
2841 if row_data is None:
2842 return True
2843 elif isinstance(row_data, np.ndarray) and sum(np.isnan(row_data)):
2844 # Tiled is expected to replace missing data with NaNs, but we don't want NaNs or 0s in scalers
2845 return True
2846 elif isinstance(row_data, np.ndarray) and (row_data.size == 1) and (row_data == np.array(None)):
2847 # This is returned by databroker.v0
2848 return True
2849 elif not len(row_data):
2850 return True
2851 else:
2852 return False
2853
2854 def _get_row_len(row_data):
2855 if _is_row_missing(row_data):

Callers 3

_get_row_lenFunction · 0.85
map_data2D_tes_tiledFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected