From 70e9eb8fc834e4aeff42c221c04c9713eb465b8a Mon Sep 17 00:00:00 2001 From: Gerrit Holl Date: Fri, 16 Nov 2018 16:40:02 +0000 Subject: [PATCH] add missing , and article in error message (#2557) Add missing , and article in error message when attribute values have the wrong type. --- xarray/backends/api.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xarray/backends/api.py b/xarray/backends/api.py index ca440872d73..c1ace7774f9 100644 --- a/xarray/backends/api.py +++ b/xarray/backends/api.py @@ -113,7 +113,7 @@ def check_name(name): def _validate_attrs(dataset): - """`attrs` must have a string key and a value which is either: a number + """`attrs` must have a string key and a value which is either: a number, a string, an ndarray or a list/tuple of numbers/strings. """ def check_attr(name, value): @@ -128,8 +128,8 @@ def check_attr(name, value): if not isinstance(value, (basestring, Number, np.ndarray, np.number, list, tuple)): - raise TypeError('Invalid value for attr: {} must be a number ' - 'string, ndarray or a list/tuple of ' + raise TypeError('Invalid value for attr: {} must be a number, ' + 'a string, an ndarray or a list/tuple of ' 'numbers/strings for serialization to netCDF ' 'files'.format(value))