brainglobe / brainglobe-atlasapi

A lightweight python module to interact with atlases for systems neuroscience
https://brainglobe.info/documentation/brainglobe-atlasapi/index.html
BSD 3-Clause "New" or "Revised" License
117 stars 24 forks source link

deal with local and remote atlas versions in validate_atlases.py #274

Open viktorpm opened 1 month ago

viktorpm commented 1 month ago

Describe the bug

brainglobe_atlasapi: kim_mouse_25um version 1.1is not the latest available (1.0). To update the atlas run in the terminal:
brainglobe update -a kim_mouse_25um

Expected behaviour

adamltyson commented 1 month ago

Detect the difference but don't replace the atlases automatically.

What was done automatically? Nothing in BrainGlobe should update the atlases without specific user interaction.

viktorpm commented 1 month ago

It started to download the atlases without me running the brainglobe update -a kim_mouse_25um (or any other) command.

adamltyson commented 1 month ago

What started to? What process was running?

viktorpm commented 1 month ago

I ran the validation.py function. This is the output:

(bg-atlasapi) vplattner@hpc-gw1:~/_projects/validation/brainglobe-atlasapi$ python brainglobe_atlasapi/atlas_generation/validate_atlases.py
example_mouse_100um 1.2
allen_mouse_10um 1.2
allen_mouse_25um 1.2
allen_mouse_50um 1.2
allen_mouse_100um 1.2
mpin_zfish_1um 1.0
allen_human_500um 0.1
/nfs/nhome/live/vplattner/_projects/validation/brainglobe-atlasapi/brainglobe_atlasapi/core.py:65: UserWarning: This atlas seems to be outdated as no additional_references list is found in metadata!
  warnings.warn(
kim_mouse_10um 1.0
brainglobe_atlasapi: kim_mouse_10um not found locally. Downloading...
Downloading... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100.0% • 645.2/645.2 MB • speed: 1.8 MB/s • ETA: 0:00:00
kim_mouse_25um 1.0
brainglobe_atlasapi: kim_mouse_25um version 1.1is not the latest available (1.0). To update the atlas run in the terminal:
    brainglobe update -a kim_mouse_25um
brainglobe_atlasapi: kim_mouse_25um version 1.1is not the latest available (1.0). To update the atlas run in the terminal:
    brainglobe update -a kim_mouse_25um
brainglobe_atlasapi: kim_mouse_25um version 1.1is not the latest available (1.0). To update the atlas run in the terminal:
    brainglobe update -a kim_mouse_25um
brainglobe_atlasapi: updating kim_mouse_25um
Downloading... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100.0% • 226.7/226.7 MB • speed: 1.1 MB/s • ETA: 0:00:00
brainglobe_atlasapi: kim_mouse_25um updated to version: 1.0
kim_mouse_50um 1.0
brainglobe_atlasapi: kim_mouse_50um version 1.1is not the latest available (1.0). To update the atlas run in the terminal:
    brainglobe update -a kim_mouse_50um
brainglobe_atlasapi: kim_mouse_50um version 1.1is not the latest available (1.0). To update the atlas run in the terminal:
    brainglobe update -a kim_mouse_50um
brainglobe_atlasapi: kim_mouse_50um version 1.1is not the latest available (1.0). To update the atlas run in the terminal:
    brainglobe update -a kim_mouse_50um
brainglobe_atlasapi: updating kim_mouse_50um
Downloading... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╺━━━━━━━━ 87.8% • 167.2/190.5 MB • speed: 1.1 MB/s • ETA: 0:00:21
adamltyson commented 1 month ago

Can you link to that file?

viktorpm commented 1 month ago

Sure! https://github.com/brainglobe/brainglobe-atlasapi/blob/main/brainglobe_atlasapi/atlas_generation/validate_atlases.py

adamltyson commented 1 month ago

This isn't a bug in the atlasapi, the validation script explicitly updates the atlas. Maybe the validation script should have some logic to deal specifically with atlas versions that are newer than those on GIN?

viktorpm commented 1 month ago

Should I convert this into a discussion or close it?

adamltyson commented 1 month ago

You can keep it open, just maybe change the title so we know what the actual issue is.

As an aside, I've actually just disabled Discussions. We decided a while back to not use that feature (in favour of issues, Zulip & image.sc), and I didn't know we still had it enabled on this repo.