Skip to content

Commit

Permalink
black formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
pattonw committed Apr 20, 2024
1 parent 71aa879 commit bbe7489
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion gunpowder/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def v(self):
@property
def attrs(self):
return self.__attrs

@property
def all(self):
return self.__attrs
Expand Down
1 change: 0 additions & 1 deletion gunpowder/nodes/rasterize_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,6 @@ def __rasterize(
for color in np.unique(rasterized_graph):
if color == 0:
continue
assert color in [2,3], np.unique(rasterized_graph)
mask = rasterized_graph == color
enlarge_binary_map(
mask,
Expand Down
4 changes: 1 addition & 3 deletions gunpowder/nodes/simple_augment.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,7 @@ def process(self, batch, request):
array.data = array.data[channel_slices + mirror]

transpose = [t + num_channels for t in self.transpose]
array.data = array.data.transpose(
list(range(num_channels)) + transpose
)
array.data = array.data.transpose(list(range(num_channels)) + transpose)

# graphs
total_roi_offset = total_roi.offset
Expand Down
4 changes: 2 additions & 2 deletions tests/cases/elastic_augment.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ def test_3d_basics(self):
[0.1, 0.1, 0.1],
# [0, 0, 0], # no jitter
[0, 2.0 * math.pi],
)
+ # rotate randomly
) # rotate randomly
+
# [math.pi/4, math.pi/4]) + # rotate by 45 deg
# [0, 0]) + # no rotation
RasterizeGraph(
Expand Down
4 changes: 2 additions & 2 deletions tests/cases/elastic_augment_points.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,8 @@ def test_random_seed(self):
[0.1, 0.1, 0.1],
# [0, 0, 0], # no jitter
[0, 2.0 * math.pi],
)
+ # rotate randomly
) # rotate randomly
+
# [math.pi/4, math.pi/4]) + # rotate by 45 deg
# [0, 0]) + # no rotation
RasterizeGraph(
Expand Down
1 change: 1 addition & 0 deletions tests/cases/rasterize_points.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ def test_rasterize_graph_colors():
assert rasterized[4, 0] == 3
assert rasterized[4, :].sum() == 15


def test_3d():
graph_key = GraphKey("TEST_GRAPH")
array_key = ArrayKey("TEST_ARRAY")
Expand Down

0 comments on commit bbe7489

Please sign in to comment.