-
Notifications
You must be signed in to change notification settings - Fork 207
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
Avoid erroring when OMP_NUM_THREADS is empty string #472
Conversation
@FrancescAlted gentle ping thoughts here? |
numexpr/utils.py
Outdated
@@ -152,7 +152,8 @@ def _init_num_threads(): | |||
# actual number of threads used. | |||
if 'NUMEXPR_NUM_THREADS' in os.environ: |
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.
Would be good to fix this one as well, and any others that blindly call int on an environmental variable. Would it be more pythonic to try/except and then reraise (or warn) with an explanation?
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.
I think an empty string should be fine, so just ignoring it seems good to me
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.
This sounds good to me. When we are that, would you like to add the suggestion by @bashtage ?
Updated |
Unfortunately test suite is not passing with the latest commit. |
should be fixed now |
Looks good. Thanks @phofl ! |
unsetting the variable like this is not uncommon but this will raise here unfortunately
This circumvents the issue