Skip to content

Fix #3431: Add missing str() cast in write_ElastoDynBlade - #3434

Closed
andrew-platt wants to merge 1 commit into
OpenFAST:rc-5.0.1from
andrew-platt:b/FAST_writer_3431
Closed

Fix #3431: Add missing str() cast in write_ElastoDynBlade#3434
andrew-platt wants to merge 1 commit into
OpenFAST:rc-5.0.1from
andrew-platt:b/FAST_writer_3431

Conversation

@andrew-platt

Copy link
Copy Markdown
Collaborator

Ready to merge

Feature or improvement description*

This PR fixes a TypeError in FAST_writer.py when 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:

  • Added str() cast around (bldInd+1) to properly convert integer to string before concatenation
  • Fixes the crash in writer.execute() when write_ElastoDynBlade() is called with a blade index parameter

Related issue, if one exists

Fixes #3431

Impacted areas of the software

  • openfast_io/FAST_writer.py - ElastoDyn blade file writer
  • Specifically affects the write_ElastoDynBlade() method when writing blade files for indices 1 and 2

Additional 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 bldInd is not None, the code attempted to concatenate a string 'BldFile' with an integer (bldInd+1) without converting it to a string first.

Before:

blade_file = os.path.join(self.FAST_runDirectory,self.fst_vt['ElastoDyn']['BldFile'+(bldInd+1)])

After:

blade_file = os.path.join(self.FAST_runDirectory,self.fst_vt['ElastoDyn']['BldFile'+str(bldInd+1)])

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.

- 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>
@andrew-platt andrew-platt added this to the v5.0.1 milestone Aug 17, 2026
@andrew-platt andrew-platt self-assigned this Aug 17, 2026
@andrew-platt

Copy link
Copy Markdown
Collaborator Author

closing this in preference PR #3435 from @jcvem

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.

1 participant