Code Monkey home page Code Monkey logo

Comments (5)

BGerwe avatar BGerwe commented on May 29, 2024

The easiest solution seems to be renaming Gs and Ws, but the issue really stems from how p_string is constructed in:

def extract_circuit_elements(circuit):
    extracted_elements = []
    p_string = [x for x in circuit if x not in 'ps(),-/']

from impedance.py.

mdmurbach avatar mdmurbach commented on May 29, 2024

Ah, so it's because we've used s to dictate series...

I think there's an elegant way to do this with regular expressions rather than just ignoring characters, but I haven't played around with it much.

from impedance.py.

mdmurbach avatar mdmurbach commented on May 29, 2024

@BGerwe I think we should just be able to remove s (since it's never in a circuit string, we use -) and / (since we don't us it anymore) from the line you pasted above?

from impedance.py.

BGerwe avatar BGerwe commented on May 29, 2024

That seems to work! Something else I noticed during this, the way elements with >1 parameters is a little confusing now. Ex:

Initial guesses:
    R_0 = 1.00e+01 [Ohm]
  G_1_0 = 1.00e+02 [Ohm]
  G_1_1 = 1.00e-01 [sec]
    W_1 = 5.00e+01 [Ohm sec^-1/2]

But we could have it print as

Initial guesses:
    R_0 = 1.00e+01 [Ohm]
  G_1_p[0] = 1.00e+02 [Ohm]
  G_1_p[1] = 1.00e-01 [sec]
    W_1 = 5.00e+01 [Ohm sec^-1/2]

without changing much. Are you fine with including that in this issue/PR? This acts funny when you define constants so I won't worry about it.

from impedance.py.

mdmurbach avatar mdmurbach commented on May 29, 2024

Yeah, I think the double underline is a bit ugly haha. Maybe it’d be nice to have it be something like latex (I.e. Gs_{1,1}).

This does affect a few things though so probably best for a new PR.

from impedance.py.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.