populse / populse_mia

Multiparametric Image Analysis
Other
10 stars 9 forks source link

[DataBrowser indexing] When adding a tag to the database, if no default value is set, Mia crashes #270

Closed servoz closed 2 years ago

servoz commented 2 years ago

When adding a new tag in a project in the DataBrowser, Screenshot from 2022-04-25 11-48-12

if we forget to give a default value, Screenshot from 2022-04-25 11-50-17

Mia crashes with:

  File "/data/Git_Projects/populse_mia/python/populse_mia/user_interface/pop_ups.py", line 680, in ok_action
    wrong_default_value_type = not check_value_type(default_value,
  File "/data/Git_Projects/populse_mia/python/populse_mia/utils/utils.py", line 113, in check_value_type
    value = ast.literal_eval(value)
  File "/usr/lib64/python3.8/ast.py", line 59, in literal_eval
    node_or_string = parse(node_or_string, mode='eval')
  File "/usr/lib64/python3.8/ast.py", line 47, in parse
    return compile(source, filename, mode, flags,
  File "<unknown>", line 0

    ^
SyntaxError: unexpected EOF while parsing

Only tested with the Integer List Tag type.

servoz commented 2 years ago

I've just pushed a fix into the issue#270_2_3 branch for method 2.3, for now only for strings and lists of strings. From this base, it should be fairly easy to extend to all other types. @YannNdr is currently working on method 2.4, which would be the best to implement (no polluting popup).

servoz commented 2 years ago

After the 9305597 commit the Uts were failing. I just pushed a fix to restart them. So if we want to stick to the 2-3 solution, the issue#270_2_3 branch should do the trick (taking all types into account, for now only strings and lists of strings are handled).

servoz commented 2 years ago

Thanks to @YannNdr's work, we should be able to close this ticket very soon (we are waiting to see the result of the UTs before merging the issue#270_2_4 into master).

However, while testing the new way of adding a tag, I accidentally noticed that there are issues when we want to change the tags value for some types. I will open a new ticket about this because I think it is independent from ticket #270.

servoz commented 2 years ago

The UTs are working correctly, the issue#270_2_4 branch has been merged with master and I have just opened the ticket for the Boolean, Time list and Datetime list types which are currently not well handled (#276). This ticket can now be closed.