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

PhaseData's read_file function relies on old version of fractions #141

Open
jayspendlove opened this issue Jun 2, 2022 · 1 comment
Open

Comments

@jayspendlove
Copy link

I am trying to read phase data from a .txt file into a PhaseData object, which throws an error AttributeError: module 'fractions' has no attribute 'gcd'. This is because the reduce_by_gcd function in qmpy/utils/string.py relies on a function fractions.gcd, which no longer exists in the fractions package. gcd is only in fractions<3.9, now you must use math.gcd. Here is a code example to replicate this bug.

from qmpy import PhaseData

pd = PhaseData()
pd.read_file("test_phase_data.txt") #this file is attached to this comment

test_phase_data.txt

For reference, I am using Python 3.9.13 and qmpy 1.4.0. Thank you!

@jayspendlove
Copy link
Author

I switched to using Python 3.7 in my environment which is supported, and it is working. So I suppose this comment is for a future upgrade.

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

1 participant