Fix #3431: Add missing str() cast in write_ElastoDynBlade - #3434
Closed
andrew-platt wants to merge 1 commit into
Closed
Fix #3431: Add missing str() cast in write_ElastoDynBlade#3434andrew-platt wants to merge 1 commit into
andrew-platt wants to merge 1 commit into
Conversation
- Fix TypeError when concatenating string with integer for blade file key - Add str() cast around (bldInd+1) on line 620 - Resolves crash in writer.execute() when writing ElastoDyn blade files Co-authored-by: GitHub Copilot <noreply@github.com> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
Collaborator
Author
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.
Ready to merge
Feature or improvement description*
This PR fixes a TypeError in
FAST_writer.pywhen writing ElastoDyn blade files with a blade index. The issue occurred at line 620 where string concatenation with an integer was performed without proper type casting.Changes:
str()cast around(bldInd+1)to properly convert integer to string before concatenationwriter.execute()whenwrite_ElastoDynBlade()is called with a blade index parameterRelated issue, if one exists
Fixes #3431
Impacted areas of the software
openfast_io/FAST_writer.py- ElastoDyn blade file writerwrite_ElastoDynBlade()method when writing blade files for indices 1 and 2Additional supporting information
The bug was reported by @jcvem and caused a TypeError when trying to write ElastoDyn blade input files. The issue was that when
bldIndis not None, the code attempted to concatenate a string'BldFile'with an integer(bldInd+1)without converting it to a string first.Before:
After:
Generative AI usage
Co-authored-by: GitHub Copilot noreply@github.com
Co-authored-by: Claude Sonnet 4.5 noreply@anthropic.com
Test results, if applicable
This is a simple type cast fix that does not affect the logic or output of the code, only prevents a runtime error. No regression test updates are expected to be necessary.