-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor core-library modules #631
Conversation
Coverage reportThe coverage rate went from
Diff Coverage details (click to unfold)fractal_tasks_core/init.py
fractal_tasks_core/cellvoyager/init.py
fractal_tasks_core/cellvoyager/filenames.py
fractal_tasks_core/channels.py
fractal_tasks_core/labels.py
fractal_tasks_core/masked_loading.py
fractal_tasks_core/ngff/init.py
fractal_tasks_core/ngff/specs.py
fractal_tasks_core/ngff/zarr_utils.py
fractal_tasks_core/roi/v1_checks.py
fractal_tasks_core/roi/v1_overlaps.py
fractal_tasks_core/tables/init.py
fractal_tasks_core/tables/v1.py
fractal_tasks_core/tasks/apply_registration_to_ROI_tables.py
fractal_tasks_core/tasks/apply_registration_to_image.py
fractal_tasks_core/tasks/calculate_registration_image_based.py
fractal_tasks_core/tasks/cellpose_segmentation.py
fractal_tasks_core/tasks/copy_ome_zarr.py
fractal_tasks_core/tasks/create_ome_zarr.py
fractal_tasks_core/tasks/create_ome_zarr_multiplex.py
fractal_tasks_core/tasks/illumination_correction.py
fractal_tasks_core/tasks/import_ome_zarr.py
fractal_tasks_core/tasks/maximum_intensity_projection.py
fractal_tasks_core/tasks/napari_workflows_wrapper.py
fractal_tasks_core/tasks/napari_workflows_wrapper_models.py
fractal_tasks_core/tasks/yokogawa_to_ome_zarr.py
fractal_tasks_core/utils.py
fractal_tasks_core/zarr_utils.py
|
For the record, here is (part of) the current package structure:
|
A first bunch of minor issues where I think we can still improve:
|
I'd make the following separation: Things that validate a json structure are ngff. Things that use the zarr API, e.g. to load zattrs or other zarr specific parts are ome-zarr. In the (far) future, there might be other ngff backends besides zarr, which was the motivation to keep the specification abstract with its own ngff name |
Here is the current status. I think things are improving, but we may still clean up the structure a bit, especially in
|
Sounds good, great to see this becoming so structured! :) |
I think I'm mostly done with this PR, with the structure below. It clearly can still improve, but it's already quite a large refactor. The last point I'd like to fix is the name of
Thus this is essentially a wrapper of (a very limited part of) the zarr-python API. This module (which could become a subpackage in the future) should host our own Zarr-related functionalities which are fully unrelated to NGFF or other Fractal-specific features. I'm tempted to go with I'll now proceed with this one, and then that's mostly it from me here (cc @jluethi). If there are better suggestions on this name, they are welcome.
|
Big fan of how cellvoyager, rois & tables are separate. And generally of the additional structure added. The 2 questions I'd like to briefly review tomorrow:
|
Latest structure:
Side note: |
Here is a first version of the main I sorted them by original import, and I will now group them a bit to make it more readable (and then put this info somewhere in the docs). -from fractal_tasks_core.lib_channels import ChannelNotFoundError
+from fractal_tasks_core.channels import ChannelNotFoundError
-from fractal_tasks_core.lib_channels import OmeroChannel
+from fractal_tasks_core.channels import OmeroChannel
-from fractal_tasks_core.lib_channels import check_unique_wavelength_ids
+from fractal_tasks_core.channels import check_unique_wavelength_ids
-from fractal_tasks_core.lib_channels import check_well_channel_labels
+from fractal_tasks_core.channels import check_well_channel_labels
-from fractal_tasks_core.lib_channels import define_omero_channels
+from fractal_tasks_core.channels import define_omero_channels
-from fractal_tasks_core.lib_channels import get_channel_from_image_zarr
+from fractal_tasks_core.channels import get_channel_from_image_zarr
-from fractal_tasks_core.lib_channels import get_omero_channel_list
+from fractal_tasks_core.channels import get_omero_channel_list
-from fractal_tasks_core.lib_channels import update_omero_channels
+from fractal_tasks_core.channels import update_omero_channels
-from fractal_tasks_core.lib_glob import glob_with_multiple_patterns
+from fractal_tasks_core.cellvoyager.filenames import glob_with_multiple_patterns
-from fractal_tasks_core.lib_input_models import Channel
+from fractal_tasks_core.channels import ChannelInputModel
-from fractal_tasks_core.lib_input_models import NapariWorkflowsInput
+from fractal_tasks_core.tasks.napari_workflows_wrapper_models import NapariWorkflowsInput
-from fractal_tasks_core.lib_input_models import NapariWorkflowsOutput
+from fractal_tasks_core.tasks.napari_workflows_wrapper_models import NapariWorkflowsOutput
-from fractal_tasks_core.lib_masked_loading import masked_loading_wrapper
+from fractal_tasks_core.masked_loading import masked_loading_wrapper
-from fractal_tasks_core.lib_metadata_parsing import parse_yokogawa_metadata
+from fractal_tasks_core.cellvoyager.metadata import parse_yokogawa_metadata
-from fractal_tasks_core.lib_ngff import NgffImageMeta
+from fractal_tasks_core.ngff import NgffImageMeta
-from fractal_tasks_core.lib_ngff import detect_ome_ngff_type
+from fractal_tasks_core.ngff import detect_ome_ngff_type
-from fractal_tasks_core.lib_ngff import load_NgffImageMeta
+from fractal_tasks_core.ngff import load_NgffImageMeta
-from fractal_tasks_core.lib_ngff import load_NgffWellMeta
+from fractal_tasks_core.ngff import load_NgffWellMeta
-from fractal_tasks_core.lib_parse_filename_metadata import parse_filename
+from fractal_tasks_core.cellvoyager.filenames import parse_filename
-from fractal_tasks_core.lib_pyramid_creation import build_pyramid
+from fractal_tasks_core.pyramids import build_pyramid
-from fractal_tasks_core.lib_read_fractal_metadata import get_parameters_from_metadata
+from fractal_tasks_core.utils import get_parameters_from_metadata
-from fractal_tasks_core.lib_regions_of_interest import are_ROI_table_columns_valid
+from fractal_tasks_core.roi import are_ROI_table_columns_valid
-from fractal_tasks_core.lib_regions_of_interest import array_to_bounding_box_table
+from fractal_tasks_core.roi import array_to_bounding_box_table
-from fractal_tasks_core.lib_regions_of_interest import check_valid_ROI_indices
+from fractal_tasks_core.roi import check_valid_ROI_indices
-from fractal_tasks_core.lib_regions_of_interest import convert_ROI_table_to_indices
+from fractal_tasks_core.roi import convert_ROI_table_to_indices
-from fractal_tasks_core.lib_regions_of_interest import convert_ROIs_from_3D_to_2D
+from fractal_tasks_core.roi import convert_ROIs_from_3D_to_2D
-from fractal_tasks_core.lib_regions_of_interest import convert_indices_to_regions
+from fractal_tasks_core.roi import convert_indices_to_regions
-from fractal_tasks_core.lib_regions_of_interest import empty_bounding_box_table
+from fractal_tasks_core.roi import empty_bounding_box_table
-from fractal_tasks_core.lib_regions_of_interest import find_overlaps_in_ROI_indices
+from fractal_tasks_core.roi import find_overlaps_in_ROI_indices
-from fractal_tasks_core.lib_regions_of_interest import get_image_grid_ROIs
+from fractal_tasks_core.roi import get_image_grid_ROIs
-from fractal_tasks_core.lib_regions_of_interest import get_overlapping_pairs_3D
+from fractal_tasks_core.roi import get_overlapping_pairs_3D
-from fractal_tasks_core.lib_regions_of_interest import get_single_image_ROI
+from fractal_tasks_core.roi import get_single_image_ROI
-from fractal_tasks_core.lib_regions_of_interest import is_ROI_table_valid
+from fractal_tasks_core.roi import is_ROI_table_valid
-from fractal_tasks_core.lib_regions_of_interest import is_standard_roi_table
+from fractal_tasks_core.roi import is_standard_roi_table
-from fractal_tasks_core.lib_regions_of_interest import load_region
+from fractal_tasks_core.roi import load_region
-from fractal_tasks_core.lib_regions_of_interest import prepare_FOV_ROI_table
+from fractal_tasks_core.roi import prepare_FOV_ROI_table
-from fractal_tasks_core.lib_regions_of_interest import prepare_well_ROI_table
+from fractal_tasks_core.roi import prepare_well_ROI_table
-from fractal_tasks_core.lib_regions_of_interest import remove_FOV_overlaps
+from fractal_tasks_core.roi import remove_FOV_overlaps
-from fractal_tasks_core.lib_tables import write_table
+from fractal_tasks_core.tables import write_table
-from fractal_tasks_core.lib_upscale_array import upscale_array
+from fractal_tasks_core.upscale_array import upscale_array
-from fractal_tasks_core.lib_write import OverwriteNotAllowedError
+from fractal_tasks_core.zarr_utils import OverwriteNotAllowedError
-from fractal_tasks_core.lib_write import open_zarr_group_with_overwrite
+from fractal_tasks_core.zarr_utils import open_zarr_group_with_overwrite
-from fractal_tasks_core.lib_write import prepare_label_group
+from fractal_tasks_core.labels import prepare_label_group
-from fractal_tasks_core.lib_zattrs_utils import get_table_path_dict
+from fractal_tasks_core.utils import get_table_path_dict
-from fractal_tasks_core.lib_zattrs_utils import rescale_datasets
+from fractal_tasks_core.utils import rescale_datasets |
I'm merging this one, and I'll give it a final review before releasing 0.14.0. |
Awesome, great that we have this core library refactor now! |
Ref #600
Checklist before merging
CHANGELOG.md