In practice, an input like 1m in a frequency field is much more likely to be a user typo or shorthand for something else than a deliberate request for milli-Hz.
That means the current behaviour can silently send a completely wrong value to the instrument without any warning in the log.
Fix approach
Add input validation for ambiguous suffix usage and log a warning when m is used in contexts where it is likely unsafe or misleading.
Possible options:
reject ambiguous input
warn and refuse to send
only allow explicit suffixes such as ms, mV, kHz, MHz, etc.
Status
Still open.
Not fixed in the current v0.2 working copy.
### Problem
`human_to_eng()` accepts `m` as milli, which can silently misinterpret user input in fields where that is probably not what was meant.
### Current code context
```python
elif t.endswith("m") and not t.endswith("mm"):
mult = 1e-3
t = t[:-1]
```
### Why this is a problem
In practice, an input like `1m` in a frequency field is much more likely to be a user typo or shorthand for something else than a deliberate request for milli-Hz.
That means the current behaviour can silently send a completely wrong value to the instrument without any warning in the log.
### Fix approach
Add input validation for ambiguous suffix usage and log a warning when `m` is used in contexts where it is likely unsafe or misleading.
Possible options:
- reject ambiguous input
- warn and refuse to send
- only allow explicit suffixes such as `ms`, `mV`, `kHz`, `MHz`, etc.
### Status
Still open.
Not fixed in the current v0.2 working copy.
human_to_eng() no longer silently accepts bare m as milli. This was unsafe because inputs like 1m could be interpreted as 1e-3 and sent to the instrument without any warning.
The parser now rejects ambiguous bare m / M input and requires explicit units instead, for example ms, mV, kHz, or MHz. The affected GUI apply paths were also updated so invalid ambiguous input is refused and logged, instead of being converted and sent.
Result:
ambiguous m suffix no longer slips through silently
user gets a warning in the log
explicit units continue to work as intended
Fixed in v0.2.6.
`human_to_eng()` no longer silently accepts bare `m` as milli. This was unsafe because inputs like `1m` could be interpreted as `1e-3` and sent to the instrument without any warning.
The parser now rejects ambiguous bare `m` / `M` input and requires explicit units instead, for example `ms`, `mV`, `kHz`, or `MHz`. The affected GUI apply paths were also updated so invalid ambiguous input is refused and logged, instead of being converted and sent.
Result:
- ambiguous `m` suffix no longer slips through silently
- user gets a warning in the log
- explicit units continue to work as intended
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Problem
human_to_eng()acceptsmas milli, which can silently misinterpret user input in fields where that is probably not what was meant.Current code context
Why this is a problem
In practice, an input like
1min a frequency field is much more likely to be a user typo or shorthand for something else than a deliberate request for milli-Hz.That means the current behaviour can silently send a completely wrong value to the instrument without any warning in the log.
Fix approach
Add input validation for ambiguous suffix usage and log a warning when
mis used in contexts where it is likely unsafe or misleading.Possible options:
ms,mV,kHz,MHz, etc.Status
Still open.
Not fixed in the current v0.2 working copy.
human_to_eng() silently accepts ambiguous 'm' suffixto [Bug]: human_to_eng() silently accepts ambiguous 'm' suffixFixed in v0.2.6.
human_to_eng()no longer silently accepts baremas milli. This was unsafe because inputs like1mcould be interpreted as1e-3and sent to the instrument without any warning.The parser now rejects ambiguous bare
m/Minput and requires explicit units instead, for examplems,mV,kHz, orMHz. The affected GUI apply paths were also updated so invalid ambiguous input is refused and logged, instead of being converted and sent.Result:
msuffix no longer slips through silently