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

Bug Fix: Correct a misleading error message #622

Merged
merged 6 commits into from Apr 5, 2023

Conversation

RHammond2
Copy link
Collaborator

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 FileNotFoundError and 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.py
    • Farm.check_turbine_type()
  • tests/farm_unit_test.py
    • test_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.

@RHammond2 RHammond2 added the bug Something isn't working label Apr 4, 2023
@RHammond2 RHammond2 requested a review from rafmudaf April 4, 2023 23:28
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
Just a bug fix for the previous commit
@rafmudaf
Copy link
Collaborator

rafmudaf commented Apr 5, 2023

Good catch @RHammond2 and thanks for adding the test!

@rafmudaf rafmudaf self-assigned this Apr 5, 2023
@rafmudaf rafmudaf added this to the v3.4 milestone Apr 5, 2023
@rafmudaf rafmudaf merged commit 6124d2a into NREL:develop Apr 5, 2023
3 checks passed
@rafmudaf
Copy link
Collaborator

rafmudaf commented Apr 5, 2023

Closes #609

@RHammond2 RHammond2 deleted the bug_fix/incorrect-error-message branch May 8, 2023 15:52
@rafmudaf rafmudaf mentioned this pull request May 16, 2023
4 tasks
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 this pull request may close these issues.

None yet

2 participants