Skip to content

Commit 2b18cb1

Browse files
committed
some fixes from ruff:
1 parent 0fc98e1 commit 2b18cb1

File tree

20 files changed

+13
-44
lines changed

20 files changed

+13
-44
lines changed

auto_test.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ def searchForPython(python_implementations):
4040
default_num_processes = int(os.environ.get("CHARM4PY_TEST_NUM_PROCESSES", 4))
4141

4242
try:
43-
import numba
4443

4544
numbaInstalled = True
4645
except:

charm4py/chare.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
from . import wait
2-
from charm4py import ray
32
import sys
43
from greenlet import getcurrent
54
from collections import defaultdict

charm4py/charm.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,14 @@
2222
import traceback
2323
from . import chare
2424
from .chare import MAINCHARE, GROUP, ARRAY, CHARM_TYPES
25-
from .chare import CONTRIBUTOR_TYPE_GROUP, CONTRIBUTOR_TYPE_ARRAY
25+
from .chare import CONTRIBUTOR_TYPE_ARRAY
2626
from .chare import Chare, Mainchare, Group, ArrayMap, Array
2727
from . import entry_method
2828
from . import threads
2929
from .threads import Future, LocalFuture, LocalMultiFuture
3030
from . import reduction
3131
from . import wait
3232
from charm4py.c_object_store import MessageBuffer
33-
from . import ray
3433
import array
3534

3635
try:

charm4py/entry_method.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def _run(self, obj, header, args, ret_fut=False):
4949
fut = args[-1]
5050
args = args[:-1]
5151
ret = getattr(obj, self.name)(*args)
52-
if ret_fut and not (ret is None):
52+
if ret_fut and ret is not None:
5353
fut.create_object(ret)
5454
except SystemExit:
5555
exit_code = sys.exc_info()[1].code

charm4py/interactive.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ def __init__(self, args):
4040

4141
try:
4242
import readline
43-
import rlcompleter
4443

4544
readline.parse_and_bind("tab: complete")
4645
except:

charm4py/object_store.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
from charm4py import (
22
charm,
33
Chare,
4-
Group,
5-
Array,
6-
Future,
7-
coro,
8-
Channel,
9-
Reducer,
104
register,
115
)
126
from charm4py.c_object_store import CObjectStore

charm4py/pool.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from . import charm, Chare, Group, Array, coro_ext, threads, Future, register, ray
1+
from . import charm, Chare, Array, coro_ext, threads, Future, register
22
from .charm import Charm4PyError
33
from .threads import NotThreadedError
44
from collections import defaultdict

charm4py/ray/api.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import types
2-
from copy import deepcopy
32

43
counter = 0
54

@@ -36,7 +35,7 @@ def remote(self, *args, **kwargs):
3635

3736
class RayProxy(object):
3837
def __init__(self, subclass, args, pe):
39-
from charm4py import Chare, register, charm
38+
from charm4py import Chare
4039

4140
self.proxy = Chare(subclass, args=args, onPE=pe)
4241
for f in dir(self.proxy):
@@ -80,7 +79,7 @@ def task(*args):
8079

8180

8281
def remote(*args, **kwargs):
83-
from charm4py import charm, Chare, register
82+
from charm4py import Chare, register
8483

8584
num_returns = kwargs.pop("num_returns", 1)
8685
if len(args) == 1 and len(kwargs) == 0:
@@ -123,7 +122,6 @@ def wait(futs, num_returns=1, timeout=None, fetch_local=True):
123122

124123

125124
def put(obj):
126-
from ..threads import Future
127125
from ..charm import charm
128126

129127
fut = charm.threadMgr.createFuture(store=True)

charm4py/threads.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ def is_local(self):
149149
raise ValueError(
150150
"Operation not supported for future not" " stored in the object store"
151151
)
152-
return not (self.lookup_object() is None)
152+
return self.lookup_object() is not None
153153

154154
def create_object(self, obj):
155155
from .charm import charm

docs/conf.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
# All configuration values have a default; values that are commented out
1414
# serve to show the default.
1515

16-
import sys
17-
import os
1816

1917
# If extensions (or modules to document with autodoc) are in another directory,
2018
# add these directories to sys.path here. If the directory is relative to the

0 commit comments

Comments
 (0)