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

fix: powerfactor nan if ratedpower is zero #96

Closed
SebastianDD opened this issue Dec 13, 2023 · 0 comments · Fixed by #97
Closed

fix: powerfactor nan if ratedpower is zero #96

SebastianDD opened this issue Dec 13, 2023 · 0 comments · Fixed by #97
Assignees
Labels
bug Something isn't working

Comments

@SebastianDD
Copy link
Member

SebastianDD commented Dec 13, 2023

In the case that the rated Power of a load is zero, the powerfactor can not be calculated and will be nan.
pydantic.confloat(ge=0, le=1, allow_inf_nan=True) does not work
pydantic/pydantic-core#1037

  • need to adapt rounded()and weighted_powerfactor()
  • adapt powerfactor test

BTW: con* is marked as deprecated for pydantic v.3 --> use te.Annotated[float, Field(ge=0, le=1, allow_inf_nan=True, strict=True)]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants