-
Notifications
You must be signed in to change notification settings - Fork 35
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
Loading atlas with no Internet #358
Loading atlas with no Internet #358
Conversation
This is great! I'll do a bit of refactoring and get this reviewed. |
This should cover everything. The Errors and warnings should now separate when the internet is not available vs when GIN itself is down. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very nice.
Before submitting a pull request (PR), please read the contributing guide.
Please fill out as much of this template as you can, but if you have any problems or questions, just leave a comment and we will help out :)
Description
What is this PR
Why is this PR needed?
Outputs appropriate error messages when user tries to load atlas with no Internet connection.
What does this PR do?
In
bg_atlas.BrainGlobeAtlas
:utils.check_internet_connection()
checks for Internet connection, and also checks if GIN is down. If there is no Internet connection, code checks to see if the atlas they want is cached and available locally. If so, continues as normal.In
list_atlases.get_all_atlases_lastversions()
:utils.check_internet_connection()
checks for Internet connection, and also checks if GIN is down. If there is an Internet connection,get_all_atlases_lastversions()
performs as before and returns the updated list of available atlases fromlast_versions.conf
from GIN.get_all_atlases_lastversions()
warns user that they are offline. If user has a local copy oflast_versions.conf
in/.brainglobe/
,get_all_atlases_lastversions()
will call a new functionutils.conf_from_file
to return the list of available atlases based on this local conf file, but will also warn the user that this list could be outdated and that they should connect to the Internet for an updated list.last_versions.conf
in/.brainglobe/
,get_all_atlases_lastversions()
will tell user that they must connect to the Internet to fetch atlas list.References
Issue #142
How has this PR been tested?
Tested locally with different situations:
In
bg_atlas.BrainGlobeAtlas
:[Works as expected, no output]
In
get_all_atlases_lastversions()
:last_versions.conf
does not exist in local/.brainglobe/
:last_versions.conf
does exist in local/.brainglobe/
(but could be outdated):(Note: I am explicitly printing the list here)
(Works as expected and gets
last_versions.conf
from GIN with no error messages. Again, I am explicitly printing the list here)Is this a breaking change?
No.
Does this PR require an update to the documentation?
N/A
Checklist: