-
Notifications
You must be signed in to change notification settings - Fork 2
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
fix(dataverse): integrated changes for handling multiple project groups #304
fix(dataverse): integrated changes for handling multiple project groups #304
Conversation
…s initialization parameters. Removed the db_name property and passed as a parameter for the methods. - Adapted the tests for the changes done.
…se: for storing all the documents related to dataverse (2) default_project_group_db_name that correspond to the default project group database for populating the PASTA projects in UI. Adapted the API calls to use the database names appropriately. - Also modified initialize_database to create the necessary documents in both the databases. - Make sure that the initialize_database is invoked after the creation of project groups and also while switching to new groups. - Removed unwanted initialize_database call from config_dialog.py. - Modified and added new tests for the changes. - Code reformatting.
@SteffenBrinckmann This PR includes the changes from the other PR (#284 Sb python3.12) too, hence the file changes is higher, as soon as the other PR is merged the you would be able to see the changes alone for this PR! |
…-data-verse-fails-to-support-upload-in-multiple-user-configured-project-groups
@SteffenBrinckmann I have merged the changes from the main branch, the changes are now specific to this PR, please go ahead and review the changes, Thanks |
@jmurugan-fzj Not clear why you add code in projectGroup and especially directly before restart: which restarts and hence looses all information. Why do you not just take the defaultProjectGroup from the configuration file .pastaELN.py? |
@SteffenBrinckmann Because I saw that "closeDialog" method in projectGroup.py is resposible for saving the contents of .pastaELN.py with the "switched" defaultProjectGroup information. Clearly line numbers 133 & 134 dumps the contents of .pastaELN.py. Isn't this understanding correct? Hence when the user creates and switches the project group, the necessary initialization are done immediately after the dump! Why do you not just take the defaultProjectGroup from the configuration file .pastaELN.py? Yes, that's what is done exactly inside "db_api.initialize_database()" call, just before the restart; the freshly written defaultProjectGroup and credentials are read from .pastaELN.py and all the necessary views are created along with other initializations and are saved within dataverse DB. Isn't it clear? |
Why don't you check whether the database is set up properly upon starting the data verse tool. If not, set it up. That is far simpler and fault tolerant. There are three ways to change the project group, including editing the JSON file. You cannot track all of them. |
@SteffenBrinckmann I could also add it to the init part of the data-verse tool which will be invoked every-time when the user starts the tool, which is not necessary right? This can affect the performance and the loading time of the tool since this includes file/DB operations and so on. Hence wanted to invoke the method: "db_api.initialize_database()" only once when the user changes the defaultProjectGroup! Doesn't it make sense? Or do you suggest any other way to do this or you think this performance problem is acceptable? Moreover, why would you allow the user to edit the JSON file directly (error prone way!) when you have the nice GUI option available? :) What's the necessity of such modifications? I would never even include such error prone instructions in the user manual! |
The creation of a view costs much less than a second. The upload minutes to longer, I don't think a user will notice the view creation. |
…t methods of config_dialog.py and main_dialog.py modules. Removed the same invocations from gui.py & projectGroup.py. - Adapted the tests for the changes.
@SteffenBrinckmann Okay I moved the initialize_database() to the constructors of config_dialog.py and main_dialog.py, could you please re-look? Please ignore the failing tests, this happened because one of the "terminology lookup service"-website was down during the test execution! |
…ror message, adapted the tests.
(1) dataverse: for storing all the documents related to dataverse
(2) default_project_group_db_name that correspond to the default project group database for populating the PASTA projects in UI. Adapted the API calls to use the database names appropriately.