Skip to content

Update to Python3 and simple test file#3

Open
mars20 wants to merge 3 commits into
mfitzp:masterfrom
mars20:master
Open

Update to Python3 and simple test file#3
mars20 wants to merge 3 commits into
mfitzp:masterfrom
mars20:master

Conversation

@mars20

@mars20 mars20 commented Sep 8, 2020

Copy link
Copy Markdown

Updated the code to make it compatible with Python3
test_wine.py is a simple test program

mars20 and others added 3 commits March 29, 2018 13:42
Some behaviour changes in python3 were
incompatibe with the current version.
This commit fixes these issues.
@NichVC

NichVC commented Dec 2, 2020

Copy link
Copy Markdown

I think I've encountered another bug with this Python3 version when using the 'average2' alignment. I got a:

“TypeError: object of type 'int' has no len()” from line 595 of icoshift.py:
if len(ref_w) == 0 or ref_w.shape[0] == 0:

The error was fixed by changing "len(ref_w)" to "ref_w".

I'm rather new to github, so not entirely sure how I branch/merge this fix.

@acmoudleysa

Copy link
Copy Markdown

Your code seems to work. The only bug I found was this (not sure if it's a bug tbh)

In line 678.
Instead of

ind_blocks = numpy.array([0, numpy.cumsum(ind_blocks, 0)], dtype=ind_blocks.dtype).flatten()

Making 0 a numpy array works for me.

numpy.array([numpy.array([0]),numpy.cumsum(ind_blocks, 0)], dtype=ind_blocks.dtype).flatten()

I feel the variable names need to be changed throughout the script.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants