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

Error: Unsipported locale settings #151

Open
NilsBuett opened this issue Apr 23, 2024 · 10 comments
Open

Error: Unsipported locale settings #151

NilsBuett opened this issue Apr 23, 2024 · 10 comments

Comments

@NilsBuett
Copy link

Hello,

I try doing:

extract(filetype="eclab.mpt", path="myfile.mpt")

and get:
Error: unsupported locale setting

My data file contains data decimal separator as comma. This should be changed to dots.

Thank you in advance :)

@PeterKraus
Copy link
Contributor

PeterKraus commented Apr 25, 2024

Hello Nils, glad you made it here :)

Could you let me know more info about your set-up - which platform, which locale (or LC_NUMERIC to be exact)?

@NilsBuett
Copy link
Author

Hello Peter,

I am working on windows 11 (if that is your question about the platform).
I get the following terminal outpurt when I ask about locale.

LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_ALL=

@PeterKraus
Copy link
Contributor

Hi Nils,
That's strange. Are you using WSL to run yadg? It looks like you only have the en_US locale installed, but that's also the Linux/UNIX locale, not a Windows one (those are something like English_United States).

I think the current solution within yadg using the locale module might not be ideal, as it requires the appropriate locales to be generated, and has side effects. You can generate the German one using:

sudo locale-gen de_DE.UTF-8 en_GB.UTF-8

And then maybe it would work. However, I have an idea on how to fix it properly using babel instead of locale.

If possible, could you share the file with me? If you don't want to have it publicly shared, please send it to me at peter.kraus@tu-berlin.de.

@NilsBuett
Copy link
Author

Hello Peter,

I have send you an e-mail with the data file.

@PeterKraus
Copy link
Contributor

Thanks Nils, I'll try to have a look as soon as possible.

This was referenced May 17, 2024
@PeterKraus
Copy link
Contributor

Hi @NilsBuett, your files should work now. Please try installing the current master version of yadg, using:

pip install git+https://github.com/dgbowl/yadg.git

and then you should be able to extract your data as a xarray.Dataset:

from yadg.extractors import extract
ds = extract(filetype="eclab.mpt", path=..., locale="de_DE")

Finally, before closing the issue, please let me know if it works and if I can add your mpt file into the public test database; if you also have the mpr file from which the mpt was generated, that would be very helpful.

@NilsBuett
Copy link
Author

Hello Peter,

today I had a deeper view on the results. Unfortunately, the current header name is not given, it is empty. That is for now the only problem I recognized.

@PeterKraus
Copy link
Contributor

@NilsBuett I don't follow - what current header?

@PeterKraus PeterKraus reopened this May 28, 2024
@NilsBuett
Copy link
Author

@PeterKraus It was my mistake. I have overlooked something.
At some files I get and KeyError: "Analog OUT/V"

This may be an Ec-Lab problem that is newer than 11.50...

@PeterKraus
Copy link
Contributor

Analog OUT is not defined as a known column for mpt files, yet, so the code crashes with a KeyError. Probably added in 11.50, or we have not seen it in our test files, yet. It's a fairly easy fix, you will have to add it in this file:

"|Zwe-ce|/Ohm": ("|Zwe-ce|", "Ω"),
"Analog IN 1/V": ("Analog IN 1", "V"),
"Analog IN 2/V": ("Analog IN 2", "V"),
"Capacitance charge/µF": ("Capacitance charge", "µF"),

Feel free to make a PR!

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

2 participants