-
Notifications
You must be signed in to change notification settings - Fork 30
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
Add support for data module version 3 #35
Comments
I completely agree!!!
Yup this is a bug. Well actually it's not implemented yet. It looks like they made a new version of their undocumented proprietary data format again. So it needs to be reverse engineered again. @SomePythonUser Since I don't have that version yet. It would be a great help if you could attach a zip file to this issue containing the .mpr and the exported .mpt file so I can see what needs to be changed. |
Thanks for your reply. I'm using EC-Lab V11.30. I've attached a zip file with a random .mpt file and the corresponding .mpr file below. |
@SomePythonUser I think I have fixed the problem. It would be great if you could test it as I don't have the new software version. To test:
It would also be great if you could attach a zip file here with a .mpr and .mpt like before only this time for a very short run so the data file would be short enough to include with galvani for testing. |
It works really well now. I've tried quite a few different files and I have no issues at all. I've attached the smallest file, I could find below. So, now I just have to stick with this version of EC-Lab, I guess. Thank you for all your help, and thanks for sharing your work! |
That's great, if you use pandas here's some code that you might find usefull. It cleans up the column names so they can be used with the df.column_name access: def sanitize_labels(label):
return label.split('/')[0].lower().lstrip('-').translate(dict.fromkeys(map(ord, " ,|()-"),'_')).rstrip('_')
mpr = BioLogic.MPRfile("file_name.mpr")
df = pd.DataFrame(mpr.data)
df.columns = [sanitize_labels(label) for label in df.columns]
df['redox'] = mpr.get_flag('ox/red')
Looks great, thanks!
They don't really seem to change the version of the data files that often, so upgrading shouldn't be problem again for a while. |
Hi!
I'm doing my Masters and will probably continue with my PhD working with EC-Lab quite a bit and I've just about had it with the .mpr file format which requires me to export the data manually every single time.
I stumbled upon this seemingly amazing module and I've been trying to import data using the BioLogic.MPRfile function, but I can't seem to get it to work as I get "ValueError: Unrecognised version for data module: 3" when I run
BioLogic.MPRfile("some_file.mpr")
I have some experience with python but mainly as a tool for data analysis, so my troubles may be a result of my very limited Python knowledge.
I was hoping that you might have an idea as to how I could get this module to work so that I may import .mpr files directly into Python.
(I wasn't really sure how to reach out for help here so I opened an issue as I could find no other way of doing so. I'm sorry if this was an inappropriate way of going about it)
The text was updated successfully, but these errors were encountered: