|
67 | 67 | # Hardcoded Fortran constants (not case-file params) |
68 | 68 | "init_dir", |
69 | 69 | "zeros_default", |
70 | | - # Enumerated value names used as prose examples (not parameter names) |
71 | | - "hll", |
72 | | - "hllc", |
73 | | - # Analytic expression language: Fortran intrinsics and module name (not case params) |
| 70 | + # Analytic expression language: module name (not a case param) |
74 | 71 | "m_constants", |
75 | | - "sin", |
76 | | - "cos", |
77 | | - "tan", |
78 | | - "asin", |
79 | | - "acos", |
80 | | - "atan", |
81 | | - "atan2", |
82 | | - "sinh", |
83 | | - "cosh", |
84 | | - "tanh", |
85 | | - "exp", |
86 | | - "log", |
87 | | - "log10", |
88 | | - "sqrt", |
89 | | - "abs", |
90 | | - "min", |
91 | | - "max", |
92 | | - "mod", |
93 | | - "sign", |
94 | 72 | } |
95 | 73 |
|
96 | 74 | # Docs to check for parameter references, with per-file skip sets |
@@ -196,11 +174,19 @@ def check_param_refs(repo_root: Path) -> list[str]: |
196 | 174 | if toolchain_dir not in sys.path: |
197 | 175 | sys.path.insert(0, toolchain_dir) |
198 | 176 | try: |
| 177 | + from mfc.analytic_expr import INTRINSICS, PASSTHROUGH |
199 | 178 | from mfc.params import REGISTRY |
| 179 | + from mfc.params.definitions import CONSTRAINTS |
200 | 180 | except ImportError: |
201 | 181 | print(" Warning: could not import REGISTRY, skipping parameter check") |
202 | 182 | return [] |
203 | 183 |
|
| 184 | + # Collect all enumerated value names from CONSTRAINTS (e.g. "hll", "hllc", "rk3") |
| 185 | + _constraint_names: set[str] = set() |
| 186 | + for _entry in CONSTRAINTS.values(): |
| 187 | + if isinstance(_entry, dict) and "names" in _entry: |
| 188 | + _constraint_names.update(_entry["names"].keys()) |
| 189 | + |
204 | 190 | valid_params = set(REGISTRY.all_params.keys()) |
205 | 191 | # Build set of sub-parameter base names (strip trailing (N) indexes) |
206 | 192 | _sub_raw = {p.split("%")[-1] for p in valid_params if "%" in p} |
@@ -234,6 +220,8 @@ def check_param_refs(repo_root: Path) -> list[str]: |
234 | 220 | continue |
235 | 221 | if param in extra_skip: |
236 | 222 | continue |
| 223 | + if param in _constraint_names or param in INTRINSICS or param in PASSTHROUGH: |
| 224 | + continue |
237 | 225 | if "(" in param or ")" in param: |
238 | 226 | continue |
239 | 227 | if "[" in param: |
|
0 commit comments