Coder Social home page Coder Social logo

Comments (5)

bcolsen avatar bcolsen commented on September 11, 2024

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 completely agree!!!

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")

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.

from galvani.

SomePythonUser avatar SomePythonUser commented on September 11, 2024

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.

sample_files.zip

from galvani.

bcolsen avatar bcolsen commented on September 11, 2024

@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.

from galvani.

SomePythonUser avatar SomePythonUser commented on September 11, 2024

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.
small_sample_files.zip

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!

from galvani.

bcolsen avatar bcolsen commented on September 11, 2024

It works really well now. I've tried quite a few different files and I have no issues at all.

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')

I've attached the smallest file, I could find below.

Looks great, thanks!

So, now I just have to stick with this version of EC-Lab, I guess.

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.

from galvani.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.