Skip to content

Commit f8467f3

Browse files
committed
[Examples] Some cosmetic fix in python examples
1 parent 2861d58 commit f8467f3

9 files changed

+14
-14
lines changed

python/examples/add_example.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
# Matrix element-wise addition
2323
#
2424

25-
result = a.ewiseadd(b) # result = a + b
25+
result = a.ewiseadd(b) # result = a + b
2626

27-
print("Matrix element-wise addition")
27+
print("Matrix element-wise addition:")
2828
print(result, sep='\n') # Matrix output

python/examples/export_example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# Matrix initialization
99
#
1010

11-
a = cb.Matrix.empty(shape=(3, 3))
11+
a = cb.Matrix.empty(shape=(3, 3)) # Adjacency matrices shape
1212
a[1, 0] = True
1313
a[1, 1] = True
1414
a[1, 2] = True

python/examples/iteration_example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@
2222

2323
print("Filled cell indices (row, column):")
2424
for i, j in a:
25-
print(f"({i}, {j})", end="; ")
25+
print(f"({i}, {j})", end=" ")

python/examples/kronecker_example.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
# Matrix initialization
99
#
1010

11-
a = cb.Matrix.empty(shape=(2, 2))
11+
a = cb.Matrix.empty(shape=(2, 2)) # Adjacency matrices shape
1212
a[0, 0] = True
1313
a[1, 0] = True
1414

15-
b = cb.Matrix.empty(shape=(2, 2))
15+
b = cb.Matrix.empty(shape=(2, 2)) # Adjacency matrices shape
1616
b[1, 1] = True
1717
b[1, 0] = True
1818

python/examples/log_example.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Example of matrix transposition
2+
Example of start the logger
33
"""
44

55
import pycubool as cb
@@ -21,7 +21,7 @@
2121
a[1, 2] = True
2222
a[0, 0] = True
2323

24-
a.set_marker("log-example") # Set debug marker for "a" matrix
24+
a.set_marker("a-log-example-matrix") # Set debug marker for "a" matrix
2525

2626
b = cb.Matrix.empty(shape=(3, 3))
2727
b[0, 1] = True

python/examples/reduce_example.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# Matrix initialization
99
#
1010

11-
a = cb.Matrix.empty(shape=(3, 3))
11+
a = cb.Matrix.empty(shape=(3, 3)) # Adjacency matrices shape
1212
a[1, 0] = True
1313
a[1, 1] = True
1414
a[1, 2] = True
@@ -21,4 +21,4 @@
2121
result = a.reduce()
2222

2323
print("Result of matrix reduce operation:")
24-
print(result, sep='\n')
24+
print(result, sep='\n') # Matrix output

python/examples/submatrix_example.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
result = a.extract_matrix(1, 1, (2, 2))
2525

2626
print("First result of extract sub-matrix operation:")
27-
print(result, sep='\n')
27+
print(result, sep='\n') # Matrix output
2828

2929

3030
#
@@ -34,4 +34,4 @@
3434
result = a.extract_matrix(0, 0, (3, 3))
3535

3636
print("Second result of extract sub-matrix operation:")
37-
print(result, sep='\n')
37+
print(result, sep='\n') # Matrix output

python/examples/to_list_example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
print(f"Columns - {list(columns)}")
2727

2828
#
29-
# Extract values as one list - pair of indices (i, j)
29+
# Extract values as one list - pair of indices (i, j) - list of edges
3030
#
3131

3232
values = a.to_list()

python/examples/transpose_example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# Matrix initialization
99
#
1010

11-
a = cb.Matrix.empty(shape=(3, 3))
11+
a = cb.Matrix.empty(shape=(3, 3)) # Adjacency matrices shape
1212
a[1, 0] = True
1313
a[1, 1] = True
1414
a[1, 2] = True

0 commit comments

Comments
 (0)