Fix TypeError in sintering_physics deform_analyze plot call - #1965
Open
Anai-Guo wants to merge 1 commit into
Open
Fix TypeError in sintering_physics deform_analyze plot call#1965Anai-Guo wants to merge 1 commit into
Anai-Guo wants to merge 1 commit into
Conversation
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>
Contributor
CODEOWNERS review mapCurrent for commit No CODEOWNER
Comment |
Contributor
Greptile SummaryThe PR corrects argument binding in the sintering deformation plotting call by removing the unsupported
Important Files Changed
Reviews (1): Last reviewed commit: "Fix TypeError in sintering_physics defor..." | Re-trigger Greptile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
read_solutions_data_temp_anchor()inexamples/additive_manufacturing/sintering_physics/data_process/deform_analyze.pycannot reach its plotting step. It calls:
but the function is:
plot_p_deformhas nobuild_nameparameter. Passing it first shifts everypositional argument by one —
build_namebinds totemp_list, andtemp_listbinds to
key_list— which then collides with the explicitkey_list=keyword:The required third parameter,
stage_keys, is also never passed.This is the last statement of the function, after the whole
.pvtusolutionsweep 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 passstage_keys.stage_keysis only read inside theif split_stages:block, andthis call leaves
split_stagesat its default ofFalse, soNonepreservesthe 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 andreplaying both call shapes with
Signature.bind:I explicitly checked that
plot_p_deformhas 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), runfrom the repo root:
🤖 Generated with Claude Code