Skip to content

Found and fixed a type cast missing in FAST_writer.py - #3435

Merged
andrew-platt merged 1 commit into
OpenFAST:rc-5.0.1from
jcvem:jcvem-PR
Aug 18, 2026
Merged

Found and fixed a type cast missing in FAST_writer.py#3435
andrew-platt merged 1 commit into
OpenFAST:rc-5.0.1from
jcvem:jcvem-PR

Conversation

@andrew-platt

@andrew-platt andrew-platt commented Aug 17, 2026

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 -- reported and fixed by @jcvem

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
None

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.

At L:620 of FAST_writer.py contains a str + int type error. Patched with the missing str() casting function
@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 andrew-platt added the Type: IO Readers/Writers Input file readers and writers label Aug 17, 2026
@andrew-platt
andrew-platt merged commit 74b2e4d into OpenFAST:rc-5.0.1 Aug 18, 2026
38 of 39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: IO Readers/Writers Input file readers and writers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants