-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Adds hydra safty guard against cli args starting with -- #4802
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -338,6 +338,8 @@ def parse_overrides(args: list[str], presets: dict) -> tuple: | |||||||||||||
| global_presets, preset_sel, preset_scalar, global_scalar = [], [], [], [] | ||||||||||||||
|
|
||||||||||||||
| for arg in args: | ||||||||||||||
| if arg.startswith("-"): | ||||||||||||||
| continue | ||||||||||||||
|
Comment on lines
+341
to
+342
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The PR description and title refer to filtering Consider clarifying the intent with a more precise comment:
Suggested change
|
||||||||||||||
| if "=" not in arg: | ||||||||||||||
| global_scalar.append(arg) | ||||||||||||||
| continue | ||||||||||||||
|
|
||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Args starting with
-are silently dropped with no logging or warning. If a user accidentally prefixes a Hydra override with a dash (e.g.,-env.sim.dt=0.01instead ofenv.sim.dt=0.01), the override will be silently ignored with no feedback as to why it had no effect.Consider adding a debug-level log message to help users diagnose such situations:
Adding a comment explaining this behavior would also help future maintainers understand the intent.