Closed rfcordeiro closed 10 months ago
The fix is still incorrect. In my fork I fixed this as follows:
def plural_s(number):
return "" if number == 1 else "s"
The reason being that we do not expect number
to be less than 0 but if it is 0 exactly it should get the plural s. In english (as in german aswell) the count of 0 is plural not singular.
0 lines 1 line 2 lines […]
This would be updated once #2212 is merged.
Bug report checklis
[X] Searched the issues page for similar reports
[X] Read the relevant sections of the documentation
[X] Browse the tutorials and tests for usefull code snippets and examples of use
[X] Reproduced the issue after updating with
pip install --upgrade pandapower
(orgit pull
)[X] Tried basic troubleshooting (if a bug/error) like restarting the interpreter and checking the pythonpath
Reproducible Example
Issue Description and Traceback
I have identified a bug in the plural_s function within the pandapower project. The issue arises when attempting to pluralize a word based on a given number. The current implementation provides an incorrect pluralization when the number is greater than 1. The expected behavior is to return an "s" when the number is greater than 1, indicating the plural form, but the current implementation returns an empty string when the number is less than 1 but "s" when 1 or less.
In code this is where the bug is:
Supposed to be:
Expected Behavior
The expected behavior is to return an "s" when the number is greater than 1, indicating the plural form, but the current implementation returns an empty string when the number is less than 1 but "s" when 1 or less
Installed Versions
Any
Label