Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
-------
impedance: numpy array of dtype 'complex128'
Predicted impedance
"""
# check that inputs are valid:
# frequencies: array of numbers
assert isinstance(frequencies, np.ndarray),\
'frequencies is not of type np.ndarray'
assert isinstance(frequencies[0], (float, int, np.int32, np.float64)),\
'frequencies does not contain a number'
if self._is_fit() and not use_initial:
return eval(buildCircuit(self.circuit, frequencies,
*self.parameters_,
constants=self.constants, eval_string='',
index=0)[0])
else:
print("Simulating circuit based on initial parameters")
return eval(buildCircuit(self.circuit, frequencies,
*self.initial_guess,
constants=self.constants, eval_string='',
index=0)[0])
-------
impedance: numpy array of dtype 'complex128'
Predicted impedance
"""
# check that inputs are valid:
# frequencies: array of numbers
assert isinstance(frequencies, np.ndarray),\
'frequencies is not of type np.ndarray'
assert isinstance(frequencies[0], (float, int, np.int32, np.float64)),\
'frequencies does not contain a number'
if self._is_fit() and not use_initial:
return eval(buildCircuit(self.circuit, frequencies,
*self.parameters_,
constants=self.constants, eval_string='',
index=0)[0],
circuit_elements)
else:
print("Simulating circuit based on initial parameters")
return eval(buildCircuit(self.circuit, frequencies,
*self.initial_guess,
constants=self.constants, eval_string='',
index=0)[0],
circuit_elements)