-
Notifications
You must be signed in to change notification settings - Fork 1
feat: add parser uri to readers, add function to download portal project fo… #43
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
Conversation
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 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 |
Copilot
AI
Jan 30, 2026
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.
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: |
Copilot
AI
Jan 30, 2026
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.
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 |
Copilot
AI
Jan 30, 2026
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.
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 |
🤖 I have created a release *beep* *boop* --- ## [1.2.0](copick-utils-v1.1.0...copick-utils-v1.2.0) (2026-01-31) ### ✨ Features * add parser uri to readers, add function to download portal project fo… ([#43](#43)) ([7743ee5](7743ee5)) ### 🐞 Bug Fixes * URI in copick readers ([#45](#45)) ([926f01d](926f01d)) --- Merging this PR will release copick-utils on PyPI. Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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)