Skip to content

capcorrect() voltage validation uses incorrect chained comparison #138

Description

@marcostfermin

Describe the bug

capcorrect() attempts to detect missing voltage inputs using if VLL == VLN == V is None:, which does not correctly test whether all three voltages are None. This can lead to incorrect acceptance or rejection of input combinations.

Reproduction Code

# Setup
import electricpy as ep

# Code which causes failure
# All voltages omitted
ep.capcorrect(Qc=100e3, f=60)

Expected behavior

The function should reliably detect that no voltage was provided and raise a clear ValueError indicating that one of V, VLN, or VLL must be specified.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. Linux]
  • Python Version [e.g. 3.7]
  • Version [e.g. 0.2.1]

Additional context

This should be implemented as:
if (VLL is None) and (VLN is None) and (V is None):.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugSomething isn't working

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions