Skip to content

Commit

Permalink
Moving warning filter to the whole file.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ioannis Paraskevakos committed Dec 11, 2020
1 parent 573cb41 commit 79d5d97
Showing 1 changed file with 11 additions and 8 deletions.
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

0 comments on commit 79d5d97

Please sign in to comment.