Closed AngCamp closed 9 months ago
Hello,
There are two ONE classes, One
and OneAlyx
. The former is offline only and is used to search and load data on your local filesystem (called the dataset cache directory). This class has limited meta data (only the fields you see in the search terms list). I'm not familiar with the notebook you are running, however if it's using a specific data cache that only contains a subset of the IBL data, then you will not have access to things like release tag. If this is indeed the case then you're method of listing projects is fine. Here's another way: one._cache.sessions.projects.unique()
.
The second class, OneAlyx
can connect to a remote meta database called OpenAlyx, which provides many more search fields including release tag, and contains all publicly available IBL data. In the first code block you are instantiating the offline class. The best way to use ONE for all IBL data is to call the ONE
function, which will return you the correct object.
To setup ONE to use the OpenAlyx database you can run the following:
from one.api import ONE
ONE.setup(base_url='https://openalyx.internationalbrainlab.org', silent=True, make_default=True)
You can then instantiate ONE the following way:
one = ONE()
Now you will be able to use the one.alyx
methods. NB: You may be prompted to enter an Alyx password from time to time. The password is 'international'.
When I was hoping to look in projects, it's not clear what the available search terms are. Is it possible to print the options for each search term in some way?
For one.search
you can find details on the input arguments and a few examples in the API documentation. This page provides even more examples on searching with ONE, including a section about release tags.
Finally, for information on listing projects and searching using all available meta data, please consult the page on exploring Alyx REST endpoints. This shows you how to list all the available search parameters and contains many helpful examples.
In this online mode you can list projects in the following manner:
[project['name'] for project in one.alyx.rest('projects', 'list')]
NB: Remember that this returns all public IBL projects, whereas your notebook may use using only a subset of IBL data. Best to ask the author of the notebook.
No response for a week so I'm closing this for now. Please feel free to re-open if you still have issues.
I tried to query experiment tags using the alyx api but I could not. Also it's not clear how to find the lists of available items in each search_term.
My attempt to use the alyx restful api:
When I was hoping to look in projects, it's not clear what the available search terms are. Is it possible to print the options for each search term in some way?
I ended up doing the following:
Is there another way to do this that's built into the api?