Skip to content

Commit

Permalink
avoid long multi-line commands
Browse files Browse the repository at this point in the history
  • Loading branch information
ismael-mendoza committed Apr 28, 2021
1 parent 08a3b28 commit 3608fec
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions btk/draw_blends.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,19 +242,13 @@ def __next__(self):
# allocate memory for output catalogues and images.
batch_blend_cat[s.name] = []
batch_obs_cond[s.name] = []
image_shape = (
(
len(s.filters),
pix_stamp_size,
pix_stamp_size,
)
if not self.channels_last
else (
pix_stamp_size,
pix_stamp_size,
len(s.filters),
)
)

# decide image_shape based on channels_last bool.
option1 = (len(s.filters), pix_stamp_size, pix_stamp_size)
option2 = (pix_stamp_size, pix_stamp_size, len(s.filters))
image_shape = option1 if not self.channels_last else option2

# create emtpy arrays with image_shape.
blend_images[s.name] = np.zeros((self.batch_size, *image_shape))
isolated_images[s.name] = np.zeros((self.batch_size, self.max_number, *image_shape))

Expand Down

0 comments on commit 3608fec

Please sign in to comment.