CalcUS icon indicating copy to clipboard operation
CalcUS copied to clipboard

Add download options to the project folders

Open RaphaelRobidas opened this issue 2 years ago • 16 comments

Is your improvement related to a problem? Please describe. Currently, ensembles can be "flagged" to specify that they are important. Flagged ensemble will end up in the folders of the project (/projects/<project.id>/<project.name>/folders/). The data organized in the folders can then be downloaded all at once:

image

However, there are no download options when downloading this way.

Describe the solution or change you'd like Download options similar to the "Download Project" page should be added for folders: image

These options should be parsed by the server, similar to the download_project_post function in frontend/views.py, in order to send back the proper data.

RaphaelRobidas avatar Feb 05 '23 12:02 RaphaelRobidas

Hey I find this project interesting. May I take this feature ?

Harshkumar77 avatar Feb 26 '23 12:02 Harshkumar77

Sure, go for it!

RaphaelRobidas avatar Feb 26 '23 12:02 RaphaelRobidas

Hey @RaphaelRobidas. Sorry for delay. I just want to ask are the options does download folder page will have ? Are they going to be exactly the same as download project ?

Harshkumar77 avatar Feb 28 '23 15:02 Harshkumar77

Yes, the options are going to be the same.

RaphaelRobidas avatar Feb 28 '23 15:02 RaphaelRobidas

Hey @RaphaelRobidas I have updated the UI for download_folder ! Can you explain me more about how to parse the option, similar to the download_project_post function in frontend/views.py, in order to send back the proper data.

Screenshot from 2023-03-21 19-56-58

0xClint avatar Mar 21 '23 14:03 0xClint

Hello @Omkar0803,

I just realized that there is currently no filtering code for the folder data like there is for project data. What should be done is refactor download_project_logs in order to work for both folders and projects. It could take as first parameter a list of ensembles. In the case of a project, the list would be all the ensembles of all the molecules of the project, while it would be all the ensembles in the folder (and subfolders) in the other case.

Then, there should be a new view download_folder_post which parses the different options like download_project_post and uses the refactored function to get the proper data.

It more challenging than I anticipated and this part of the code is a bit messy, but if you're up for a challenge, it would be very helpful!

RaphaelRobidas avatar Mar 21 '23 15:03 RaphaelRobidas

Yeah! Want to dig in this challenge hole. It will be difficult, but more interesting.

0xClint avatar Mar 23 '23 11:03 0xClint

@Omkar0803 Great! Let me know if you need clarifications and some help along the way.

RaphaelRobidas avatar Mar 23 '23 13:03 RaphaelRobidas

@RaphaelRobidas Is their any way so that we can check the data base locally? Want to know data base structure and mappings of CalcUS.

0xClint avatar Mar 27 '23 07:03 0xClint

@Omkar0803 You can use DBeaver (https://dbeaver.io/download/) to connect to the local database. You will have to open the PostgreSQL port by adding these lines under postgres: in dev-compose.yml:

                ports:
                        - "5432:5432"

The database user and name are calcus. The password is found in your .env. The hostname for the connection will be 0.0.0.0.

RaphaelRobidas avatar Mar 27 '23 13:03 RaphaelRobidas

@RaphaelRobidas How can I add and ensemble in a folder or sub folder?

0xClint avatar Apr 17 '23 20:04 0xClint

@Omkar0803 The folder field of the Ensemble instance points to the folder instance that contains it. You can then get the ensembles in a given folder by using the ensemble_set.all() query (such as my_folder.ensemble_set.all()).

RaphaelRobidas avatar Apr 17 '23 21:04 RaphaelRobidas

In the app how can I add?

0xClint avatar Apr 21 '23 13:04 0xClint

@Omkar0803 You're going to have to be more specific than this

RaphaelRobidas avatar Apr 21 '23 13:04 RaphaelRobidas

I am interested in this project, but could you explain more about where I found code files or specific folders in this repo? I mean where I should start?

karan-gander avatar Oct 01 '23 16:10 karan-gander

Thanks for the interest @karan-gander !

Firstly, make sure you can run CalcUS without any modification in developer mode (using start_dev.sh on Linux and Mac or start_dev.bat on Windows). See the documentation for all the instructions: https://calcus.readthedocs.io/en/latest/installation.html

Then, look at the main views file, frontend/views.py. The main view related to this issue is download_folder. This is the backend code. The frontend code (the HTML/JS/CSS code) is found in frontend/templates/frontend/project_folders.html.

Also take a look at the contribution guidelines for general information about contributions.

RaphaelRobidas avatar Oct 02 '23 00:10 RaphaelRobidas