Closed viktorpm closed 1 month ago
I think this should be added to the validation scripts, to check that the atlases have additional_references
set correctly (or at all).
The warning is useful in this case, I think, @viktorpm
UserWarning: This atlas seems to be outdated as no additional_references list is found in metadata!
This suggests that there is an atlas (is it the human atlas or the one after in the validation list?) that hasn't been updated since we introduced the additional references concept in the code.
How I think it is intended to work (for atlases with no additional references):
wrapup
function without specifying the additional_references
keyword argument e.g. hte human one.wrapup
function will therefore use the default additional_references = {}
and will have an empty dictionary.@alessandrofelder, looks like the human atlas doesn't return what the validate_additional_references
function expects. The warning has always been there, so that shouldn't be a problem. I tried to print the reference list allenhu.additional_references.references_list
but got an error. Should we try to catch the error and continue the validation or fix the atlas (it is likely a bigger job)?
allen mouse 100um atlas
allen100 = BrainGlobeAtlas("allen_mouse_100um")
allen100.additional_references.references_list
[]
allen human 500um atlas
allenhu = BrainGlobeAtlas("allen_human_500um")
/home/plattnerv/miniforge3/envs/bg-atlasapi/lib/python3.11/site-packages/brainglobe_atlasapi/core.py:65: UserWarning: This atlas seems to be outdated as no additional_references list is found in metadata!
warnings.warn(
allenhu.additional_references.references_list
Traceback (most recent call last):
File "/home/plattnerv/.pycharm_helpers/pydev/pydevconsole.py", line 364, in runcode
coro = func()
^^^^^^
File "<input>", line 1, in <module>
AttributeError: 'BrainGlobeAtlas' object has no attribute 'additional_references'
To fix the issue, I think (famous last words) that the human atlas just needs to be regenerated. It should then have the correct metadata. I think the issue stems from the fact that it hasn't been regenerated since the concept of additional references was added to the atlas API.
I agree, but I couldn't find an easy fix for the script. I'll make it my priority to work on that (in a new PR).
Describe the bug
validate_atlases.py
both in an interactive session on the HPC and as a submitted job I received this error:additional_references
related functions and tests in the local code to be able to run the validation.To Reproduce
Computer used (please complete the following information):