NREL / pCrunch

Apache License 2.0
8 stars 11 forks source link

added latin-1 to decode method line 460 of openfast.py #26

Open rclarke17 opened 7 months ago

gbarter commented 7 months ago

Ryan- One of our longer term goals is to combine all of the OpenFAST python utilities into one authoritative repository. Looking at the openfast_toolbox, it assumes the encoding is ascii, but also catches utf-16. Perhaps we should do the same here and that might also fix your issue? I am skeptical of universally setting the latin1 encoding in the code with this change.

rclarke17 commented 7 months ago

Yeah, that seems ideal. Hopefully that will catch the error I was having. Another potential solution could be a try, except block at the encoding to make it more robust. Best, Ryan


From: Garrett Barter @.> Sent: Saturday, February 24, 2024 6:51:33 AM To: NREL/pCrunch @.> Cc: Clarke, Ryan James @.>; Author @.> Subject: [EXTERNAL] Re: [NREL/pCrunch] added latin-1 to decode method line 460 of openfast.py (PR #26)

Ryan- One of our longer term goals is to combine all of the OpenFAST python utilities into one authoritative repository. Looking at the openfast_toolboxhttps://github.com/OpenFAST/openfast_toolbox, it assumes the encoding is asciihttps://github.com/OpenFAST/openfast_toolbox/blob/main/openfast_toolbox/io/fast_output_file.py#L238, but also catches utf-16https://github.com/OpenFAST/openfast_toolbox/blob/main/openfast_toolbox/io/fast_output_file.py#L261. Perhaps we should do the same here and that might also fix your issue? I am skeptical of universally setting the latin1 encoding in the code with this change.

— Reply to this email directly, view it on GitHubhttps://github.com/NREL/pCrunch/pull/26#issuecomment-1962368901, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AVW3JD2GPJQRRR4CEMYNU4DYVHV6LAVCNFSM6AAAAABDXHNQ32VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNRSGM3DQOJQGE. You are receiving this because you authored the thread.Message ID: @.***>

gbarter commented 7 months ago

Hi Ryan- Would you mind trying out the develop branch when you get a free moment? I quickly implemented your suggestion: https://github.com/NREL/pCrunch/compare/master...develop