Skip to content

Commit 520e679

Browse files
sbryngelsonclaude
andcommitted
Validate both family and attribute for compound params
Tighten compound-param validation to require both a known family prefix and a known attribute. Immediately caught two doc bugs: z_comain -> z_domain typo, model%%filepath -> model_filepath. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 62a6583 commit 520e679

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

docs/documentation/case.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -997,7 +997,7 @@ When ``cyl_coord = 'T'`` is set in 3D the following constraints must be met:
997997

998998
- `z_domain%beg = 0` sets the azimuthal starting point to 0
999999

1000-
- `z_comain%end = 2*math.pi` to set the azimuthal ending point to $2\pi$ (note, requires `import math` in the case file)
1000+
- `z_domain%end = 2*math.pi` to set the azimuthal ending point to $2\pi$ (note, requires `import math` in the case file)
10011001

10021002
When ``cyl_coord = 'T'`` is set in 2D the following constraints must be met:
10031003

@@ -1087,7 +1087,7 @@ This boundary condition can be used for subsonic inflow (`bc_[x,y,z]%[beg,end]`
10871087
| 18 | 2D Varcircle | 2 | Y | Requires `[x,y]_centroid`, `radius`, and `thickness` |
10881088
| 19 | 3D Varcircle | 3 | Y | Requires `[x,y,z]_centroid`, `length_z`, `radius`, and `thickness` |
10891089
| 20 | 2D Taylor-Green Vortex | 2 | N | Requires `[x,y]_centroid`, `length_x`, `length_y`, `vel(1)`, and `vel(2)` |
1090-
| 21 | Model | 2 & 3 | Y | Imports a Model (STL/OBJ). Requires `model%%filepath`. |
1090+
| 21 | Model | 2 & 3 | Y | Imports a Model (STL/OBJ). Requires `model_filepath`. |
10911091

10921092
The patch types supported by the MFC are listed in table [Patch Types](#patch-types).
10931093
This includes types exclusive to one-, two-, and three-dimensional problems.

toolchain/mfc/lint_docs.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,13 +130,13 @@ def _is_valid_param(param: str, valid_params: set, sub_params: set) -> bool:
130130
if base in valid_params or base in sub_params:
131131
return True
132132

133-
# Check sub-param part after %
133+
# Compound params (with %): validate both family prefix and attribute
134134
if "%" in param:
135135
sub = param.split("%")[-1]
136-
if sub in sub_params:
137-
return True
136+
family_ok = any(p.startswith(base + "%") for p in valid_params)
137+
return family_ok and sub in sub_params
138138

139-
# Family prefix check (only accept at a boundary to avoid prefix-typo matches)
139+
# Simple params: family prefix check at structural boundaries
140140
if any(p.startswith(base + b) for b in ("(", "%", "_") for p in valid_params):
141141
return True
142142

0 commit comments

Comments
 (0)