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

Column type 168 not implemented #37

Closed
SomePythonUser opened this issue Oct 21, 2019 · 4 comments · Fixed by #38
Closed

Column type 168 not implemented #37

SomePythonUser opened this issue Oct 21, 2019 · 4 comments · Fixed by #38
Assignees

Comments

@SomePythonUser
Copy link

Hi, sorry to bother you again, but I think I may have found another unimplemented feature which is now causing an error.

When I try to load in the attached file, I get "NotImplementedError: column type 168 not implemented".

I am having this same problem with all the data I have recorded today. I didn't update EC-lab or change the parameters of the technique so I find it really odd that the data from today cannot be loaded when all the older data files can.

files.zip

@bcolsen
Copy link
Contributor

bcolsen commented Oct 21, 2019

This should be fixed in #38

There are a lot of unknown columns. We have only found ~50 out of at least 480!

It's pretty easy to fix it if you have the .mtp exported. All I need to add a line at line 178 in Biologic.py with this:

    168: ('Rcmp/Ohm', '<f4'),

It just the column name from the .mpt and the data percision. I added some details to the error to help find the last known column and you can go through the .mtp and get the next column to get the name.

ColIDs:  [4, 19, 6, 11, 24, 434, 39, 441, 168]
Types:  [('time/s', '<f8'), ('control/V', '<f4'), ('Ewe/V', '<f4'), ('I/mA', '<f8'), ('cycle number', '<f8'), ('(Q-Qo)/C', '<f4'), ('I Range', '<u2'), ('<Ecv>/V', '<f4')]
Traceback (most recent call last):

  File "<ipython-input-28-14b3ecdc3f59>", line 1, in <module>
    mpr = MPRfile('../191021_Cu(pc_wire)_CV_2_04_CVA_C01.mpr')

  File "/home/bcolsen/galvani-dev/galvani/BioLogic.py", line 354, in __init__
    self.dtype, self.flags_dict = VMPdata_dtype_from_colIDs(column_types)

  File "/home/bcolsen/galvani-dev/galvani/BioLogic.py", line 251, in VMPdata_dtype_from_colIDs
    raise NotImplementedError("column type %d not implemented" % colID)

NotImplementedError: column type 168 not implemented

The precision is '<f4' if there is 7 decimals in that column of the mpt and '<f8' if there is 14.

It would be great if you could help out with this if you find anymore. But if not another bug report like this would be great 👍

@SomePythonUser
Copy link
Author

Ah, that kinda makes sense.

However, I find that adding that line results in a new error
AssertionError: 9 columns passed, passed data had 10 columns

@bcolsen
Copy link
Contributor

bcolsen commented Oct 22, 2019

AssertionError: 9 columns passed, passed data had 10 columns

This is seem like an error from pandas not galvani. It seem you might be passing the column names to the Dataframe with out including the the new "Rcmp" column. That's why using the this code is helpfull.

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

@SomePythonUser
Copy link
Author

SomePythonUser commented Oct 23, 2019

Ah, you're right. That was stupid -.-

I also think I found two more missing columns:
16: ('Analog IN 1/V', '<f4'),
75: ('Analog OUT/V', '<f4'),

I've attached the relevant files if you'd like to verify that I got it right.

files.zip

If I got it right, I wouldn't mind helping out with it as I run into more missing columns, but I'm not sure I know how to since I basically just created this user on Github in order to contact you here :b

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

Successfully merging a pull request may close this issue.

2 participants