Skip to content

Fix TypeError in sintering_physics deform_analyze plot call - #1965

Open
Anai-Guo wants to merge 1 commit into
NVIDIA:mainfrom
Anai-Guo:fix/sintering-deform-analyze-plot-args
Open

Fix TypeError in sintering_physics deform_analyze plot call#1965
Anai-Guo wants to merge 1 commit into
NVIDIA:mainfrom
Anai-Guo:fix/sintering-deform-analyze-plot-args

Conversation

@Anai-Guo

@Anai-Guo Anai-Guo commented Sep 4, 2026

Copy link
Copy Markdown

Problem

read_solutions_data_temp_anchor() in
examples/additive_manufacturing/sintering_physics/data_process/deform_analyze.py
cannot reach its plotting step. It calls:

plot_p_deform(
    build_name,
    temp_list,
    key_list=key_list,
    del_u=del_u, del_v=del_v, del_w=del_w,
    pid=read_point_id,
)

but the function is:

def plot_p_deform(
    temp_list, key_list, stage_keys, del_u, del_v, del_w, pid=0, split_stages=False
):

plot_p_deform has no build_name parameter. Passing it first shifts every
positional argument by one — build_name binds to temp_list, and temp_list
binds to key_list — which then collides with the explicit key_list= keyword:

TypeError: plot_p_deform() got multiple values for argument 'key_list'

The required third parameter, stage_keys, is also never passed.

This is the last statement of the function, after the whole .pvtu solution
sweep has run, so every invocation does the full read and then dies at the plot.

Fix

Drop build_name (the function neither takes nor uses a build name) and pass
stage_keys. stage_keys is only read inside the if split_stages: block, and
this call leaves split_stages at its default of False, so None preserves
the existing behavior without guessing at a value the caller does not have.

Verification

No sintering dataset here, so I verified the argument binding — which is exactly
where it fails — by extracting plot_p_deform's signature from the file's AST and
replaying both call shapes with Signature.bind:

plot_p_deform (temp_list, key_list, stage_keys, del_u, del_v, del_w, pid=0, split_stages=False)
positional-only params: none
  as written (build_name first)            -> TypeError: multiple values for argument 'key_list'
  after patch                              -> binds OK

I explicitly checked that plot_p_deform has no positional-only (/) parameters —
with PEP 570 positional-only params a same-named keyword would be legal and this
would be a false alarm. It has none, so the collision is real.

Formatting, with the version pinned in .pre-commit-config.yaml (ruff v0.12.5), run
from the repo root:

$ ruff format --check examples/additive_manufacturing/sintering_physics/data_process/deform_analyze.py
1 file already formatted

🤖 Generated with Claude Code

read_solutions_data_temp_anchor passes `build_name` as the first positional
argument to plot_p_deform, which has no such parameter. That shifts every
positional by one, so `temp_list` lands on `key_list` and collides with the
explicit `key_list=` keyword:

    TypeError: plot_p_deform() got multiple values for argument 'key_list'

Drop `build_name` and pass the required `stage_keys` (unused unless
`split_stages=True`, which this call leaves at its default of False).

Signed-off-by: Anai-Guo <antai12232931@outlook.com>
@copy-pr-bot

copy-pr-bot Bot commented Sep 4, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

CODEOWNERS review map

Current for commit 0321780ace4c. An approval covers every file listed for that owner; one owner is sufficient for shared files.

No CODEOWNER

  • examples/additive_manufacturing/sintering_physics/data_process/deform_analyze.py

Comment /codeowners-info to refresh.

@greptile-apps

greptile-apps Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR corrects argument binding in the sintering deformation plotting call by removing the unsupported build_name positional argument and explicitly supplying the otherwise-required stage_keys parameter.

  • Prevents the plotting step from raising a duplicate key_list argument TypeError.
  • Uses stage_keys=None safely because this call leaves stage splitting disabled.

Important Files Changed

Filename Overview
examples/additive_manufacturing/sintering_physics/data_process/deform_analyze.py The corrected call now binds every required plot_p_deform parameter correctly, and stage_keys=None is not consumed while split_stages retains its False default.

Reviews (1): Last reviewed commit: "Fix TypeError in sintering_physics defor..." | Re-trigger Greptile

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