MaximeVH / EquivalentCircuits.jl

A julia package to either fit the parameters of a specified equivalent electrical circuit to electrochemical impedance data, or to suggest a plausible circuit configuration for a given set of measurements (either through a comparison of circuits from the literature, or through an evolutionary algorithm approach).
MIT License
22 stars 6 forks source link

Hardcoded literal "3" in `circuit_evolution`'s `removeredundancy` #29

Closed ma-sadeghi closed 11 months ago

ma-sadeghi commented 11 months ago

Hi, quick question: why's there a hardcoded "3" in the following snippet?

https://github.com/MaximeVH/EquivalentCircuits.jl/blob/7ecc804e196b466164093a55d9ece61c1340b767/src/CircuitEvolution.jl#L231-L233

MaximeVH commented 11 months ago

The redundancy removal is relatively computationally intensive and not all potential circuits in the population perform well enough to merit checking for redundant components. I chose 3 as an appropriate value trading off computational complexity with the need for finding simple well-performing circuits. I suppose I could turn this value into an optional argument if necessary

ma-sadeghi commented 11 months ago

Thanks for the explanation. I understand now. It's just that (for debugging purposes) I set population_size = 2, which broke the code, since it was trying to reach into population[3].