Bug Fix: Correct a misleading error message#622
Merged
rafmudaf merged 6 commits intoNatLabRockies:developfrom Apr 5, 2023
Merged
Bug Fix: Correct a misleading error message#622rafmudaf merged 6 commits intoNatLabRockies:developfrom
rafmudaf merged 6 commits intoNatLabRockies:developfrom
Conversation
Makes it more obvious that the turbine-type used in this unit test is meant to be nonexisted. "nrel_15mw" is very close to "nrel_5mw".
This is a more explicit and clear pattern
rafmudaf
approved these changes
Apr 5, 2023
Just a bug fix for the previous commit
Collaborator
|
Good catch @RHammond2 and thanks for adding the test! |
Collaborator
|
Closes #609 |
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.
Bug Fix: Correct a misleading error message for external library checking
This PR is a small correction to an error message that was duplicated, but left unchanged, that incorrectly states an unfound file exists in both locations. The new error is now a
FileNotFoundErrorand indicates that the turbine file unable to be found in either the internal or external turbine library. Additionally, I've added a test to ensure the correct error is raised when a turbine can't be located.Related issue
N/A: I made the fix instead of submitting an issue and a fix.
Impacted areas of the software
floris/simulation/farm.pyFarm.check_turbine_type()tests/farm_unit_test.pytest_farm_external_library()Additional supporting information
The duplication of the error is extremely confusing when you're working with an external library that is missing a file, but it indicates that it's located in both libraries. After spending too much time getting to the bottom of it, I figured I'd make someone else's life easier in the process instead of patching it in my own workflow.
Test results, if applicable
All the tests pass.