You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
fromqmpyimportPhaseDatapd=PhaseData()
pd.read_file("test_phase_data.txt") #this file is attached to this comment
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 thereduce_by_gcd
function in qmpy/utils/string.py relies on a functionfractions.gcd
, which no longer exists in the fractions package.gcd
is only in fractions<3.9, now you must usemath.gcd
. Here is a code example to replicate this bug.test_phase_data.txt
For reference, I am using Python 3.9.13 and qmpy 1.4.0. Thank you!
The text was updated successfully, but these errors were encountered: