Skip to content

Commit

Permalink
refactor: ct.utility->ct.util (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
yxlao authored Mar 14, 2024
1 parent 47dbc35 commit 0a7cd0b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion camtools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from . import sanity
from . import solver
from . import transform
from . import utility
from . import util

import pkg_resources

Expand Down
4 changes: 2 additions & 2 deletions camtools/tools/compress_images.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def entry_point(parser, args):
print(f" - inplace : {inplace_str}")

# Compress images.
if not ct.utility.query_yes_no("Proceed?", default=False):
if not ct.util.query_yes_no("Proceed?", default=False):
print("Aborted.")
return 0
stats = compress_images(
Expand Down Expand Up @@ -213,7 +213,7 @@ def do_update_texts_in_dir(src_paths, dst_paths, root_dir):
print(f" - {text_path}")

prompt = "Continue?"
if ct.utility.query_yes_no(prompt, default=False):
if ct.util.query_yes_no(prompt, default=False):
pass
else:
print("Aborted.")
Expand Down
6 changes: 3 additions & 3 deletions camtools/tools/crop_boarders.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def entry_point(parser, args):
]

# Read.
src_ims = ct.utility.mt_loop(ct.io.imread, src_paths, alpha_mode="white")
src_ims = ct.util.mt_loop(ct.io.imread, src_paths, alpha_mode="white")

for src_im in src_ims:
if not src_im.dtype == np.float32:
Expand All @@ -126,7 +126,7 @@ def entry_point(parser, args):
"All images must be of the same shape when --same_crop is " "specified."
)

individual_croppings = ct.utility.mt_loop(ct.image.compute_cropping, src_ims)
individual_croppings = ct.util.mt_loop(ct.image.compute_cropping, src_ims)

# Compute the minimum cropping boarders.
min_crop_u, min_crop_d, min_crop_l, min_crop_r = individual_croppings[0]
Expand All @@ -146,7 +146,7 @@ def entry_point(parser, args):
paddings = [(padding, padding, padding, padding)] * len(src_ims)
else:
# Compute cropping boarders.
croppings = ct.utility.mt_loop(ct.image.compute_cropping, src_ims)
croppings = ct.util.mt_loop(ct.image.compute_cropping, src_ims)

# Compute paddings.
if args.pad_pixel != 0:
Expand Down
File renamed without changes.

0 comments on commit 0a7cd0b

Please sign in to comment.