Closed lwimala closed 4 years ago
Thanks! I'm not sure I want to officially support Python 2, since there might be other minor bugs / incompatibilities that I'm unaware of.
I added a warning statement for anyone using Python 2, see - https://github.com/ahwillia/affinewarp/commit/95e91958f36fc69042754618d44f0f97f1f91f97
Hi Alex!
I just wanted to raise this as a GitHub issue since Python2 is deprecated, but the fix to make the function compatible is pretty trivial.
To highlight the issue I ran into,
ShiftWarping
to the data (and the results made sense)PiecewiseWarping
with n_knots=0 (linear timewarping), but the output did not make sense.I dove into the code and found that in
piecewisewarp.py
, the functiondensewarp
has this line (Line 557, https://github.com/ahwillia/affinewarp/blob/master/affinewarp/piecewisewarp.py#L557) :In Python2, this line results in integer division which results in
x=0
for all indices inT
except for the last index (x=1
). To fix this, I simply did:This is not an issue in Python 3, as this line does not result in integer division But I just wanted to give you a heads up in case you wanted to make the change to the code since it is forward-compatible with Python3. Thanks!
Best,
Lahiru