Repository navigation
op2: read 584-byte PVT0 records as PARAM data and add RVMASS - #880
Merged
Merged
Conversation
A PVT/PVT0/PVTS (PARAM) data record that happens to be exactly 584 bytes long was sent to the table3 parser, which for these tables is _read_pvto_3 and raises. Keep PARAM tables out of the 584-byte table3 check so the record goes to the table4 parser. PARAM,RVMASS,YES (NX) is a string PARAM that was missing from STR_PARAMS_1, so reading it hit an assertion and the PARAM block was skipped. Fixes SteveDoyle2#875
SteveDoyle2
previously approved these changes
Oct 14, 2026
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #880 +/- ##
==========================================
- Coverage 76.18% 76.17% -0.01%
==========================================
Files 1093 1093
Lines 358978 359006 +28
Branches 37051 37051
==========================================
+ Hits 273470 273477 +7
- Misses 75834 75855 +21
Partials 9674 9674
Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
Owner
|
The tests were not run because a new class was created. They are not automatically discovered. New op2 test classes need to be added to pyNastran/op2/test/all_tests.py |
Owner
|
thanks! I appreciate the PR! |
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.
Fixes #875.
Two problems reading NX PARAM data from an OP2:
_read_subtable_3_4treats any 584-byte record as a table3 header. For PVT/PVT0/PVTS the table3 parser is_read_pvto_3, which raises, so an OP2 whose PARAM record happens to be 584 bytes long fails to read. This keeps the PARAM tables out of that check (PARAM_TABLES = {b'PVT', b'PVT0', b'PVTS'}), so the record goes to the table4 parser like any other PARAM record. I kept it to the PARAM tables rather than all ofGEOM_TABLESto keep the change small.PARAM,RVMASS,YESis a string PARAM that was missing fromSTR_PARAMS_1, so_read_pvto_4_helperasserts (word=b'RVMASS') and the PARAM block is skipped. This addsRVMASStoSTR_PARAMS_1.Testing: I added
TestOP2Paramstotest_op2_unit_tests.py:test_pvt0_rvmassreads an RVMASS/AUTOSPC PARAM record. It fails on main withAssertionError: word=b'RVMASS'and passes with this change.test_pvt0_record_of_length_584runs_read_subtable_3_4on a 584-byte PVT0 record with the record reads stubbed. On main the record goes to the table3 parser; with this change it goes to the table4 parser.Both pass. I could not complete a full run of
test_op2_unit_tests.pyortest_op2_bugfixes.pylocally within my time limit, so I am relying on CI for the rest.