Skip to content

Commit dc98ba4

Browse files
authored
Apply suggestions from code review
1 parent 48d8458 commit dc98ba4

File tree

1 file changed

+4
-4
lines changed
  • pydatastructs/linear_data_structures

1 file changed

+4
-4
lines changed

pydatastructs/linear_data_structures/arrays.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class OneDimensionalArray(Array):
7070
def __new__(cls, dtype=NoneType, *args, **kwargs):
7171
if dtype is NoneType:
7272
raise ValueError("Data type is not defined.")
73-
elif len(args) not in (1, 2):
73+
if len(args) not in (1, 2):
7474
raise ValueError("Too few arguments to create a 1D array,"
7575
" pass either size of the array"
7676
" or list of elements or both.")
@@ -93,7 +93,7 @@ def __new__(cls, dtype=NoneType, *args, **kwargs):
9393
raise TypeError("Expected type of size is int and "
9494
"expected type of data is list/tuple.")
9595
if size != len(data):
96-
raise ValueError("Conflict in the size -> %s and length of data -> %s"
96+
raise ValueError("Conflict in the size, %s and length of data, %s"
9797
%(size, len(data)))
9898
obj._size, obj._data = size, data
9999

@@ -187,7 +187,7 @@ def __new__(cls, dtype: type = NoneType, *args, **kwargs):
187187
if dtype is NoneType:
188188
raise ValueError("Data type is not defined.")
189189
elif not args:
190-
raise ValueError("Too few arguments to create a Multi Dimensional array,"
190+
raise ValueError("Too few arguments to create a multi dimensional array,"
191191
" pass dimensions.")
192192
if len(args) == 1:
193193
obj = Array.__new__(cls)
@@ -199,7 +199,7 @@ def __new__(cls, dtype: type = NoneType, *args, **kwargs):
199199
dimensions = args
200200
for dimension in dimensions:
201201
if dimension < 1:
202-
raise ValueError("Incorrect dimensions passed, dimension"
202+
raise ValueError("Number of dimensions"
203203
" cannot be less than 1")
204204
n_dimensions = len(dimensions)
205205
d_sizes = []

0 commit comments

Comments
 (0)