From 7e8dbd1da025a9ff4b42617ced9b83a1717abf2a Mon Sep 17 00:00:00 2001 From: Michael <m.langguth@fz-juelich.de> Date: Fri, 27 Aug 2021 08:32:41 +0200 Subject: [PATCH] Minor bugfix in type-checking of append_ds-method in main_visualize_postprocess.py. --- .../main_scripts/main_visualize_postprocess.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/video_prediction_tools/main_scripts/main_visualize_postprocess.py b/video_prediction_tools/main_scripts/main_visualize_postprocess.py index 5d252868..67c064ea 100644 --- a/video_prediction_tools/main_scripts/main_visualize_postprocess.py +++ b/video_prediction_tools/main_scripts/main_visualize_postprocess.py @@ -1152,12 +1152,11 @@ class Postprocess(TrainModel): if not set(varnames).issubset(ds_in.data_vars): raise ValueError("%{0}: Could not find all variables ({1}) in input dataset ds_in.".format(method, varnames_str)) - #Bing : why using dtype as an aurument since it seems you only want ton configure dtype as np.double if dtype is None: dtype = np.double else: - if not isinstance(dtype, type(np.double)): - raise ValueError("%{0}: dytpe must be a NumPy datatype, but is of type '{1}'".format(method, type(dtype))) + if not np.issubdtype(dtype, np.dtype(float).type): + raise ValueError("%{0}: dytpe must be a NumPy datatype, but is '{1}'".format(method, np.dtype(dtype))) if ds_preexist is None: ds_preexist = ds_in[varnames].copy(deep=True) -- GitLab