Fix FileNotFoundError for custom in_lammps paths in dpgen autotest #1798
+45
−4
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.
This PR fixes a FileNotFoundError that occurs when users specify custom
in_lammps
file paths in their dpgen autotest configuration.Problem
When users configure a custom
in_lammps
path in their interaction settings:The dispatcher fails with
FileNotFoundError: cannot find upload file xxx/in.lammps
because it looks forin.lammps
in the working directory instead of the specified pathlammps_input/in.lammps
.Root Cause
The
Lammps
class correctly stores the custom path inself.in_lammps
, but theforward_common_files()
andforward_files()
methods always return the hardcoded string"in.lammps"
regardless of the actual file path. This causes the dispatcher to look for the wrong file.Solution
Modified both methods to use the actual
self.in_lammps
path when it's not"auto"
:Validation
The fix is minimal and surgical - it only changes the file path resolution while preserving all existing behavior and symlink creation logic.
Fixes #1757.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.