Fix incoherent tag handling
MR description
This MR adresses #471 (closed): change behaviour of dataset tags when adding or modifying a dataset, to make this behaviour coherent:
- modify
DatasetManager
functions- for adding a dataset (
add_database
) to properly check tags using a new dedicated function (search_conflicting_tags
). This fixes the CLI - for updating a dataset (
modify_database_info
). This function was unused, so we changed the prototype to make it match the needs of the GUI. Also added proper checks withsearch_conflicting_tags
.
- for adding a dataset (
- fix GUI to do the checks. As GUI currently does not properly use
DatasetManager
(see #338) this requires some distinct fixes. We changed the Flask server routes for adding/updating datasets to use theDatasetManager
(minimal refactoring needed to fix the issue) - adapt and add unit tests
What can be tested, under both CLI and GUI:
- add a dataset with same tags as an existing dataset (conflict)
- add a dataset with subset of tags from an existing dataset (conflict)
- add a dataset with superset of tags from an existing dataset (conflict)
- add twice the default dataset with same tags (conflict)
- update tags from a dataset to be same tags as an existing dataset (conflict)
- update tags from a dataset to be subset of tags from an existing dataset (conflict)
- update tags from a dataset to be superset of tags from an existing dataset (conflict)
- several scenarios of adding dataset with some tags common with existing datasets, but not all (ok)
- ...
Developer Certificate Of Origin (DCO)
By opening this merge request, you agree the Developer Certificate of Origin (DCO)
This DCO essentially means that:
- you offer the changes under the same license agreement as the project, and
- you have the right to do that,
- you did not steal somebody else’s work.
License
Project code files should begin with these comment lines to help trace their origin:
# This file is originally part of Fed-BioMed
# SPDX-License-Identifier: Apache-2.0
Code files can be reused from another project with a compatible non-contaminating license.
They shall retain the original license and copyright mentions.
The CREDIT.md
file and credit/
directory shall be completed and updated accordingly.
Guidelines for MR review
General:
- give a glance to DoD
- check coding rules and coding style
- check docstrings (eg run
tests/docstrings/check_docstrings
)
Specific to some cases:
- update all conda envs consistently (
development
andvpn
, Linux and MacOS) - if modified researcher (eg new attributes in classes) check if breakpoint needs update (
breakpoint
/load_breakpoint
inExperiment()
,save_state
/load_state
in aggregators, strategies, secagg, etc.)