From 7b678af1b42802f304284c55428bd2589f1dcb97 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Wed, 31 Mar 2021 12:40:53 +0200 Subject: [PATCH] float and int are different --- python/damask/_result.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/damask/_result.py b/python/damask/_result.py index 345090cc0..209e5e07a 100644 --- a/python/damask/_result.py +++ b/python/damask/_result.py @@ -1351,7 +1351,7 @@ class Result: return r - def place(self,labels,compress=True,strip=True,constituents=None,fill_value=0.0): + def place(self,labels,compress=True,strip=True,constituents=None,fill_float=0.0,fill_int=0): r = {} labels_ = set([labels] if isinstance(labels,str) else labels) @@ -1391,11 +1391,11 @@ class Result: if la not in r[inc]['phase'][me].keys(): container = np.empty((N_cells,)+data.shape[1:],dtype=data.dtype) + fill_value = fill_float if data.dtype in np.sctypes['float'] else fill_int r[inc]['phase'][me][la] = ma.array(container,fill_value=fill_value,mask=True) r[inc]['phase'][me][la][at_cell_ph[c][ph]] = data[in_data_ph[c][ph]] - if strip: r = util.dict_strip(r) if compress: r = util.dict_compress(r) return r