Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
[skip ci]
  • Loading branch information
dbouget committed Sep 10, 2024
1 parent c094b28 commit a87de35
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
11 changes: 6 additions & 5 deletions vsi2tif/src/process.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import logging
import os
import traceback
import shutil
import logging
import traceback

from tqdm import tqdm

from .benchmark import benchmark
Expand All @@ -22,12 +23,12 @@ def cellsens2tif_single(
) -> None:

if int(plane) == -1:
image_folder = os.path.join(os.path.dirname(output_path), os.path.basename(output_path).replace('.tif', ''))
image_folder = os.path.join(os.path.dirname(output_path), os.path.basename(output_path).replace(".tif", ""))
for s in range(50):
try:
curr_output_path = os.path.join(image_folder, "plane_" + str(s) + "_" + os.path.basename(output_path))
cellsens2tif(input_path, curr_output_path, bfconvert, compression, tz, s, quality, max_mem, verbose)
except Exception as e:
except Exception:
logging.info("End of planes with value {}".format(s))
break

Expand All @@ -44,7 +45,7 @@ def cellsens2tif_single(
shutil.copyfile(largest_file, output_path)
if os.path.exists(image_folder):
shutil.rmtree(image_folder)
except Exception as e:
except Exception:
logging.error("Issue cleaning up after all planes conversion.")
logging.error(traceback.format_exc())
else:
Expand Down
8 changes: 7 additions & 1 deletion vsi2tif/vsi2tif.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,13 @@ def main():
parser.add_argument("-b", "--bfconvert", help="path to bfconvert tool", required=True)
parser.add_argument("-c", "--compression", help="compression technique for final image", default="jpeg")
parser.add_argument("-s", "--tilesize", help="tile size to use during both conversion steps", default=1024)
parser.add_argument("-p", "--plane", help="which image plane to convert image from. If set to -1, all planes are converted and the largest is kept", default=0, type=int)
parser.add_argument(
"-p",
"--plane",
help="which image plane to convert image from. If set to -1, all planes are converted and the largest is kept",
default=0,
type=int,
)
parser.add_argument("-q", "--quality", help="compression quality used with JPEG compression", default=85)
parser.add_argument("-m", "--max-mem", help="set maximum memory in the java vm", default=32)
parser.add_argument("-v", "--verbose", help="set verbosity level", default=1, type=int)
Expand Down

0 comments on commit a87de35

Please sign in to comment.