Repository navigation
Conversation
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>
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.
Failure
The Development Pipeline on
mainfails in two places:Set up Python 3.9before 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 logValueError: Cannot modify read-only array. pandas 3 returns read-only arrays fromIndex.valuesand, with copy-on-write, fromSeries.values.loadPolarFile,hawc2ToBeamDynand bothremap_dfcopies rename columns by writing intodf.columns.values, andCactusFile.timeDataToOpenFASTwrites intodf[col].values. Python 3.11 job on the first push of this PRChange
ubuntu-24.04, which has a published Python 3.9.25 Linux x64 build. Upgradeactions/setup-pythonto v6 for the current hosted runner runtime. Python build · Setup action release notesdf.columnsinairfoils/polar_file.py,converters/hawc2ToBeamDyn.py,postpro/postpro.pyandtools/pandalib.py. Inio/cactus_file.py, copy the second power sample into the first withiloc.postpro/tests/test_remap.pyfor the renaming in bothremap_dfcopies.Verification
python -m unittest discoveron Windows:mainmainwith pandas 3.1.1.mainunder pandas 2.3.3, with both pandas 3.1.1 and 2.3.3;mainraises under pandas 3.1.1.git diff --checkpass.Codex assisted with the workflow change. The pandas 3 fix was prepared with Claude Code.
🤖 Generated with Claude Code