zarr-python
zarr-python copied to clipboard
Increase the usage of augmented assignment statements
:eyes: Some source code analysis tools can help to find opportunities for improving software components. :thought_balloon: I propose to increase the usage of augmented assignment statements accordingly.
diff --git a/zarr/convenience.py b/zarr/convenience.py
index 18b59a7..bbd87f9 100644
--- a/zarr/convenience.py
+++ b/zarr/convenience.py
@@ -576,9 +576,9 @@ def copy_store(source, dest, source_path='', dest_path='', excludes=None,
source_path = normalize_storage_path(source_path)
dest_path = normalize_storage_path(dest_path)
if source_path:
- source_path = source_path + '/'
+ source_path += '/'
if dest_path:
- dest_path = dest_path + '/'
+ dest_path += '/'
# normalize excludes and includes
if excludes is None:
@@ -631,7 +631,7 @@ def copy_store(source, dest, source_path='', dest_path='', excludes=None,
# create a descriptive label for this operation
descr = source_key
if dest_key != source_key:
- descr = descr + ' -> ' + dest_key
+ descr += ' -> ' + dest_key
# decide what to do
do_copy = True
diff --git a/zarr/indexing.py b/zarr/indexing.py
index 2e9f7c8..c036dc0 100644
--- a/zarr/indexing.py
+++ b/zarr/indexing.py
@@ -443,7 +443,7 @@ class Order:
def wraparound_indices(x, dim_len):
loc_neg = x < 0
if np.any(loc_neg):
- x[loc_neg] = x[loc_neg] + dim_len
+ x[loc_neg] += dim_len
def boundscheck_indices(x, dim_len):
Thanks for the suggestion, @elfring. Are you up for opening the PR?
:thought_balloon: Can the presented changes be integrated also directly?
A PR with these changes would be fine, yes.