peter, perhaps the place to do this is in the prompt(s), not the parser; keep the config grammar strict, and make the human interface lenient.
if a person modifies the config file directly, s/he should understand the implications, there should be appropriate comments in any sample config and/or documentation, and whatever parses/uses the config should provide ample feedback (stdout and/or log) when there are problems. if that is the strategy, then the place to look in the V5 codebase is 'config_altitude' in bin/weecfg/station_config.py m > On 1 Apr 2023, at 09:52, 'Peter Fletcher' via weewx-development > <[email protected]> wrote: > > It really is a 'talking to humans' issue, not, in any real sense, a bug in > the code. weewx.conf is about the only place that a (non-developer) human > will be 'talking' to weewx, so it seems reasonable to take a few extra steps > to make the 'conversation' there more natural for the human. I am still > running V4.10, and haven't really looked at V5.x, but if you would like to > point me to the code in V5 that scans and parses weewx.conf, I will take a > stab at it. > > On 4/1/2023 8:25 AM, Tom Keffer wrote: >> Internally, weewx traffics in ValueTuples, which is a value along with a >> measurement unit. SI Units are things like "second", "meter", "kilogram," >> etc. not "seconds", "meters", and "kilograms". See NIST. So, internally, >> that's what we want. >> >> Now when we talk with humans, we may want to use plurality if there is >> likely to be more than one, but that requires a mapping to and from the >> singular value used internally. WeeWX already has some software that does >> the transition from internal (SI) units to language, so I suppose we could >> write something to go the other way. >> >> It all seems unnecessarily complicated, but if someone wants to write a PR, >> I'm willing to take a look. >> >> -tk -- You received this message because you are subscribed to the Google Groups "weewx-development" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-development/AB8608B2-ECD8-4110-947E-C1C2CD2D728B%40gmail.com.
