Skip to content

Commit 5492f5e

Browse files
committed
improve instructions re idc-index upgrade
1 parent 229b6f9 commit 5492f5e

2 files changed

Lines changed: 33 additions & 7 deletions

File tree

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/).
77

88
## [Unreleased]
99

10+
## [1.3.1] - 2026-02-11
11+
12+
### Added
13+
14+
- Automatic idc-index package version check with upgrade prompt before any queries
15+
- Version check compares installed version against `metadata.idc-index` in frontmatter and triggers `pip install --upgrade` when outdated
16+
17+
### Fixed
18+
19+
- Prevents "table not found" errors when using newer index tables (e.g., `contrast_index`) with older idc-index versions
20+
1021
## [1.3.0] - 2026-02-10
1122

1223
### Added

SKILL.md

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: imaging-data-commons
33
description: Query and download public cancer imaging data from NCI Imaging Data Commons using idc-index. Use for accessing large-scale radiology (CT, MR, PET) and pathology datasets for AI training or research. No authentication required. Query by metadata, visualize in browser, check licenses.
44
license: This skill is provided under the MIT License. IDC data itself has individual licensing (mostly CC-BY, some CC-NC) that must be respected when using the data.
55
metadata:
6-
version: 1.3.0
6+
version: 1.3.1
77
skill-author: Andrey Fedorov, @fedorov
88
idc-index: "0.11.9"
99
idc-data-version: "v23"
@@ -20,20 +20,35 @@ Use the `idc-index` Python package to query and download public cancer imaging d
2020

2121
**Primary tool:** `idc-index` ([GitHub](https://github.com/imagingdatacommons/idc-index))
2222

23-
**Verify version and check current data scale:**
23+
**CRITICAL - Check package version and upgrade if needed (run this FIRST):**
24+
25+
```python
26+
import idc_index
27+
28+
REQUIRED_VERSION = "0.11.9" # Must match metadata.idc-index in this file
29+
installed = idc_index.__version__
30+
31+
if installed < REQUIRED_VERSION:
32+
print(f"Upgrading idc-index from {installed} to {REQUIRED_VERSION}...")
33+
import subprocess
34+
subprocess.run(["pip3", "install", "--upgrade", "--break-system-packages", "idc-index"], check=True)
35+
print("Upgrade complete. Restart Python to use new version.")
36+
else:
37+
print(f"idc-index {installed} meets requirement ({REQUIRED_VERSION})")
38+
```
39+
40+
**Verify IDC data version and check current data scale:**
2441

2542
```python
2643
from idc_index import IDCClient
2744
client = IDCClient()
2845

29-
# IMPORTANT: Always verify you're using the latest IDC data version
30-
idc_version = client.get_idc_version()
31-
print(f"IDC data version: {idc_version}") # Should be "v23"
32-
# If version is older than v23, upgrade: pip install --upgrade idc-index
46+
# Verify IDC data version (should be "v23")
47+
print(f"IDC data version: {client.get_idc_version()}")
3348

3449
# Get collection count and total series
3550
stats = client.sql_query("""
36-
SELECT
51+
SELECT
3752
COUNT(DISTINCT collection_id) as collections,
3853
COUNT(DISTINCT analysis_result_id) as analysis_results,
3954
COUNT(DISTINCT PatientID) as patients,

0 commit comments

Comments
 (0)