Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility with Python 2.7 #7

Open
fbertran opened this issue Jun 5, 2018 · 2 comments
Open

Compatibility with Python 2.7 #7

fbertran opened this issue Jun 5, 2018 · 2 comments

Comments

@fbertran
Copy link

fbertran commented Jun 5, 2018

Greetings

In the midas class code, you use both yield and an non empty return, for instance in the function def batch_yield_samples:

            yield output_df
    return  self

It seems to be a nice feature of Python 3 yet it raises an error with Python 2.7.13. Is it possible to have a work around so that Midas could be used with Python 2.7.13? Indeed, in the readme, you seem to look for Python 2.7 compatibility.

In addition, the copy method is not defined for lists in Python 2.7. In that case the work around is very easy.

-> for that one
import copy
and use copy.copy(list)
instead of list.copy()

Another problem with the softmax loss computation is that it is 0 with P2.7 likely because you divide an int by an int and it is rounded (to 0 in that) to give an int (the remainder of the Euclidean division). In P3.6, I think that it returns a float with the floating point division of the two integers.

Best.

PS: Here is the error you get with Python 2.7.
File "midas.py", line 853
return self
SyntaxError: 'return' with argument inside generator

https://stackoverflow.com/questions/15809296/python-syntaxerror-return-with-argument-inside-generator?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa

@Oracen-zz
Copy link
Owner

I'll leave this open for now. I thought it was compatible (and it was when I tested the original code) but I've basically reworked a lot between now and then. This is absolutely something I'm interested in, I just have a lot of other work on at the moment.

Apologies, and thanks for your patience.

Alex

@tsrobinson
Copy link

tsrobinson commented Apr 27, 2020

Hi @fbertran,

Just to update you on this issue. We have now migrated MIDAS to this new repo where all future updates will be released.

We also now don't anticipate adding Python 2.X support given Python 2 is now at end of life, and receiving limited future support.

Best,
Tom

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

No branches or pull requests

3 participants