Skip to content
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

Problems with streamlines examples #289

Closed
adamltyson opened this issue Dec 1, 2023 · 1 comment
Closed

Problems with streamlines examples #289

adamltyson opened this issue Dec 1, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@adamltyson
Copy link
Member

When I first try to run python streamlines.py I get a warning about allensdk (#288). When this is installed and I try again I get:

(brainrender-test) tigger:examples adamtyson$ python streamlines.py 
Running example: streamlines.py
downloading ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━   0% -:--:--
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /Users/adamtyson/projects/brainglobe/brainrender/examples/streamlines.py:19 in <module>          │
│                                                                                                  │
│   16 scene.add_brain_region("TH")                                                                │
│   17                                                                                             │
│   18 # Get stramlines data and add                                                               │
│ ❱ 19 streams = get_streamlines_for_region("TH")[:2]                                              │
│   20 scene.add(*make_streamlines(*streams, color="salmon", alpha=0.5))                           │
│   21                                                                                             │
│   22 # Render!                                                                                   │
│                                                                                                  │
│ /Users/adamtyson/projects/brainglobe/brainrender/brainrender/atlas_specific/allen_brain_atlas/st │
│ reamlines.py:109 in get_streamlines_for_region                                                   │
│                                                                                                  │
│   106 │   │   logger.debug("No experiments found from allen data")                               │
│   107 │   │   return None                                                                        │
│   108 │                                                                                          │
│ ❱ 109 │   return get_streamlines_data(                                                           │
│   110 │   │   region_experiments.id.values, force_download=force_download                        │
│   111 │   )                                                                                      │
│   112                                                                                            │
│                                                                                                  │
│ /Users/adamtyson/projects/brainglobe/brainrender/brainrender/atlas_specific/allen_brain_atlas/st │
│ reamlines.py:70 in get_streamlines_data                                                          │
│                                                                                                  │
│    67 │   │   jsonpath = streamlines_folder / f"{eid}.json"                                      │
│    68 │   │                                                                                      │
│    69 │   │   if not jsonpath.exists() or force_download:                                        │
│ ❱  70 │   │   │   response = request(url)                                                        │
│    71 │   │   │                                                                                  │
│    72 │   │   │   # Write the response content as a temporary compressed file                    │
│    73 │   │   │   temp_path = streamlines_folder / "temp.gz"                                     │
│                                                                                                  │
│ /Users/adamtyson/projects/brainglobe/brainrender/brainrender/_io.py:57 in request                │
│                                                                                                  │
│   54 │   │   exception_string = "URL request failed: {}".format(                                 │
│   55 │   │   │   response.reason                                                                 │
│   56 │   │   )  # pragma: no cover                                                               │
│ ❱ 57 │   raise ValueError(exception_string)                                                      │
│   58                                                                                             │
│   59                                                                                             │
│   60 def check_file_exists(func):  # pragma: no cover                                            │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
ValueError: URL request failed: Forbidden

M1 macbook, Python 3.11. Fresh conda env.

@adamltyson adamltyson added the bug Something isn't working label Dec 1, 2023
@adamltyson adamltyson mentioned this issue Dec 1, 2023
7 tasks
@alessandrofelder
Copy link
Member

alessandrofelder commented Dec 4, 2023

Closing as duplicate of #266 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants