Skip to content

Commit

Permalink
Refactor/remove deprecated code (#686)
Browse files Browse the repository at this point in the history
* refactor!: Remove deprecated code.

* fix: Update directives decoration deprecation

* refactor: Remove directives decorator

* refactor!: Remove FlowProject.operation.with_directives

* fix: Remove remaining references to removed code

* refactor!: Remove formatting cmd operations

* fix/test: Update/fix lingering errors from deprecation removals

* refactor: Use obj.attr = value over setattr

Co-authored-by: Bradley Dice <bdice@bradleydice.com>

Co-authored-by: Bradley Dice <bdice@bradleydice.com>
  • Loading branch information
b-butler and bdice authored Nov 22, 2022
1 parent 6ed91d5 commit 3a2177a
Show file tree
Hide file tree
Showing 11 changed files with 66 additions and 522 deletions.
20 changes: 0 additions & 20 deletions doc/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ The FlowProject
FlowProject.main
FlowProject.make_group
FlowProject.operation
FlowProject.operation.with_directives
FlowProject.operation_hooks
FlowProject.operation_hooks.on_exception
FlowProject.operation_hooks.on_exit
Expand Down Expand Up @@ -58,8 +57,6 @@ The FlowProject

.. automethod:: flow.FlowProject.operation(func, name=None)

.. automethod:: flow.FlowProject.operation.with_directives(directives, name=None)

.. automethod:: flow.FlowProject.operation_hooks(hook_func, trigger)

.. automethod:: flow.FlowProject.operation_hooks.on_exception
Expand Down Expand Up @@ -134,23 +131,6 @@ Labels
:members:
:special-members: __call__

@flow.cmd
---------

.. autofunction:: cmd

@flow.with_job
--------------

.. autofunction:: with_job

@flow.directives
----------------

.. autoclass:: directives
:members:
:special-members: __call__

flow.init()
-----------

Expand Down
1 change: 0 additions & 1 deletion flow/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
from . import environment, environments, errors, hooks, scheduling, testing
from .aggregates import aggregator, get_aggregate_id
from .environment import get_environment
from .operations import cmd, directives, with_job
from .project import FlowProject, IgnoreConditions, classlabel, label, staticlabel
from .template import init

Expand Down
10 changes: 5 additions & 5 deletions flow/directives.py
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ def _GET_EXECUTABLE():
.. code-block:: python
@Project.operation.with_directives({"memory": "4g"})
@Project.operation(directives={"memory": "4g"})
def op(job):
pass
Expand All @@ -517,7 +517,7 @@ def op(job):
.. code-block:: python
@Project.operation.with_directives({"memory": "512m"})
@Project.operation(directives={"memory": "512m"})
def op(job):
pass
Expand All @@ -527,11 +527,11 @@ def op(job):
.. code-block:: python
@Project.operation.with_directives({"memory": "4"})
@Project.operation(directives={"memory": "4"})
def op1(job):
pass
@Project.operation.with_directives({"memory": 4})
@Project.operation(directives={"memory": 4})
def op2(job):
pass
"""
Expand Down Expand Up @@ -601,7 +601,7 @@ def op2(job):
.. code-block:: python
@Project.operation.with_directives({"walltime": 24})
@Project.operation(directives={"walltime": 24})
def op(job):
# This operation takes 1 day to run
pass
Expand Down
2 changes: 1 addition & 1 deletion flow/environments/incite.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class SummitEnvironment(DefaultLSFEnvironment):
Example::
@Project.operation.with_directives({
@Project.operation(directives={
"nranks": 3, # 3 MPI ranks per operation
"ngpu": 3, # 3 GPUs
"np": 3, # 3 CPU cores
Expand Down
209 changes: 0 additions & 209 deletions flow/operations.py

This file was deleted.

Loading

0 comments on commit 3a2177a

Please sign in to comment.