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

Improve error check for FlorisModel merge function #1044

Merged
merged 2 commits into from
Dec 9, 2024

Conversation

rafmudaf
Copy link
Collaborator

@rafmudaf rafmudaf commented Dec 5, 2024

Expand error checking

The FlorisModel.merge_floris_models function currently checks the input argument's first element for the correct type, but it requires that all elements be of the same type. See #866 (comment).

This pull request adds a unit test to show that this error is not currently caught. However, another error is raised since the function will proceed assuming that all elements in the list are FlorisModel. Then, the pull request modifies the error checking line to ensure all elements are indeed FlorisModel.

@rafmudaf
Copy link
Collaborator Author

rafmudaf commented Dec 5, 2024

I've opened this pull request prior to committing the fixed lines of code so that reviewers can see the red X followed by the green tick in the checks. The first commit exposes the issue in the tests, and the following commit fixes the issue.

@rafmudaf rafmudaf marked this pull request as ready for review December 5, 2024 18:52
@rafmudaf rafmudaf requested a review from misi9170 December 5, 2024 18:52
Copy link
Collaborator

@misi9170 misi9170 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @rafmudaf !

@misi9170 misi9170 merged commit a3620f5 into NREL:develop Dec 9, 2024
11 checks passed
@rafmudaf rafmudaf deleted the merge_models branch December 10, 2024 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants