Skip to content

Commit 3ef422d

Browse files
github-actionsgithub-actions
github-actions
authored and
github-actions
committed
fixup! Format Python code with psf/black push
1 parent d842748 commit 3ef422d

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

maths/allocation_number.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,21 @@ def allocation_num(number_of_bytes: int, partitions: int) -> List[str]:
3838
ValueError: partitions must be a positive number!
3939
"""
4040
if partitions <= 0:
41-
raise ValueError('partitions must be a positive number!')
41+
raise ValueError("partitions must be a positive number!")
4242
if partitions >= number_of_bytes:
43-
raise ValueError('partitions can not >= number_of_bytes!')
43+
raise ValueError("partitions can not >= number_of_bytes!")
4444
bytes_per_partition = number_of_bytes // partitions
45-
allocation_list = [f'0-{bytes_per_partition}']
45+
allocation_list = [f"0-{bytes_per_partition}"]
4646
for i in range(1, partitions - 1):
47-
length = f'{bytes_per_partition * i + 1}-{bytes_per_partition * (i + 1)}'
47+
length = f"{bytes_per_partition * i + 1}-{bytes_per_partition * (i + 1)}"
4848
allocation_list.append(length)
49-
allocation_list.append(f'{(bytes_per_partition * (partitions - 1)) + 1}-'
50-
f'{number_of_bytes}')
49+
allocation_list.append(
50+
f"{(bytes_per_partition * (partitions - 1)) + 1}-" f"{number_of_bytes}"
51+
)
5152
return allocation_list
5253

5354

54-
if __name__ == '__main__':
55+
if __name__ == "__main__":
5556
import doctest
57+
5658
doctest.testmod()

0 commit comments

Comments
 (0)