Skip to content

Fix the CI matrix: Python 3.9 runner and pandas 3 read-only arrays - #90

Open
maoji-y wants to merge 2 commits into
OpenFAST:mainfrom
maoji-y:fix-python39-runner
Open

maoji-y wants to merge 2 commits into
OpenFAST:mainfrom
maoji-y:fix-python39-runner

Conversation

@maoji-y

@maoji-y maoji-y commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Failure

The Development Pipeline on main fails in two places:

  1. The Python 3.9 entry runs on the Ubuntu 26.04 image and fails at Set up Python 3.9 before running the tests. The same setup failure appears in Fix MoorDyn v2 table replacement in case generation #88 and Read uncompressed binary outputs (FileID 3) without scaling #89. Main-branch job log
  2. The other entries install pandas 3.1.1, where 11 tests error with ValueError: Cannot modify read-only array. pandas 3 returns read-only arrays from Index.values and, with copy-on-write, from Series.values. loadPolarFile, hawc2ToBeamDyn and both remap_df copies rename columns by writing into df.columns.values, and CactusFile.timeDataToOpenFAST writes into df[col].values. Python 3.11 job on the first push of this PR

Change

  • Run the Python 3.9 matrix entry on ubuntu-24.04, which has a published Python 3.9.25 Linux x64 build. Upgrade actions/setup-python to v6 for the current hosted runner runtime. Python build · Setup action release notes
  • Build the renamed column list and assign it to df.columns in airfoils/polar_file.py, converters/hawc2ToBeamDyn.py, postpro/postpro.py and tools/pandalib.py. In io/cactus_file.py, copy the second power sample into the first with iloc.
  • Add postpro/tests/test_remap.py for the renaming in both remap_df copies.

Verification

python -m unittest discover on Windows:

Environment main This branch
Python 3.12, pandas 3.1.1, numpy 2.5.5 92 tests, 11 errors 94 tests pass
Python 3.9, pandas 2.3.3, numpy 2.0.2 92 tests pass 94 tests pass
  • The two new tests fail on main with pandas 3.1.1.
  • The repository has no CACTUS test data. On a synthetic two-blade frame, the power columns from this branch match main under pandas 2.3.3, with both pandas 3.1.1 and 2.3.3; main raises under pandas 3.1.1.
  • Actionlint 1.7.12 and git diff --check pass.

Codex assisted with the workflow change. The pandas 3 fix was prepared with Claude Code.

🤖 Generated with Claude Code

maoji-y and others added 2 commits November 25, 2026 10:13
pandas 3 returns read-only arrays from Index.values and, with
copy-on-write, from Series.values. Renaming columns through
`df.columns.values[i] = ...` raised "Cannot modify read-only array" when
reading polars, converting HAWC2 to BeamDyn and remapping columns, and
the CACTUS conversion raised "assignment destination is read-only".

Build the new column list and assign it to `df.columns`, and set the
CACTUS values with `iloc`. Add tests for the renaming in `remap_df`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@maoji-y maoji-y changed the title Pin the Python 3.9 CI job to Ubuntu 24.04 Fix the CI matrix: Python 3.9 runner and pandas 3 read-only arrays Nov 25, 2026
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