Skip to content

Make ray imports in nn_utils optional - #39

Merged
rogerwwww merged 1 commit into
coleygroup:mainfrom
computational-metabolomics:optional-ray
Sep 16, 2026
Merged

rogerwwww merged 1 commit into
coleygroup:mainfrom
computational-metabolomics:optional-ray

Conversation

@RJMW

@RJMW RJMW commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

nn_utils/init.py star-imports tune_utils and base_hyperopt, which both import Ray. Because ms_pred.common imports nn_utils, Ray is needed to import almost anything in the package, including ICEBERG for inference, even though only the hyperparameter search uses it.

This change skips those two imports when Ray isn't installed. Any other import error is still raised as before, and nothing changes if Ray is installed.

We tested this in an environment without Ray: import ms_pred.nn_utils fails on main and works with this change.

@RJMW RJMW mentioned this pull request Sep 15, 2026
@rogerwwww
rogerwwww merged commit 202964e into coleygroup:main Sep 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants