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

Unable to load .mpt file (EIS imported) #4

Open
KamilBUT opened this issue Jul 22, 2020 · 4 comments
Open

Unable to load .mpt file (EIS imported) #4

KamilBUT opened this issue Jul 22, 2020 · 4 comments

Comments

@KamilBUT
Copy link

I am unable to load .mpt file which was previously imported to EC-Lab from .txt hence has no cycle_number column:


AttributeError Traceback (most recent call last)
in
1 from PyEIS import *
2
----> 3 ex1 = EIS_exp(path='EIS/', data=['Imported_EIS.mpt'])

~\miniconda3\lib\site-packages\PyEIS\PyEIS.py in init(self, path, data, cycle, mask)
2241 print('Data file(s) could not be identified')
2242
-> 2243 self.cycleno.append(self.df_raw0[j].cycle_number)
2244 if np.min(self.cycleno[j]) <= np.max(self.cycleno[j-1]):
2245 if j > 0: #corrects cycle_number except for the first data file

~\miniconda3\lib\site-packages\pandas\core\generic.py in getattr(self, name)
5272 if self._info_axis._can_hold_identifiers_and_holds_name(name):
5273 return self[name]
-> 5274 return object.getattribute(self, name)
5275
5276 def setattr(self, name: str, value) -> None:

AttributeError: 'DataFrame' object has no attribute 'cycle_number'

Imported_EIS.txt

If I manually add this column, I am greeted with another error, similar to the error I will discuss in next issue topic.

@n-bock
Copy link

n-bock commented Jul 27, 2020

Hi, does the tutorial work for you?

import PyEIS
ex1 = PyEIS.EIS_exp(path='https://raw.githubusercontent.com/kbknudsen/PyEIS/master/Tutorials/data/', data=['ex1.mpt'])
```

@KamilBUT
Copy link
Author

Yes, it does.
I don't have problems with tutorials .mpt even in my customized code. In this case, there is a problem in EIS_exp function because it's expecting there is a cycle_number column in the .mpt file, which in this case there is not.

You can try to use my EIS. I have attached the file (but had to change it to .txt)

@n-bock n-bock mentioned this issue Jul 27, 2020
@n-bock
Copy link

n-bock commented Jul 27, 2020

Okay, I just submitted a pull request (you can also fetch the master branch from my fork: n-bock/PyEIS) which should help with your issue. You have to modify your text file like this: ex3.txt or you adapt PyEIS_Data_extraction.py line 153ff so they match your txt-file header.

@KamilBUT
Copy link
Author

I was trying to add some predefined arguments to the function as Z_Re='string', Z_Im='string' so it could be easily modified.
Unfortunately, when I tried to call even your original extract_csv function it didn't separate columns at all, however, when I implemented the same thing directly to Jupyter notebook it worked correctly. Dunno why...
image
image

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