-
Notifications
You must be signed in to change notification settings - Fork 20
Description
Describe the bug
acpiv() validates inputs using if S == I is None:, which is a chained comparison equivalent to (S == I) and (I is None). This is not the intended “too few args” check and can let invalid argument combinations slip through (or behave inconsistently).
https://electricpy.readthedocs.io/en/latest/_modules/electricpy.html
Reproduction Code
# Setup
import electricpy as ep
# Code which causes failure
# Only S is provided; I and voltages are missing.
# This should be rejected early as "too few arguments" / insufficient specification,
# but the current check is not actually checking "S is None and I is None".
try:
ep.acpiv(S=550)
except Exception as e:
print("Raised:", type(e).__name__, e)
else:
print("No exception raised (unexpected for insufficient inputs).")Expected behavior
A clear, deterministic validation error for insufficient inputs (e.g., ValueError) before later operations attempt to use missing values.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
- OS: [e.g. Linux]
- Python Version [3.11.6]
- Version [0.4.0]
Additional context
That line should almost certainly be something like:
if (S is None) and (I is None): ...
(or a fuller validation that enforces “exactly two of {S, I, V*} must be provided”, etc.).