Repository navigation
fix(losses): validate loss inputs and options before runs start - #617
k-chrispens wants to merge 1 commit into
Conversation
Path-valued loss options given on the command line or in a --loss-config file must name existing files, checked in loss_config_from_args so both sampleworks-guidance and run_grid_search.py refuse them before a model loads or jobs are queued. Loss weights must be finite, bragg_weight must be a finite number in [0, 1], and batch_partition a positive integer, all at option construction rather than when the loss is built. Fixes #552
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 57 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
marcuscollins
left a comment
There was a problem hiding this comment.
I think this is okay but wanted to confirm that a None path should not be an error? The current code passes it, but I think that's okay because other code will fill in the value from a csv.
| absent = { | ||
| name: str(entry.options[name]) | ||
| for name in path_option_names(options_cls) | ||
| if entry.options.get(name) is not None and not Path(entry.options[name]).exists() |
There was a problem hiding this comment.
Shouldn't we raise an error if one of the path_option_names is None?
|
|
||
| def __post_init__(self): | ||
| _check_resolution(self.resolution) | ||
| if type(self.batch_partition) is not int or self.batch_partition <= 0: |
There was a problem hiding this comment.
I favor the use of isinstance rather than booleans involving type()
Path typed loss options given on the command line or in a --loss-config file must name existing files, checked in loss_config_from_args so both sampleworks-guidance and run_grid_search.py refuse them before a model loads or jobs are queued. Loss weights must be finite, bragg_weight must be a finite number in [0, 1], and batch_partition a positive integer, all at option construction rather than when the loss is built.
Fixes #552