Skip to content

Commit

Permalink
Adding new/updated copick_project_from_dataportal_0.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
kephale committed Oct 3, 2024
1 parent d0c8b20 commit 26f555b
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 3 deletions.
Binary file modified album_catalog_index.db
Binary file not shown.
2 changes: 1 addition & 1 deletion solutions/copick/project_from_dataportal/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.2.1] - 2024-10-03
Use dict instead of CopickConfig for initial json
Add retry mechanism when downloading add more logging

## [0.2.0] - 2024-10-03
Improve metadata retention and download segmentations
Expand Down
17 changes: 17 additions & 0 deletions solutions/copick/project_from_dataportal/solution.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
- cryoet-data-portal
- copick
- ndjson
- tenacity
"""

def generate_unique_colors(n):
Expand All @@ -39,6 +40,22 @@ def run():
from cryoet_data_portal import Client, Run, AnnotationFile, Tomogram, TiltSeries
import copick
from copick.models import CopickPoint, CopickConfig
from tenacity import retry, wait_fixed, stop_after_attempt, RetryError
import logging

# Configure logging
logging.basicConfig(level=logging.INFO, format='%(asctime)s %(levelname)s ~ %(message)s')
logger = logging.getLogger(__name__)

@retry(wait=wait_fixed(5), stop=stop_after_attempt(3))
def safe_query_run(annotation, run):
try:
if annotation.annotation.tomogram_voxel_spacing.run_id != run.id:
return False
return True
except Exception as e:
logger.error(f"Error during query: {e}")
raise e

args = get_args()
dataset_id = args.dataset_id
Expand Down
4 changes: 2 additions & 2 deletions solutions/copick/project_from_dataportal/solution.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ args:
name: static_root
required: false
type: string
changelog: Use dict instead of CopickConfig for initial json
changelog: Add retry mechanism when downloading add more logging
cite:
- text: Cellcanvas and Copick teams
url: https://cellcanvas.org
Expand All @@ -36,6 +36,6 @@ tags:
- deep learning
- tomography
- cryoET
timestamp: '2024-10-03T11:24:23.511772'
timestamp: '2024-10-03T12:57:04.006288'
title: Fetch Data from CryoET Data Portal and Integrate with Copick
version: 0.2.1

0 comments on commit 26f555b

Please sign in to comment.