From 7ba6ada5cbb97a277b892abb29686e36d7692bfe Mon Sep 17 00:00:00 2001 From: Karthikeyan Singaravelan Date: Mon, 21 Mar 2022 13:00:50 +0000 Subject: [PATCH] Import ABC from collections.abc for Python 3.10 compatibility. --- pypot/utils/trajectory.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pypot/utils/trajectory.py b/pypot/utils/trajectory.py index ea82ab9f..fa09fa66 100644 --- a/pypot/utils/trajectory.py +++ b/pypot/utils/trajectory.py @@ -1,7 +1,7 @@ import numpy -import collections +import collections.abc import pypot.utils.pypot_time as time from ..utils.stoppablethread import StoppableLoopThread @@ -42,7 +42,7 @@ def get_value(self, t): return self._mygenerator[-1](t) def domain(self, x): - if not isinstance(x, collections.Iterable): + if not isinstance(x, collections.abc.Iterable): x = numpy.array([x]) return numpy.array([ @@ -54,7 +54,7 @@ def test_domain(self, x): return [((numpy.array(x) >= self.durations[i])) for i in range(len(self.durations) - 1)] def fix_input(self, x): - return x if isinstance(x, collections.Iterable) else numpy.array([0, x]) + return x if isinstance(x, collections.abc.Iterable) else numpy.array([0, x]) def get_generator(self): return lambda x: numpy.piecewise(x, self.domain(x), [self._generators[j] for j in range(len(self._generators))] + [self.finals[-1]])