From f7c25033d8fd90504f2d878e49f8ad0ddcbf8335 Mon Sep 17 00:00:00 2001 From: gantian127 Date: Wed, 20 Oct 2021 16:40:09 -0600 Subject: [PATCH] fix bug for variable dtype when there is scale factor(float) --- bmi_era5/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bmi_era5/utils.py b/bmi_era5/utils.py index 72bed15..696ac05 100755 --- a/bmi_era5/utils.py +++ b/bmi_era5/utils.py @@ -76,7 +76,7 @@ def get_var_info(self): var_info[var.long_name] = { 'var_name': var_name, - 'dtype': str(var.dtype), + 'dtype': type(var.scale_factor).__name__ if 'scale_factor' in var.attrs.keys() else str(var.dtype), 'itemsize': var.values.itemsize, 'nbytes': var.values[0].nbytes, # current time step nbytes 'units': var.units,