JohannesBuchner / UltraNest

Fit and compare complex models reliably and rapidly. Advanced nested sampling.
https://johannesbuchner.github.io/UltraNest/
Other
142 stars 30 forks source link

Fix encoding error #75

Closed QZGao closed 1 year ago

QZGao commented 1 year ago

I was trying to install from pip at first and encountered UnicodeDecodeError when build wheels. Then I tried building from source code and found this tiny issue. Even though the codes are all using UTF-8 encoding, some command line tools (e.g. pip) tend to use system default encoding when dealing with I/O, so a encoding="utf-8" helps them stick to the UTF-8.

Changes:

What I've changed is in setup.py with addition of parameter encoding="utf-8" to open().

JohannesBuchner commented 1 year ago

On what operating system did this issue occur?

QZGao commented 1 year ago

Windows 11 22H2. I guess it's more of a region-specific problem since my Windows uses gbk encoding (though I never used any app in such encoding lol)

JohannesBuchner commented 1 year ago

I am wondering though whether there will be runtime issues with the status widget https://github.com/JohannesBuchner/UltraNest/blob/master/ultranest/integrator.py#L2848 as well. Perhaps we need encoding hints at the file headers. Let me know with a new issue.

QZGao commented 1 year ago

The posterior text art works. So no issue now it seems :)

JohannesBuchner commented 3 months ago

Late but better than never: Thank you for your contribution! I added your name to the contributor list in the README.