Skip to content

Bug Fix: Correct a misleading error message#622

Merged
rafmudaf merged 6 commits intoNatLabRockies:developfrom
RHammond2:bug_fix/incorrect-error-message
Apr 5, 2023
Merged

Bug Fix: Correct a misleading error message#622
rafmudaf merged 6 commits intoNatLabRockies:developfrom
RHammond2:bug_fix/incorrect-error-message

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
rafmudaf added 2 commits April 5, 2023 10:39
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 NatLabRockies:develop Apr 5, 2023
@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.

2 participants