run_refined_dfg: pick the coarse table builder by the imported source's API
jet_scenario=none host tests run against the current checkout (no blocked_base_tables), while historical runs import the pinned source (no blocked_coarse_tables). Select whichever single name the source defines; fail if neither or both. No src alias; pins and manifests unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
9d0588dcad
commit
5f69ebaa90
@@ -270,10 +270,14 @@ def host_geometry(source, h, collision="SRT", jet_scenario="none", placement="wi
|
|||||||
pair = FixedPatch2D.from_config(cfg, PLACEMENTS[placement])
|
pair = FixedPatch2D.from_config(cfg, PLACEMENTS[placement])
|
||||||
layout = BlockLayout2D.build(cfg.ny, cfg.nx, *BASE_BLOCK)
|
layout = BlockLayout2D.build(cfg.ny, cfg.nx, *BASE_BLOCK)
|
||||||
validate_channel_config(cfg, [BASE_BLOCK, FINE_BLOCK])
|
validate_channel_config(cfg, [BASE_BLOCK, FINE_BLOCK])
|
||||||
# Historical pinned source (jet_scenario none) names it blocked_base_tables;
|
# Select by the imported source's own API, not by scenario: the pinned historical
|
||||||
# the current checkout (public Jet scenarios) names it blocked_coarse_tables.
|
# source (verify_source) defines blocked_base_tables, the current checkout (host
|
||||||
coarse_tables = (refinement_tables.blocked_base_tables if jet_scenario == "none"
|
# tests, public Jet scenarios) blocked_coarse_tables. Exactly one must exist.
|
||||||
else refinement_tables.blocked_coarse_tables)
|
names = [n for n in ("blocked_base_tables", "blocked_coarse_tables")
|
||||||
|
if hasattr(refinement_tables, n)]
|
||||||
|
if len(names) != 1:
|
||||||
|
raise RuntimeError(f"Unexpected coarse transfer table API: {names}")
|
||||||
|
coarse_tables = getattr(refinement_tables, names[0])
|
||||||
targets = coarse_tables(pair, layout, np.argsort(pair.coalesce_coarse))[1]
|
targets = coarse_tables(pair, layout, np.argsort(pair.coalesce_coarse))[1]
|
||||||
validate_channel_transfers(pair, layout, targets)
|
validate_channel_transfers(pair, layout, targets)
|
||||||
BlockLayout2D.build(*pair.fine_shape, *FINE_BLOCK, periodic=(False, False))
|
BlockLayout2D.build(*pair.fine_shape, *FINE_BLOCK, periodic=(False, False))
|
||||||
|
|||||||
Reference in New Issue
Block a user