Update ApparentPowerConstraintUtil#3401
Merged
sfeilmeier merged 4 commits intoOpenEMS:developfrom Nov 14, 2025
Merged
Conversation
Codecov Report❌ Patch coverage is ❌ Your patch status has failed because the patch coverage (37.50%) is below the target coverage (75.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## develop #3401 +/- ##
=============================================
- Coverage 59.73% 59.73% -0.00%
Complexity 112 112
=============================================
Files 2866 2866
Lines 123905 123911 +6
Branches 9289 9290 +1
=============================================
+ Hits 74005 74006 +1
+ Misses 47113 47111 -2
- Partials 2787 2794 +7 🚀 New features to boost your workflow:
|
da-Kai
reviewed
Nov 10, 2025
...enems.edge.ess.core/src/io/openems/edge/ess/core/power/data/ApparentPowerConstraintUtil.java
Outdated
Show resolved
Hide resolved
Introduced a utility method isCloseToZero in DoubleUtils for comparing doubles to zero with an epsilon threshold. Updated ApparentPowerConstraintUtil to use this method for division by zero checks, improving code clarity and consistency.
sfeilmeier
approved these changes
Nov 14, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
getConstraintThroughPointsmethod performed division by(p2.x - p1.x)without checking if the denominator equals zero. This could occur when two consecutive points on the apparent power circle have the same x-coordinate (active power).Impact:
InfinityorNaNvaluesFix Implemented
1e-10) for floating-point precisionThe fix ensures the power optimization system can handle all geometric configurations of the apparent power circle without mathematical errors.