@@ -59,11 +59,16 @@ def get_data(series, record_component, i_slice=None, pos_slice=None,
5959 # ADIOS2: Actual chunks, all other: one chunk
6060 chunks = record_component .available_chunks ()
6161
62+ # mask invalid regions with NaN: fill value
63+ # note: NaN is only defined for floating point types
64+ NaN_value = np .nan if np .issubdtype (record_component .dtype , np .floating ) or np .issubdtype (record_component .dtype , np .complexfloating ) else 0
65+
6266 # read whole data set
6367 if pos_slice is None :
6468 # mask invalid regions with NaN
6569 # note: full_like triggers a full read, thus we avoid it #340
66- data = np .full (record_component .shape , np .nan , record_component .dtype )
70+ data = np .full (record_component .shape , NaN_value , record_component .dtype )
71+
6772 for chunk in chunks :
6873 chunk_slice = chunk_to_slice (chunk )
6974
@@ -90,7 +95,7 @@ def get_data(series, record_component, i_slice=None, pos_slice=None,
9095 del slice_shape [dir_index ]
9196
9297 # mask invalid regions with NaN
93- data = np .full (slice_shape , np . nan , dtype = record_component .dtype )
98+ data = np .full (slice_shape , NaN_value , dtype = record_component .dtype )
9499
95100 # build requested ND slice with respect to full data
96101 s = []
0 commit comments