-
Notifications
You must be signed in to change notification settings - Fork 1
Optimize blockwise fly #68
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
base: main
Are you sure you want to change the base?
Conversation
|
addressing #67 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR optimizes the blockwise fly model processing by adding configurable input/output sizes, improving error handling, and implementing progress tracking for better reliability and monitoring.
- Added configurable input and output sizes for model processing
- Implemented progress tracking using temporary files to avoid reprocessing completed blocks
- Enhanced error handling in block processing with try-catch blocks and improved logging
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| cellmap_flow/cli/fly_model.py | Added configurable input_size and output_size parameters with defaults |
| cellmap_flow/blockwise/blockwise_processor.py | Enhanced with progress tracking, error handling, and check function for completed blocks |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| # Added and create == True to fix client error when create: True in the yaml, so when it is a client it will not be changed | ||
| if "create" in self.config and create == True: |
Copilot
AI
Sep 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use is True instead of == True for boolean comparison, or simply use and create since the parameter is already a boolean.
| # Added and create == True to fix client error when create: True in the yaml, so when it is a client it will not be changed | |
| if "create" in self.config and create == True: | |
| if "create" in self.config and create: |
| def check_block(tmp_dir, block: daisy.Block) -> bool: | ||
| return (tmp_dir / f"{block.block_id[1]}").exists() |
Copilot
AI
Sep 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function accesses block.block_id[1] without validation. Consider adding a check to ensure the block_id has at least 2 elements to prevent IndexError.
| def check_block(tmp_dir, block: daisy.Block) -> bool: | |
| return (tmp_dir / f"{block.block_id[1]}").exists() | |
| if hasattr(block, "block_id") and isinstance(block.block_id, (list, tuple)) and len(block.block_id) > 1: | |
| return (tmp_dir / f"{block.block_id[1]}").exists() | |
| else: | |
| logger.warning(f"Block id does not have at least 2 elements: {getattr(block, 'block_id', None)}") | |
| return False |
|
|
||
| block.status = daisy.BlockStatus.SUCCESS | ||
| block.status = daisy.BlockStatus.SUCCESS | ||
| (self.tmp_dir / f"{block.block_id[1]}").touch() |
Copilot
AI
Sep 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar to the check_block function, this accesses block.block_id[1] without validation. Consider adding a check to ensure the block_id has sufficient elements.
| (self.tmp_dir / f"{block.block_id[1]}").touch() | |
| if hasattr(block, "block_id") and isinstance(block.block_id, (list, tuple)) and len(block.block_id) > 1: | |
| (self.tmp_dir / f"{block.block_id[1]}").touch() | |
| else: | |
| logger.error(f"Block {block} has insufficient block_id elements: {block.block_id}") |
add single-scale ome-ngff (0.4) metadata generation when creating a …
🐛 write unit into a .zattrs metadata as a string, not as a list
No description provided.