Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds functionality to download AreTomo files from the CryoET Data Portal and improves the reader functions by introducing URI-based object resolution.
Changes:
- Added URI-based resolution for tomograms and segmentations in readers
- Renamed variables in writers for consistency (
tomogram→tomo,segmentation_volume→seg_vol,segmentation→seg) - Added new portal download functionality with CLI commands for downloading CryoET Data Portal projects
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| src/copick_utils/io/readers.py | Added URI parsing support via resolve_copick_objects, added docstrings, changed function signature parameter names |
| src/copick_utils/io/writers.py | Renamed variables for brevity (tomogram → tomo, segmentation_volume → seg_vol, segmentation → seg) |
| src/copick_utils/io/portal.py | New module for downloading AreTomo files from CryoET Data Portal including tiltseries, alignments, and metadata |
| src/copick_utils/cli/download.py | New CLI command for downloading projects from CryoET Data Portal |
| src/copick_utils/cli/download_commands.py | Module exporting download commands for CLI integration |
| pyproject.toml | Added mdocfile dependency and new CLI entry point for download commands |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/copick_utils/io/readers.py
Outdated
| uri = f'{algorithm}@{voxel_size}' | ||
| vol = resolve_copick_objects(uri, run.root, 'tomogram', run_name = run.name) | ||
| return vol[0].numpy() | ||
| except: # Report which orbject is missing |
There was a problem hiding this comment.
Corrected spelling of 'orbject' to 'object'.
| except: # Report which orbject is missing | |
| except: # Report which object is missing |
src/copick_utils/io/readers.py
Outdated
| uri = f'{name}:{user_id}/{session_id}@{voxel_spacing}' | ||
| segs = resolve_copick_objects(uri, run.root, 'segmentation', run_name = run.name) | ||
| return segs[0].numpy() | ||
| except: |
There was a problem hiding this comment.
Bare except clause catches all exceptions including system exits and keyboard interrupts. Specify the expected exception type(s) to avoid masking unexpected errors.
src/copick_utils/io/portal.py
Outdated
| download_aretomo_files_for_tiltseries(dataset_id, run_name, output_dir, tiltseries_id) | ||
|
|
||
| # note: this function assumes that there is only one tiltseries per run | ||
| # note: the tiltseries name is equivlaent to the run name |
There was a problem hiding this comment.
Corrected spelling of 'equivlaent' to 'equivalent'.
| # note: the tiltseries name is equivlaent to the run name | |
| # note: the tiltseries name is equivalent to the run name |
Pull request overview
This PR adds functionality to download AreTomo files from the CryoET Data Portal and improves the reader functions by introducing URI-based object resolution.
Changes:
tomogram→tomo,segmentation_volume→seg_vol,segmentation→seg)