Fix logic error in StaticSourceManager intialization.
authorM. Eric Irrgang <ericirrgang@gmail.com>
Mon, 14 Oct 2019 09:27:30 +0000 (12:27 +0300)
committerEric Irrgang <ericirrgang@gmail.com>
Tue, 15 Oct 2019 14:54:23 +0000 (16:54 +0200)
`dict` inputs are Iterable, but are not the sort of sequence type that
we were trying to catch as ambiguous (in terms of data shape).

Change-Id: I71b79c7389197a0750d21874bf6f7cb3fef7721b

python_packaging/src/gmxapi/operation.py

index 9bd088a7edd392204c6e38a90848598fbdb58d91..7c31bd1654f604e314f355cddca9ce5d27561825 100644 (file)
@@ -850,7 +850,7 @@ class StaticSourceManager(SourceResource[_OutputDataProxyType, _PublishingDataPr
                 dtype = datamodel.NDArray
                 data = [datamodel.ndarray(self._result)]
             elif isinstance(self._result, collections.abc.Iterable):
-                if not isinstance(self._result, (str, bytes)):
+                if not isinstance(self._result, (str, bytes, dict)):
                     raise exceptions.ValueError(
                         'Expecting width 1 but "function" produced iterable type {}.'.format(type(self._result)))
                 else: