Skip to content

Conversation

mayankchetan
Copy link
Contributor

Feature or improvement description

This PR streamlines how openfast_io reads the outlist's across modules. Additionally, allowing to read the various outlist formats that OpenFAST allows.

Related issue, if one exists

None

Impacted areas of the software

openfast_io

Additional supporting information

Test results, if applicable

openfast_io tests pass locally.

r-test updated to enumerate the various outlets formats: https://github.com/mayankchetan/r-test/tree/ofio_outlist

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR streamlines and generalizes how openfast_io reads module outlists by replacing repetitive parsing blocks with a unified read_outlist function and version-bumping the package.

  • Bumps version from 4.0.4 to 4.0.5 in pyproject.toml
  • Removes hard-coded parsing in multiple readers and calls the new read_outlist helper
  • Updates the submodule pointer for regression tests

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
reg_tests/r-test Updated the submodule commit for r-test
openfast_io/pyproject.toml Bumped package version and removed Python 3.9 classifier
openfast_io/openfast_io/FAST_reader.py Consolidated outlist parsing into read_outlist and added read_outlist_freeForm
Comments suppressed due to low confidence (2)

openfast_io/openfast_io/FAST_reader.py:244

  • [nitpick] The method name read_outlist_freeForm mixes camelCase with snake_case. Consider renaming it to read_outlist_free_form to follow Python’s snake_case convention.
def read_outlist_freeForm(self,f,module):

openfast_io/openfast_io/FAST_reader.py:244

  • There are no tests targeting the new read_outlist_freeForm function. Adding unit tests to cover varied outlist formats (quoted, unquoted, blank lines) would help prevent regressions.
def read_outlist_freeForm(self,f,module):

'''
Replacement for set_outlist that doesn't care about whether the channel is in the outlist vartree
Easier, but riskier because OpenFAST can crash

Inputs: f - file handle
module - of OpenFAST, e.g. SubDyn, SeaState (these modules use this)
'''
all_channels = []
Copy link
Preview

Copilot AI May 22, 2025

Choose a reason for hiding this comment

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

[nitpick] The parsing logic in read_outlist_freeForm largely duplicates the code in read_outlist. Consider extracting the common logic into a shared helper to reduce duplication and improve maintainability.

Copilot uses AI. Check for mistakes.

@andrew-platt andrew-platt added this to the 4.0.5 milestone May 22, 2025
@andrew-platt andrew-platt added the Type: IO Readers/Writers Input file readers and writers label May 22, 2025
@mayankchetan
Copy link
Contributor Author

Reverted the styles "RootMxr", "RootMyr", "RootMzr" and TipTDxr, TipTDyr, TipTDzr since BD and ED don't currently support it. ReadOutputList needs to be updated to handle them in the future.

@andrew-platt andrew-platt merged commit ca406a4 into OpenFAST:rc-4.0.5 May 28, 2025
11 of 12 checks passed
@mayankchetan mayankchetan deleted the ofio_outlist branch May 28, 2025 17:42
@andrew-platt andrew-platt mentioned this pull request Jun 11, 2025
35 tasks
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