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

BUG streamlines URL has changed #266

Open
alessandrofelder opened this issue Oct 30, 2023 · 6 comments
Open

BUG streamlines URL has changed #266

alessandrofelder opened this issue Oct 30, 2023 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@alessandrofelder
Copy link
Member

alessandrofelder commented Oct 30, 2023

Describe the bug
streamlines example test fails with URL not found: Forbidden

To Reproduce

  1. Run pytest -vv tests/test_examples.py --runslow --runlocal
    (MacOs M2 on 8866e3a with vedo 2023.4.6)
  2. Output is
========================================================================================================= FAILURES ==========================================================================================================
_______________________________________________________________________________________________________ test_examples _______________________________________________________________________________________________________

    @pytest.mark.slow
    @pytest.mark.local
    def test_examples():
>       import examples

tests/test_examples.py:11: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../../mambaforge/envs/brainrender-py311/lib/python3.11/site-packages/shiboken2/files.dir/shibokensupport/feature.py:139: in _import
    return original_import(name, *args, **kwargs)
examples/__init__.py:1: in <module>
    from examples import (
../../mambaforge/envs/brainrender-py311/lib/python3.11/site-packages/shiboken2/files.dir/shibokensupport/feature.py:139: in _import
    return original_import(name, *args, **kwargs)
examples/streamlines.py:19: in <module>
    streams = get_streamlines_for_region("TH")[:2]
brainrender/atlas_specific/allen_brain_atlas/streamlines.py:109: in get_streamlines_for_region
    return get_streamlines_data(
brainrender/atlas_specific/allen_brain_atlas/streamlines.py:70: in get_streamlines_data
    response = request(url)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

url = 'https://neuroinformatics.nl/HBP/allen-connectivity-viewer/json/streamlines_174957972.json.gz'

    def request(url):
        """
        Sends a request to a url
    
        :param url:
    
        """
        if not connected_to_internet():  # pragma: no cover
            raise ConnectionError(
                "No internet connection found."
            )  # pragma: no cover
    
        response = requests.get(url)
        if response.ok:
            return response
        else:  # pragma: no cover
            exception_string = "URL request failed: {}".format(
                response.reason
            )  # pragma: no cover
>       raise ValueError(exception_string)
E       ValueError: URL request failed: Forbidden

brainrender/_io.py:57: ValueError

Expected behavior
Tests pass

@alessandrofelder alessandrofelder added the bug Something isn't working label Oct 30, 2023
@alessandrofelder alessandrofelder changed the title BUG BUG streamlines URL has changed Oct 30, 2023
@alessandrofelder
Copy link
Member Author

@adamltyson (I think I've asked you this before - sorry) - any idea at what URL I can find the connectivity data now?
Think the currently hard-coded URL is now out-of-date... presumably somewhere around https://connectivity.brain-map.org/projection/? Pointer appreciated!

@adamltyson
Copy link
Member

This thread seems to contain the info we need to fix this.

From my understanding:

  • That URL is (was) a cache of data from AIBS
  • We should be able to get the data from AIBS ourselves
  • If the server isn't up to it, maybe we need to cache it ourselves on GIN?

Considering the thread is 4 years old, maybe it's worth posting to see if there's a more up to date method to get this data?

@alessandrofelder
Copy link
Member Author

Asked for advice on the AIBS community forum.

@alessandrofelder
Copy link
Member Author

Moving this out of the https://github.com/brainglobe/brainrender/milestone/1 milestone as I had no response about the data and don't consider this issue blocking.

@adamltyson
Copy link
Member

#348 enables these "slow" tests by default. The streamlines tests are currently disabled (commented out).

@adamltyson
Copy link
Member

This post by @fcollman illustrates how to download the data with cloud-volume. It's in a different format, and it looks like we'll need to rewrite all/most of the streamlines module.

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
Status: Backlog
Development

No branches or pull requests

3 participants