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

Allow float input to BaseCircuit.predict function #304

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

adrianusler
Copy link
Contributor

@adrianusler adrianusler commented Aug 16, 2024

I have made a small change to the BaseCircuit.predict function that now allows both floats and lists/arrays are inputs.

frequencies = (
    np.array([frequencies], dtype=float) if isinstance(frequencies, float)
    else np.array(frequencies, dtype=float)
)

So now, one can predict impedances at a single frequency (say, 10.) by calling

Z = <circuit object>.predict(10.)

Closes #277.

@mdmurbach mdmurbach self-requested a review August 27, 2024 04:46
@coveralls
Copy link

coveralls commented Sep 23, 2024

Pull Request Test Coverage Report for Build 10994591777

Details

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 99.883%

Totals Coverage Status
Change from base Build 10823700912: 0.0%
Covered Lines: 854
Relevant Lines: 855

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BaseCircuit.predict() won't take float as input
2 participants