Bug fix: Make sure arg of max is not an empty sequence - #11
Closed
MaxGyver83 wants to merge 1 commit into
Closed
Conversation
Owner
|
Good catch, seems like I always used multiple I'd like to propose a different fix, however: Removing the if-check in line 1017. if len(BIGRAMS_CONFIGS) > 1: # <- Remove this check
for config in BIGRAMS_CONFIGS: # <- Always run the loop
originalWeight = config.weight
fullWeightConfig = config.fullWeightClone()
configSpecificData.append(ConfigSpecificResults(
config.name,
originalWeight,
getBigrams(layout, (fullWeightConfig, )),
))This way the issue gets fixed and the output seems a bit more transparent (the user still gets shown which language was used). |
Contributor
Author
|
Your fix looks good. Probably the right way to go. I have tested it and it didn't crash. Then I'll just close my pull request. Thanks for looking deeper into it! |
Owner
|
Okay, I'll push the fix later today, then! |
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.
When I comment out the English and French
BigramsConfigs and set the weight for German to 100% and reduce theNR_OF_BEST_LAYOUTSto 50, the optimizer crashes with this error message:Changes in this pull request:
max()is empty.