Skip to content

fix: CableDyn deck reader takes the 0.4.x LINE TYPES grammar - #28

Merged
SMI-Lab-Inha merged 1 commit into
devfrom
fix/cabledyn-deck-grammar
Nov 18, 2026
Merged

SMI-Lab-Inha merged 1 commit into
devfrom
fix/cabledyn-deck-grammar

Conversation

@SMI-Lab-Inha

Copy link
Copy Markdown
Owner

Problem

read_cabledyn_deck rejected LINE TYPES tokens that CableDyn accepts:

Column Token CableDyn Meaning
GJ (14-column row) `GJ K, GJ K
EI `EI Bb, EI -zeta
EI `EI -zeta f1

Reproduction

>>> read_cabledyn_deck("eib.dat")      # EI column 1.99e4|1.0e3
CableSchemaError: eib.dat: EI of bare is not numeric: '1.99e4|1.0e3'
>>> read_cabledyn_deck("lw24g.dat")    # tests/data/cabledyn, accepted and run by CableDyn 0.4.2
CableSchemaError: lw24g.dat: EI of bare is not numeric: '1.99e4|-0.02|0.2|2.0'

While reading CableDyn's parser (append_type, parse_ei_column, parse_gj_column, append_end_connection, append_line, has_numeric_token), I also found several places where CableXSec read a deck differently from CableDyn:

  • Tables by header name, CableDyn by position. CableDyn picks the row form from the token count. An 11-column LINE TYPES row is the 10 columns plus the VIV Cl. CableXSec read a column headed GJ in that position as GJ, while CableDyn refuses the row (checked: malformed LINE TYPES row). Stock-MoorDyn headers (Mass/m, Cd Ca CdAx CaAx) failed with lacks column 'massdeninair'.
  • END CONNECTIONS TorsStiffness Free/Zero counted as restrained. A deck with both ends Free was then refused for want of Twist channels. EndA/End_A were not recognised as End A.
  • Anchor-first swap. A finite-EI line from a Fixed point to a rod end (R<N>A/B) was not swapped, and the restrained torsion ends did not follow a swap.
  • OUTPUTS took the commentary after an END row as channels.

Change

  • LINE TYPES, POINTS, LINES, SECTIONS and END CONNECTIONS are read by position:
    • a row without a number token is a header or units row and is skipped;
    • the token count selects the row form (10/11/13/14/15/17; 5/9; 3/4/7; 4; 6/10/11);
    • every plain numeric column is checked.
  • CableDynLineType keeps the numeric ei_Nm2/gj_Nm2 and the extra parts as CableDyn resolves them: bending_damping_Nm2s, mass_damping_1_s, torque_tension_coupling_Nm, torsional_damping, polar_inertia_kg_m, plus ei_token/gj_token as written.
  • CableDyn's checks apply:
    • 0 < ζ < 1 and positive frequencies;
    • damping, coupling and Bt only on a finite-EI type;
    • K needs a linear-elastic EA, GJ > 0 and K² < EA·GJ;
    • Bt needs GJ > 0 and Irn > 0.
  • Where a token changes what CableXSec relies on. Bending damping, Rayleigh damping and Bt act inside CableDyn's dynamics, so they are already in the histories the reader reconstructs; they are recorded, not used. K changes the material frame: a line solved in torsion twists as it stretches (Twist = −Σ (K/GJ)(l − L) with one end free; CableDyn notes Twist1 = −7.7e-3 deg for lw24g). The twist-free frame the reader uses without Twist channels would be wrong, so a coupled line restrained at either end now needs its Twist channels, and section_channels lists Twist/Torq for a line restrained at either end. Without coupling, a line restrained at one end keeps the documented behaviour: Twist is used when written.
  • END CONNECTIONS: Free/Zero/0 leave an end free; Rigid/Infinity/Inf or a positive stiffness restrain it; anything else is refused. CableDynLine.torsion_restrained_ends records the restrained ends in public order.
  • Smaller grammar items:
    • a rod-end swap for finite-EI lines;
    • an END row closes OUTPUTS;
    • a quoted token may hold spaces;
    • a D exponent is read as an exponent;
    • a duplicate line type or line id is refused;
    • NumSegs/ids must be integers, so a CableSchemaError replaces the bare ValueError.

Validation

tests/data/cabledyn/lw24g.* (about 46 KB) is real CableDyn 0.4.2 output (development build 4b94321). The deck is lw24 with:

  • Rayleigh EI|-zeta|f1|f2 and EI|Bb;
  • 14-column rows with GJ|K|Bt (negative and positive Bt);
  • End A EndA … TorsStiffness Rigid;
  • an END row in OUTPUTS.

test_real_cabledyn_run_with_damped_coupled_line_types checks:

  • the resolved values;
  • the twist history against the Twist channels;
  • that the run without Twist channels is refused, and is read once K = 0.

Unit tests cover every EI/GJ form and error, positional reading, quoted names, the torsion tokens and the swap.

Gates

  • ruff check / ruff format --check (CI command), mypy: clean
  • pytest with numba: 4513 passed, 3 skipped
  • pytest with CABLEXSEC_DISABLE_NUMBA=1: 4399 passed, 117 skipped
  • run_validation.py --check: not stale; taxonomy full_scale 33 → 34 (analytical_sanity 1190, independent_method 76 unchanged); registered FAIL rows as before

read_cabledyn_deck rejected GJ|K and GJ|K|Bt in the GJ column
(torque-tension coupling and torsional damping, CableDyn 0.4.0) and
EI|Bb, EI|-zeta|f and EI|-zeta|f1|f2 in the EI column (bending and
Rayleigh damping) as "not numeric", so no deck using them could be read.
The line type now keeps the numeric EI and GJ and the extra parts as
CableDyn resolves them (bending_damping_Nm2s, mass_damping_1_s,
torque_tension_coupling_Nm, torsional_damping, polar_inertia_kg_m, and
the columns as written), with CableDyn's checks.

The tables are read by position, as CableDyn reads them, instead of by
header name: a row without a number token is a header or units row and
the token count selects the row form. An 11-column LINE TYPES row is the
10 columns and the VIV Cl, so a header naming its last column GJ no
longer turns Cl into a GJ, and stock-MoorDyn headers read.

END CONNECTIONS TorsStiffness Free, Zero or 0 now leaves the end free in
torsion (any token but none, - and 0 restrained it), EndA/End_A name
End A, and the restrained ends follow the anchor-first swap
(CableDynLine.torsion_restrained_ends). A finite-EI line from a Fixed
point to a rod end is swapped as CableDyn swaps it, an END row closes
the OUTPUTS list, a quoted name may hold spaces, exponents may be
written with D, and a duplicate line type or line id is refused.

A line solved in torsion whose type couples torque and tension twists as
it stretches, so read_cabledyn_sections needs its Twist channels even
when only one end is restrained, and section_channels lists Twist/Torq
for a line restrained at either end.

tests/data/cabledyn/lw24g.* is a CableDyn 0.4.2 run (development build
4b94321) of a deck with these tokens: Rayleigh and Kelvin-Voigt bending
damping, GJ|K|Bt, End A restrained in torsion, END in OUTPUTS.

Signed-off-by: Jae Hoon Seo <jaehoon.seo@inha.ac.kr>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-17T23:50:11.519516Z 8c84d96 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@SMI-Lab-Inha

Copy link
Copy Markdown
Owner Author

@codex review

@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 CableXSec | 🛠️ Build #35970534 | 📁 Comparing 8c84d96 against latest (240bf9c)

  🔍 Preview build  

19 files changed · ± 19 modified

± Modified

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: 8c84d96a03

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@SMI-Lab-Inha
SMI-Lab-Inha merged commit 173a612 into dev Nov 18, 2026
12 checks passed
SMI-Lab-Inha added a commit that referenced this pull request Nov 18, 2026
Brings in #28. The full_scale taxonomy count becomes 35 passed: 34 on
dev plus the Su 35 kV analytical-model test registered here.

Signed-off-by: Jae Hoon Seo <jaehoon.seo@inha.ac.kr>
@SMI-Lab-Inha
SMI-Lab-Inha deleted the fix/cabledyn-deck-grammar branch November 18, 2026 05:15
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