Comments (2)
Test code for a single resistor.
from impedance.models.circuits import CustomCircuit
import numpy as np
test_circuit = CustomCircuit(circuit='R_1', initial_guess = [1.0,])
print(test_circuit)
frequency_range = np.linspace(0,100)
test_circuit.predict(frequency_range)
Circuit string: R_1
Fit: False
Initial guesses:
R_1 = 1.00e+00 [Ohm]
Simulating circuit based on initial parameters
---------------------------------------------------------------------------
UnboundLocalError Traceback (most recent call last)
<ipython-input-10-cbc428542153> in <module>
4 print(test_circuit)
5 frequency_range = np.linspace(0,100)
----> 6 test_circuit.predict(frequency_range)
~/Documents/Programs/impedance.py/impedance/models/circuits/circuits.py in predict(self, frequencies, use_initial)
156 *self.initial_guess,
157 constants=self.constants, eval_string='',
--> 158 index=0)[0],
159 circuit_elements)
160
~/Documents/Programs/impedance.py/impedance/models/circuits/fitting.py in buildCircuit(circuit, frequencies, constants, eval_string, index, *parameters)
204 split = parallel
205
--> 206 for i, elem in enumerate(split):
207 if ',' in elem or '-' in elem:
208 eval_string, index = buildCircuit(elem, frequencies,
UnboundLocalError: local variable 'split' referenced before assignment
from impedance.py.
I can replicate this issue locally and it doesn't seem to matter what element is input. I think the issue is we don't have logic for a scenario where neither series nor parallel markers are in the string:
parallel = parse_circuit(circuit, parallel=True)
series = parse_circuit(circuit, series=True)
if series is not None and len(series) > 1:
eval_string += "s(["
split = series
elif parallel is not None and len(parallel) > 1:
eval_string += "p(["
split = parallel
for i, elem in enumerate(split):
from impedance.py.
Related Issues (20)
- [BUG] .append no longer available in pandas > 2.0
- [Element]
- Error in visualization with looping through and fitting multiple data sets HOT 2
- [BUG] Deprecation warnings with Altair v5
- [BUG] Matplotlib warnings when plotting Bode or Nyquist plot HOT 1
- Very confused about fitting HOT 3
- BaseCircuit.predict() won't take float as input
- Confusion with the word "initial_guess" used in CustomCircuit(circuit_string,initial_guess) HOT 1
- Initial_guess HOT 2
- Replace print with proper logging HOT 1
- RC components
- A worked example of .nox Metrohm file reading and pre-processing HOT 3
- high frequency fitting problem HOT 12
- Accuracy of data in .par file about VersaStudio HOT 3
- Ask for help extracting parameter values from fitted circuits HOT 1
- [BUG] error in impedance definition of La-element
- reading data from Excel files
- Circuit Element Unit scalable feature
- Adding Distribution of relaxation times feature HOT 2
- Recommendation for dealing with noisy data?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from impedance.py.