Skip to content

Commit fa6496a

Browse files
committed
Removed deprecated input format arg, simplify format error message, simplify zarr color conversion, generalise well test
1 parent dec5daf commit fa6496a

4 files changed

Lines changed: 4 additions & 17 deletions

File tree

converter.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,6 @@ def _convert_single(input_filename, output_folder, alt_output_folder=None,
122122
writer, output_ext = create_writer(output_format, verbose=verbose)
123123

124124
source.init_metadata()
125-
if verbose:
126-
total_size = print_hbytes(source.get_total_data_size())
127-
print(f'Total data size: {total_size}')
128-
129125
name = source.get_name()
130126

131127
# For Incucyte sources with plates, organize output in subfolders

src/helper.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
import os.path
22

33

4-
def create_source(filename, input_format=None, **kwargs):
4+
def create_source(filename, **kwargs):
55
"""
66
Create an image source object based on the input file extension.
77
88
Args:
99
filename (str): Path to the input file or Incucyte .icarch file.
10-
input_format (str, optional): Deprecated - format is auto-detected.
1110
**kwargs: Source-specific parameters (e.g., plate_id for Incucyte).
1211
1312
Returns:
@@ -48,10 +47,7 @@ def create_source(filename, input_format=None, **kwargs):
4847
from src.TiffSource import TiffSource
4948
source = TiffSource(filename)
5049
else:
51-
raise ValueError(
52-
f'Unsupported input file format: {input_ext}. '
53-
f'Supported formats: .db, .icarch, .tif, .tiff'
54-
)
50+
raise ValueError(f'Unsupported input file format: {input_ext}')
5551
return source
5652

5753

src/ome_zarr_util.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,7 @@ def create_channel_metadata(dtype, channels, nchannels, is_rgb, window, ome_vers
9898
omezarr_channel = {'label': channel.get('label', channel.get('Name', f'{channeli}')), 'active': True}
9999
color = channel.get('color', channel.get('Color'))
100100
if color is not None:
101-
# If color is already a hex string, use it directly
102-
if isinstance(color, str):
103-
omezarr_channel['color'] = color.lstrip('#').upper()
104-
else:
105-
# Otherwise convert from RGBA tuple
106-
omezarr_channel['color'] = rgba_to_hexrgb(color)
101+
omezarr_channel['color'] = rgba_to_hexrgb(color)
107102
if dtype.kind == 'f':
108103
min, max = 0, 1
109104
else:

test/test_convert.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def test_convert(self, tmp_path, input_filename, output_format, alt_output_folde
8282
assert pixel_size.get('x') == source_pixel_size.get('x')
8383
assert pixel_size.get('y') == source_pixel_size.get('y')
8484
if source.is_screen():
85-
assert wells == source_wells
85+
assert list(wells) == list(source_wells)
8686

8787

8888
if __name__ == '__main__':

0 commit comments

Comments
 (0)