Skip to content

Commit 2a0bb54

Browse files
author
Michael Johansen
committed
Fix some variable names and remove a print.
Signed-off-by: Michael Johansen <[email protected]>
1 parent 3a3920d commit 2a0bb54

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/nipanel/_convert.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ def _get_best_matching_type(python_value: object) -> str:
104104
for candidate in candidates:
105105
containers_str = ".".join(container_types)
106106
python_typename = f"{containers_str}.{candidate}" if containers_str else candidate
107-
print(python_typename)
108107
if python_typename not in _SUPPORTED_PYTHON_TYPES:
109108
continue
110109
best_matching_type = python_typename

src/nipanel/converters/protobuf_types.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,14 @@ def to_protobuf_message(self, python_value: Collection[Collection[float]]) -> Do
5959
if rows:
6060
visitor = iter(python_value)
6161
first_subcollection = next(visitor)
62-
columns = len(first_subcollection) if rows else 0
62+
columns = len(first_subcollection)
6363
else:
6464
columns = 0
65-
if not all(len(sublist) == columns for sublist in python_value):
65+
if not all(len(subcollection) == columns for subcollection in python_value):
6666
raise ValueError("All subcollections must have the same length.")
6767

6868
# Create a flat list in row major order.
69-
flat_list = [item for sublist in python_value for item in sublist]
69+
flat_list = [item for subcollection in python_value for item in subcollection]
7070
return Double2DArray(rows=rows, columns=columns, data=flat_list)
7171

7272
def to_python_value(self, protobuf_message: Double2DArray) -> Collection[Collection[float]]:

0 commit comments

Comments
 (0)