Skip to content
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

Moving warning filter to the whole file. #525

Merged
merged 1 commit into from
Dec 14, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 11 additions & 8 deletions src/radical/entk/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
from . import exceptions as ree
from . import states as res

import warnings
warnings.simplefilter(action="once", category=DeprecationWarning, lineno=707)
warnings.simplefilter(action="once", category=DeprecationWarning, lineno=764)

# ------------------------------------------------------------------------------
#
Expand Down Expand Up @@ -701,10 +704,10 @@ def cpu_reqs(self, value):
'cpu_process_type', 'cpu_thread_type'])

if set(value.keys()).issubset(depr_expected_keys):
import warnings
warnings.simplefilter("once")
warnings.warn("CPU requirements keys are renamed using 'cpu_'" +
"as a prefix for all keys.",DeprecationWarning)
warnings.warn("CPU requirements keys are renamed. Please use " +
"cpu_processes for processes, cpu_process_type for " +
"process_type, cpu_threads for threads_per_process " +
"and cpu_thread_type for thread_type",DeprecationWarning)

value['cpu_processes'] = value.pop('processes')
value['cpu_process_type'] = value.pop('process_type')
Expand Down Expand Up @@ -758,10 +761,10 @@ def gpu_reqs(self, value):
'gpu_process_type', 'gpu_thread_type'])

if set(value.keys()).issubset(depr_expected_keys):
import warnings
warnings.simplefilter("once")
warnings.warn("GPU requirements keys are renamed using 'gpu_'" +
"as a prefix for all keys.",DeprecationWarning)
warnings.warn("GPU requirements keys are renamed. Please use " +
"gpu_processes for processes, gpu_process_type for " +
"process_type, gpu_threads for threads_per_process " +
"and gpu_thread_type for thread_type",DeprecationWarning)

value['gpu_processes'] = value.pop('processes')
value['gpu_process_type'] = value.pop('process_type')
Expand Down