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

Fix/known issues #7

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions PyEIS/PyEIS.py
Original file line number Diff line number Diff line change
Expand Up @@ -4024,7 +4024,7 @@ def EIS_fit(self, params, circuit, weight_func='modulus', nan_policy='raise'):
self.circuit_fit = []
self.fit_E = []
for i in range(len(self.df)):
self.Fit.append(minimize(leastsq_errorfunc, params, method='leastsq', args=(self.df[i].w.values, self.df[i].re.values, self.df[i].im.values, circuit, weight_func), nan_policy=nan_policy, maxfev=9999990))
self.Fit.append(minimize(leastsq_errorfunc, params, method='leastsq', args=(self.df[i].w.values, self.df[i].re.values, self.df[i].im.values, circuit, weight_func), nan_policy=nan_policy, max_nfev=9999990))
print(report_fit(self.Fit[i]))

self.fit_E.append(np.average(self.df[i].E_avg))
Expand Down Expand Up @@ -4698,7 +4698,7 @@ def EIS_plot(self, bode='off', fitting='off', rr='off', nyq_xlim='none', nyq_yli
for i in range(len(self.df)):
ax.plot(self.df[i].re, self.df[i].im, marker='o', ms=4, lw=2, color=colors[i], ls='-', label=self.label_cycleno[i])
if fitting == 'on':
ax.plot(self.circuit_fit[i].real, -self.circuit_fit[i].imag, lw=0, marker='o', ms=8, mec='r', mew=1, mfc='none', label='')
ax.plot([i.real for i in self.circuit_fit[i]], [-i.imag for i in self.circuit_fit[i]], lw=0, marker='o', ms=8, mec='r', mew=1, mfc='none', label='')

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could also use self.circuit_fit[i].to_numpy().real

Copy link

@ZhksB ZhksB May 22, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same problem
self.circuit_fit[i].to_numpy().real fixed it


### Bode Plot
if bode=='on':
Expand Down Expand Up @@ -6023,4 +6023,4 @@ def EIS_sim_fit(self, params, circuit, weight_func='modulus', nan_policy='raise'

#print()
#print('---> PyEIS Core Loaded (v. 0.5.7 - 02/01/19)')
#print()
#print()