deepmodeling / deepmodeling/unimol_tools
[Code scan] Do not require save_path for in-memory target scaling
- Dominant language
- Python
- Stars
- 34
- Forks
- 9
- PR merge metrics
- No merged PRs in 30d
Description
This issue is a result of a Codex global repository scan.
## Summary
TargetScaler.fit always removes, creates, and writes target_scaler.ss under dump_dir after fitting. DataHub accepts save_path=None, so direct regression or multilabel regression use with target_normalize enabled can fail even though the fitted scaler could be kept in memory.
## Code references
https://github.com/deepmodeling/unimol_tools/blob/4596596aa8f73eb462d5cc5a921d79966d0465da/unimol_tools/data/datascaler.py#L120-L125
https://github.com/deepmodeling/unimol_tools/blob/4596596aa8f73eb462d5cc5a921d79966d0465da/unimol_tools/data/datahub.py#L58-L65
## Impact
Library users who construct DataHub directly, or future call paths that do not provide save_path, can crash during scaler fitting despite not needing scaler persistence on disk.
## Suggested fix
Only persist the scaler when dump_dir is not None. If dump_dir is None, keep self.scaler in memory and skip file IO.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.