Skip to content

Commit

Permalink
Deprecate current directives syntax. (#792)
Browse files Browse the repository at this point in the history
* depr: Current decorators syntax.

* doc: Improve error message in deprectated directives.
  • Loading branch information
b-butler authored Jan 10, 2024
1 parent 393fb73 commit 5a53d17
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions flow/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import textwrap
import threading
import time
import warnings
from collections import Counter, defaultdict
from copy import deepcopy
from enum import IntFlag
Expand Down Expand Up @@ -687,6 +688,13 @@ def __call__(self, func=None, /, *, directives=None):
func
The decorated function.
"""
if directives is not None:
warnings.warn(
"The current directives (e.g. nranks, np) are deprecated as of flow 0.27. "
"When updating flow please look at the documentation for the new style "
"(https://docs.signac.io/en/latest/cluster_submission.html#submission-directives).",
DeprecationWarning,
)
if func is None:
return functools.partial(self._internal_call, directives=directives)
return self._internal_call(func, directives=directives)
Expand Down Expand Up @@ -785,6 +793,13 @@ def __init__(
submit_options="",
run_options="",
):
if operation_directives is not None:
warnings.warn(
"The current directives (e.g. nranks, np) are deprecated as of flow 0.27. "
"When updating flow please look at the documentation for the new style "
"(https://docs.signac.io/en/latest/cluster_submission.html#submission-directives).",
DeprecationWarning,
)
self.name = name
self.submit_options = submit_options
self.run_options = run_options
Expand Down

0 comments on commit 5a53d17

Please sign in to comment.