Skip to content

Commit

Permalink
Merge pull request #22 from fractal-analytics-platform/bug_fixes
Browse files Browse the repository at this point in the history
Bug fixes
  • Loading branch information
lorenzocerrone authored Dec 17, 2024
2 parents 2d0203f + b5e0cbb commit ef14308
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
7 changes: 2 additions & 5 deletions src/ngio/ngff_meta/fractal_image_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -823,9 +823,7 @@ def space_axes_unit(self) -> SpaceUnits:
raise ValueError("Spatial axes must have a unit.")
if return_type not in SpaceUnits.allowed_names():
raise ValueError(f"Invalid space unit {return_type}.")
if isinstance(return_type, str):
return_type = SpaceUnits(return_type)
return return_type
return SpaceUnits(return_type)

@property
def pixel_size(self) -> PixelSize:
Expand All @@ -850,8 +848,7 @@ def time_axis_unit(self) -> TimeUnits | None:
if len(types) == 0:
return None
elif len(types) == 1:
assert isinstance(types[0], TimeUnits)
return types[0]
return TimeUnits(types[0])
else:
raise ValueError("Multiple time axes found. Only one time axis is allowed.")

Expand Down
7 changes: 5 additions & 2 deletions src/ngio/tables/tables_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,14 +156,17 @@ def list(

list_of_tables = self._get_list_of_tables()
self._validate_list_of_tables(list_of_tables=list_of_tables)

all_table_types = ["roi_table", "feature_table", "masking_roi_table"]

if table_type is None:
return list_of_tables

else:
if table_type not in ["roi_table", "feature_table", "masking_roi_table"]:
if table_type not in all_table_types:
raise ValueError(
f"Table type {table_type} not recognized. "
" Allowed values are: 'roi', 'feature', 'masking_roi'."
f" Allowed values are: {all_table_types}"
)
list_of_typed_tables = []
for table_name in list_of_tables:
Expand Down

0 comments on commit ef14308

Please sign in to comment.