Skip to content

Commit 4f9e624

Browse files
committed
ruff formatting
1 parent 06c70d2 commit 4f9e624

3 files changed

Lines changed: 6 additions & 11 deletions

File tree

irods/data_object.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,11 @@ def __repr__(self):
4545
_REPL_STATUSES = (1, 0, 2, 3, 4)
4646
_REFERENCE_DATETIME = datetime.datetime(1970, 1, 1, 0, 0, 0, tzinfo=datetime.timezone.utc)
4747

48+
4849
def _DEFAULT_SORT_KEY_FN(row):
4950
repl_status = int(row[DataObject.replica_status])
5051

51-
repl_status_rank = (
52-
_REPL_STATUSES.index(repl_status) if _REPL_STATUSES.count(repl_status)
53-
else sys.maxsize
54-
)
52+
repl_status_rank = _REPL_STATUSES.index(repl_status) if _REPL_STATUSES.count(repl_status) else sys.maxsize
5553

5654
return (repl_status_rank, _REFERENCE_DATETIME - row[DataObject.modify_time])
5755

irods/manager/data_object_manager.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ def put(
326326
raise ex.OVERWRITE_WITHOUT_FORCE_FLAG
327327
options.pop(kw.FORCE_FLAG_KW, None)
328328

329-
replica_sort_function = options.pop('replica_sort_function',None)
329+
replica_sort_function = options.pop('replica_sort_function', None)
330330

331331
with open(local_path, "rb") as f:
332332
sizelist = []
@@ -484,7 +484,7 @@ def create(
484484
raise ex.DataObjectExistsAtLogicalPath
485485

486486
options = {**options, kw.DATA_TYPE_KW: "generic"}
487-
replica_sort_function = options.pop('replica_sort_function',None)
487+
replica_sort_function = options.pop('replica_sort_function', None)
488488

489489
if resource:
490490
options[kw.DEST_RESC_NAME_KW] = resource

irods/test/data_obj_test.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1253,10 +1253,7 @@ def test_replica_number(self):
12531253

12541254
# assertions on replicas
12551255
self.assertEqual(len(obj.replicas), number_of_replicas)
1256-
self.assertEqual(
1257-
{repl.number for repl in obj.replicas},
1258-
{*range(len(obj.replicas))}
1259-
)
1256+
self.assertEqual({repl.number for repl in obj.replicas}, {*range(len(obj.replicas))})
12601257

12611258
# now trim odd-numbered replicas
12621259
# note (see irods/irods#4861): COPIES_KW might disappear in the future
@@ -3003,7 +3000,7 @@ def test_default_sorting_of_replicas__issue_647(self):
30033000
data.replicate(resource=newResc1)
30043001

30053002
# Ensure that one of the replicas is stale, to test proper sorting.
3006-
with data.open('a',**{kw.RESC_NAME_KW:newResc1}) as f:
3003+
with data.open('a', **{kw.RESC_NAME_KW: newResc1}) as f:
30073004
f.write(b'.')
30083005
time.sleep(2)
30093006

0 commit comments

Comments
 (0)