From 97392845c0883db810617132f641a0e3b2fa78e1 Mon Sep 17 00:00:00 2001 From: Sander Roet Date: Tue, 20 Jul 2021 18:03:44 +0200 Subject: [PATCH] Update types.py (#1503) * Update types.py import Iterable from collections.abc * add name to authors and add changelog entry --- doc/source/CHANGELOG.rst | 2 ++ pyemma/util/types.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/source/CHANGELOG.rst b/doc/source/CHANGELOG.rst index 23628ba66..24ae2cf1c 100644 --- a/doc/source/CHANGELOG.rst +++ b/doc/source/CHANGELOG.rst @@ -14,6 +14,8 @@ Changelog - serialization: fixed bug in function which checked for h5 serialization options. - :code:`n_jobs` is handled consistently, allows only for :code:`None` or positive integers and when determined from hardware, falls back to logical number of cpus. :pr:`1488` +- import from :code:`collections.abc` instead of base :code:`collections` + :pr:`1503` - Use :code:`int` instead of :code:`numpy.int` to solve :code:`numpy` 1.20 DeprecationWarning :pr:`1504` diff --git a/pyemma/util/types.py b/pyemma/util/types.py index 3c26fb573..4a35e93ed 100644 --- a/pyemma/util/types.py +++ b/pyemma/util/types.py @@ -140,7 +140,7 @@ def is_string(s): return isinstance(s, str) def is_iterable(I): - return isinstance(I, collections.Iterable) + return isinstance(I, collections.abc.Iterable) def is_list(S): # FIXME: name states check for list, but checks for tuple __and__ list. Thats confusing.