You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Handle empty and "None" string values for run_name and ckpt_dir config parameters (#377)
## Summary
This PR adds defensive checks for empty and "None" string values in
`run_name` and `ckpt_dir` config parameters, along with formatting
improvements across the codebase.
## Changes
### Functional Changes
- **ModelTrainer._setup_ckpt_path()**: Added handling for empty string
(`""`) and string literal `"None"` for both `run_name` and `ckpt_dir`
parameters
- Prevents unexpected behavior when YAML configs have empty values
(e.g., `run_name:` or `ckpt_dir:`)
- Handles edge case where users accidentally set string `"None"` instead
of null
### Test Coverage
- Added test case for empty `run_name` in
`test_model_ckpt_path_duplication`
### Code Formatting
- Removed extra blank lines across multiple files
- Added consistent spacing around operators in f-strings
- Properly wrapped tuple assignments in lightning_modules.py
- Fixed string concatenation in assertion message (inference/utils.py)
## Files Modified
- `sleap_nn/training/model_trainer.py` - defensive checks and formatting
- `sleap_nn/architectures/encoder_decoder.py` - formatting
- `sleap_nn/architectures/unet.py` - formatting
- `sleap_nn/inference/predictors.py` - formatting
- `sleap_nn/inference/topdown.py` - formatting
- `sleap_nn/inference/utils.py` - string formatting fix
- `sleap_nn/tracking/candidates/fixed_window.py` - formatting
- `sleap_nn/tracking/utils.py` - formatting
- `sleap_nn/training/lightning_modules.py` - tuple assignment formatting
- `tests/training/test_model_trainer.py` - added test coverage
## Testing
- Existing tests should pass with these changes
- Added specific test for empty run_name case
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
Co-authored-by: Claude <[email protected]>
0 commit comments