-
Notifications
You must be signed in to change notification settings - Fork 31
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
Filter map anns number 10m m #147
Conversation
Make sure that if some values aren't numbers, then ALL are string
This means we don't have to revert numbers to string if not all values are numbers. Instead, we parseFloat() on the fly when filtering
Sorry, I'm not doing units conversion in the filtering! |
you indicate in the description that |
There was a bug before because I was trying to convert strings to floats when the Map-Annotations loaded but if I found a value that wasn't strictly a number (e.g. "10mM") then I stopped trying to convert to numbers, so I was left with a mixture of strings and numbers. But to try and understand the units is way beyond the scope of this fix. One possibility is to enforce that ALL "units" are the same. e.g. you would only show a "number" filtering if all the numbers have the same string suffix. E.g. 0mM, 1mM 10mM, but if you also got "1M" or even "1" then we would bail out and say "you have to use string filtering". |
Description updated to new "units" behaviour. |
For this PR Wider discussion: Maybe for another PR: |
@pwalczysko Not sure what you mean by "KVPs do not have to come from the client"? Originally this PR was simply trying to fix the bug we saw when user entered values of e.g. 10, 15, 10 mM, where the filtering data structure would contain a mix of numbers and strings, causing unpredictable filtering behaviour. |
MapAnnotations can be added as a result of a run of a script. Maybe I did not understand your remark about enforcement at the filter type input - I took it to be enforcement at the KVP input, sorry. |
Ah, yes "We'd need the same enforcement on the filter type input, to only allow numbers to be entered" means that when you are filtering by number you can only enter numbers, not "3mins" as JM did above. |
Well, precisely. Of course this will not be done in this PR. But users want precisely just that. In practically every workshop - "Give me the means to police/unify the user inputs" - clear message form all. |
I think there is still a bug. I have a dataset https://merge-ci.openmicroscopy.org/web/webclient/?show=dataset-14769 user-3 |
@pwalczysko String comparisons are case insensitive. That hasn't changed in this PR. (https://github.com/ome/omero-web/pull/147/files#diff-d1ac2bf5c2ac41a675b7576648fb21b8R163). |
Yes, I might mind. Again, it shows that the feature is hard to understand I did not of course know that string comparison is case insensitive. And the suggestion in the dropdown is plainly misleading - you are suggesting two cases in the dropdown (10M and 10mM , then actually do not treat them differently when one is selected ? That is very unexpected. I would guess for now, change the behaviour to be case sensitive, and maybe, give me a "case sensitive" checkbox when I start to filter ? |
Actually, this is a bigger problem. I can see now that if I have two terms, such as "concentration" and "concentrationA", then there is no way to filter one out - I will always get images with both "concentration" and "concentrationA"- I will always get both, right ? This is different from our search behaviour, and is not explained anywhere. |
If you filter for "concentrationA" then you won't see images with "concentration". All filtering for strings (e.g. filter by name or for kvp) allows you to type part of the string. We have the same filtering behaviour in Parade. E.g. "When the Map Annotations are loaded, pick the Key Gene Symbol and enter the Value CEP to show all CEP genes and then CEP120 to show only images with that gene." (https://omero-guides.readthedocs.io/en/latest/parade/docs/omero_parade.html) |
Aha, yes, so it is not too bad. |
Tested the above: filter is now case sensitive. |
This works nicely now. #147 (comment) |
Still an outstanding mystery on https://merge-ci.openmicroscopy.org/web/webclient/?show=dataset-14769 of user-3. On the images of that dataset, I have for key @will-moore any idea why this difference ? Actually, the more surprising is the temperature, I would expect the filtering to be number-like. |
and keep looking for first value that has units. If units is empty string, don't enforce that other values also have NO units. So, we allow a mix of with/without units, as long as ALL units are the same
Fixed: Now, if some numbers are missing units and some have units, as long as all the units are the same, then it should be handled as a number field. |
@will-moore thanks, works fine now. There was a small apostrophy on one of the temperature values next to the Ready to merge fmpov |
Bugs noticed when preparing for workshop...
When filtering by Key-Values, we test each value for being a number.
But previously, values such as
10mM
weren't considered numbers.Now, we allow numbers to have 'units' (any suffix after the number) BUT ensure
that ALL the values have the same units, since we can't convert between units (see discussion below).
If various different units are found, or any value isn't a number then we revert to 'string' field.
To test: