How to deal with very small values in comboboxes
❓ Questions and Help
I've recently been doing some stuff with comboboxes where i have very small values like 50e-9 to represent 50 ns in units of seconds. When trying to use these with magicgui I only see 00.00 in the combobox I guess because of how the precision is set. For now i've switch the representing the values in (ns), so 50, and maybe that's the most user friendly option, but just wanted to open this issue up in case there were better approaches (apologies if this is a duplicate).
A related discussion might also tough on what is the best way to have quantities with units in magicgui - i know we've not quite gotten that one solved for napari either yet.
Here's a link to some "real world" code where I'm exploring this https://github.com/sofroniewn/waver/pull/5/files#
you'd either need to do the conversion (i.e. declare that you're working in ns instead of seconds), or we'd need to create a custom "scientific notation" widget.
A related discussion might also tough on what is the best way to have quantities with units in magicgui - i know we've not quite gotten that one solved for napari either yet.
I actually have a branch with a special widget for that that's nearly completed! need to get back to it:
This has also been improved for me by upgrading to magicgui 0.2.9, so is maybe a little less urgent - I can now see 0.000010 for example.
I actually have a branch with a special widget for that that's nearly completed! need to get back to it:
Aweomse!!! Yes, I think the better approach here would be to create nice widgets to use for all the SI physical quantities, time, length, etc. and then folks could request those as special comboboxes and magicgui would handle all the unit conversion for them - would be so slick
superqt now has a quantity widget ... could add to magicgui https://napari.org/superqt/widgets/qquantity/