jhuapl-boss / intern

Python SDK for interacting with the BossDB REST API
Apache License 2.0
19 stars 15 forks source link

Error in intern code snippet in BossDB #111

Closed bendichter closed 15 hours ago

bendichter commented 2 months ago

I'm not sure where to report this. This is probably the wrong place- feel free to move.

image

This code

# Import intern (pip install intern)
from intern import array

# Save a cutout to a numpy array in ZYX order:
032019_DP_full_vol = array("bossdb://paukner2024/butterfly_retina_xray_grp02_gw05/032019_DP_full_vol")
data = 032019_DP_full_vol[494:510, 620:1644, 326:1350]

is incorrect. Variables cannot start with a digit in Python. This can be fixed by adding a leading underscore:

# Import intern (pip install intern)
from intern import array

# Save a cutout to a numpy array in ZYX order:
_032019_DP_full_vol = array("bossdb://paukner2024/butterfly_retina_xray_grp02_gw05/032019_DP_full_vol")
data = _032019_DP_full_vol[494:510, 620:1644, 326:1350]

this issue seems to be specific to this dataset

j6k4m8 commented 1 month ago

@bendichter thank you for reporting! fixing! :)

j6k4m8 commented 1 month ago

@bendichter btw this is on latest trunk now — we'll roll an update to pypi shortly!