Skip to content

Crash post_processing script update#1464

Open
dakhare-creator wants to merge 3 commits intoNVIDIA:mainfrom
dakhare-creator:crash-postprocess
Open

Crash post_processing script update#1464
dakhare-creator wants to merge 3 commits intoNVIDIA:mainfrom
dakhare-creator:crash-postprocess

Conversation

@dakhare-creator
Copy link
Contributor

PhysicsNeMo Pull Request

Description

Checklist

Dependencies

Review Process

All PRs are reviewed by the PhysicsNeMo team before merging.

Depending on which files are changed, GitHub may automatically assign a maintainer for review.

We are also testing AI-based code review tools (e.g., Greptile), which may add automated comments with a confidence score.
This score reflects the AI’s assessment of merge readiness and is not a qualitative judgment of your work, nor is
it an indication that the PR will be accepted / rejected.

AI-generated feedback should be reviewed critically for usefulness.
You are not required to respond to every AI comment, but they are intended to help both authors and reviewers.
Please react to Greptile comments with 👍 or 👎 to provide feedback on their accuracy.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 27, 2026

Greptile Summary

This PR enhances crash simulation post-processing to support computing MSE (position, velocity, acceleration) across multiple test samples. The changes include refactored Python script to handle both single-sample and multi-sample analysis, a new Jupyter notebook for comparing L2 errors across runs, and an updated shell script.

Major Changes:

  • Refactored compute_probe_kinematics.py to support multi-sample analysis with new functions for discovering runs, computing squared errors, and aggregating MSE
  • Added new notebook compare_plots.ipynb for comparing L2 error metrics across different model runs
  • Updated run_post_processing.sh to process multiple samples using parent directory parameters

Critical Issues:

  • run_post_processing.sh has a bash syntax error on line 5 (space after = in variable assignment) that will prevent the script from running
  • Line 16 references undefined variables $pred_path and $exact_path that will cause the script to fail

Important Files Changed

Filename Overview
examples/structural_mechanics/crash/post_processing/run_post_processing.sh Updated script to process multiple samples, but has critical bash syntax error on line 5 and undefined variables on line 16 that will prevent execution
examples/structural_mechanics/crash/post_processing/compute_probe_kinematics.py Added new functions to compute MSE across multiple samples, refactored main into single/multi-sample variants - implementation looks correct
examples/structural_mechanics/crash/post_processing/compare_plots.ipynb New notebook for comparing L2 error across runs - straightforward plotting logic with placeholder directory names to be filled by user

Last reviewed commit: 3019254

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile


mkdir -p results

dir_path= /path/to/output/directory
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Space after = causes bash syntax error - variable won't be set

Suggested change
dir_path= /path/to/output/directory
dir_path=/path/to/output/directory

--output_path $dir_path/post_processing_results \
# --save_csv
python compute_l2_error.py --predicted_parent $dir_path/predicted_vtps --exact_parent $dir_path/exact_vtps --output_plot $dir_path/post_processing_results/l2_error.png --output_csv $dir_path/post_processing_results/l2_error.csv
python plot_cross_section.py --pred_dir $pred_path --exact_dir $exact_path --output_file $dir_path/post_processing_results/cross_section.png
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$pred_path and $exact_path are undefined - this line will fail

Suggested change
python plot_cross_section.py --pred_dir $pred_path --exact_dir $exact_path --output_file $dir_path/post_processing_results/cross_section.png
python plot_cross_section.py --pred_dir $dir_path/predicted_vtps --exact_dir $dir_path/exact_vtps --output_file $dir_path/post_processing_results/cross_section.png

@mnabian mnabian self-assigned this Feb 27, 2026
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.

2 participants