-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Extending Alyx #635
Comments
I think it would be a good idea to make alyx more modular and allow labs to develop their own extensions easily. It should be possible to do that without changing to much of the core files. I imagine one could have multiple urls.py files and import them from a single "master" file. Could you be more specific on what exact features and schemes you would like to add in your version of alyx? |
Hi @rossant
Exactly!
we are in the first steps of designing the models, so a lot might change, but here are some ideas we are likely to implement:
|
Hi Luiz a few comments:
I think we could accomodate the FoodConsumption table. Note that there is already a Food table in the misc app to which we should link. |
Hey all, I'm also part of this effort. Thanks for getting the ball rolling, @luiztauffer and thanks for engaging so promptly, @oliche and @rossant! We are thinking about how we might be able to use Alyx for the Buffalo Lab, and thinking about how we might be able to use it more generally, extending it for the specific needs of different labs while keeping a common core. This is all really valuable information. I think there are two inter-related issues here:
So would you recommend having all of the imaging be stored in Sessions objects that have procedures that indicate MR, Xray, and CT scan? Then we could link to the data file within the Session item. That could work. I'm curious why you chose to make task name and version free text. I understand that if it is only ever written by a machine you probably won't have issues with standardized names, but still I think this could be limiting. In a standard lab setting, where you have many different tasks being run all the time and being constantly developed, this is probably going to be the # 1 thing that needs to be recorded well and that users are going to want to query. If there is any piece of data that might devolve into chaos if some structure is not defined, I think it would be task. (though I understand that this may not be the case for IBL, where tasks are much more standardized). We have been thinking about building additional infrastructure around tasks:
I'm not as experienced in schema design, but I think some of these might be difficult to do without a full-fledged Task table. I understand that these types of records may be out of scope for core alyx, so what would the best strategy be to add them as modules? |
For extending procedures we would add records to the Procedures tables (MR, Xray, CT...). Those are general enough that I would even argue they could be added as fixtures (init models in json). Those 2 changes, ie. FoodConsumption and a Task table are clearly within the scope for core Alyx. For the task we didn't rule out the idea of a new table, we just started small to get some mileage. The IBL tasks are quite well defined with their change logs, so moving to a table architecture is always possible. So far we managed to not fork the core Alyx, but I have to admit it is not entirely clear to me how to implement plugins or modules. Doing so most likely rules out extending the models of existing apps for non-core functionalities. But the new app approach would allow quite some freedom. We have a weekly review on Thursday, I suggest to discuss those items there and update afterwards ? |
Great! We would be happy to work with your team to make additional tables in a way that would be generally useful. Ideally we could be able to agree on a general structure that could meet the needs of several different labs. If not, we can always revisit the idea of building small specialized extensions/modules for specific use-cases. Through our work with NWB, we've found that this is generally the best approach- try to build general solutions as much as you can, and also support an extension framework for when the needs fall outside the scope of the general community.
Also great! I also want to make sure @nbonacchi sees this, as we've been mostly in touch with him about this project and he may have some additional context to add to your convo on Thursday. |
@nbonacchi did you see this ;-) |
Hello following up on this, let's make those 2 tables to start with ? If you envisioned contributing as developer, I'd recommend starting with the models on a new branch as it's a good first feature, and once we agree on the tables I propose to take care of the admin interface and rest endpoints/filters unless you are already familiar with Django. Usually when working on new models, we only commit the migrations at the very end when merging into master. At last, we have the annual IBL meeting over the week-end so I wouldn't expect fast feedback until next Monday. There will be more topics to discuss if we continue (newsletters, separate apps) but I suggest we start small with those 2 features. |
@oliche perfect. We have already created a fork here: https://github.com/catalystneuro/alyx and we plan to make the changes there and PR (unless you would prefer we branch here). We have a meeting with the Buffalo Lab on Monday to dig into the specifics. We'll put something together over the next week. Your help on the admin interface and REST endpoints/filters would be much appreciated! We have some members on our team that specialize in Django so we may be able to lift some of that load as well. |
Ok as far as I'm concerned I just think we should be able to ping-pong commits on the same branch, wherever it is. I'm fine with either. |
@oliche As there’ll probably be different groups of people commiting code, perhaps doing it in our fork will be better? |
It appears, sadly, that the attempt to extend Alyx to be less rodent-centric didn't go anywhere; they made many changes but never made any pull requests. Would current Alyx maintainers still consider making Alyx more generally flexible for other species and tasks? |
Is there any useful information on extending Alyx, @oliche or @rossant or @kdharris101? Alyx could serve as a really useful tool for primate labs. Our Inst. (Centre for excellence in brain science & International centre for primate brain research, Chinese Academy of Sciences) needs a database specialised for primate research, we want to try to promote better open sharing of data (see https://www.digital-brain.cn for our current connectome stuff). I would rather contribute to Alyx than build our own as standard tools are better than endless recreations of the same thing. But we don't know if the Alyx maintainers are interested, we can fork and build to start with. I saw @k1o0 has a pull for some task changes, and I don't want to end up conflicting with your future plans. |
Hello, We tried to keep Alyx rather generic, but the project may not have been built with the requirements you have in mind ! Yet there is an in-between solution in between absolute freedom and absolute collaboration. We faced the same issue at IBL of having very specific requirements and we have implemented those specific tools in an So you could create your own plugin of Alyx while keeping the base models common, as we did for our reports. When you feel base model changes are justified, we can go through the process of discussing proposed changes on the main apps. If you want to see such an example in practice, this is where our app lives (in a separate repository): We then clone the repository in the same docker/machine running alyx and symlink the app into the alyx repo: This requires modifying the PS: BTW the open data figuring on the website above looks amazing https://www.digital-brain.cn/ ! |
Thanks @oliche, that is helpful. I am still at the planning stage and I am not a Python person so I will be working with others for the low-level details. Are the relevant docs from Django this: https://docs.djangoproject.com/en/5.0/ref/applications/ ? How much can we change in terms of the schema etc.[1]? Given our inexperience with Django, we may find hacking on a fork easier to begin with, then use the experience to think about the "plugin" approach? [1] we mostly want to add more structured details and flexibility for the task (where we will have many different task designs that need to be somehow structured), "hide" the things like colony management, and augment some other fields etc. |
Alyx is super handy and it’s great that so many models are already in place!
I’m working to extend it to cover for needs of experiments with non-human primates, which will be basically creating some new tables and possibly extending a few existing ones.
My first approach is to create a new app (a new directory inside /alyx) similar to actions, misc, subjects… in a way to make it modular and as separated as possible from the original code. However, to really integrate the changes requires manually modifying some central project files, such as urls.py, settings.py and base.py.
My question is: is there any plan or interest in making a plug-and-play scheme for new models to be integrated, as per lab-needs? Am I being naive thinking that this wouldn’t be so difficult to do?
The text was updated successfully, but these errors were encountered: