neuroinformatics-unit / HowTo

NIU website on common software problems and their troubleshooting
http://howto.neuroinformatics.dev/
Creative Commons Attribution 4.0 International
9 stars 1 forks source link

Fix bug in pooch example #58

Closed alessandrofelder closed 4 months ago

alessandrofelder commented 4 months ago

Description

What is this PR

Why is this PR needed? pooch example is wrong AFAICT: it will download the GIN website contents showing file, not the contents of file.

What does this PR do? Specifies the URL correctly in the pooch with GIN example.

References

\

How has this PR been tested?

These fixtures work as expected (but the commented out line doesnt!)

@pytest.fixture(autouse=True, scope="session")
def brainglobe_test_registry():
    test_data = pooch.create(
        # Use the default cache folder for the operating system
        path=pooch.os_cache("brainglobe_test_data"),
        base_url="https://gin.g-node.org/BrainGlobe/test-data/raw/master/",
#      base_url="https://gin.g-node.org/BrainGlobe/test-data/src/master/",
        # The registry specifies the files that can be fetched
        registry={
            "cellfinder/cells-z-1000-1050.xml": None,
            "cellfinder/other-cells-z-1000-1050.xml": None,
        },
    )
    return test_data

@pytest.fixture
def cells(brainglobe_test_registry):
    cell_data_path = brainglobe_test_registry.fetch("cellfinder/cells-z-1000-1050.xml")
    cell_data = get_cells(cell_data_path)
    return cell_data

Is this a breaking change?

\

Does this PR require an update to the documentation?

This is an update to the documentation.

Checklist: