Log Units?

Linus Torvalds torvalds at linux-foundation.org
Sun Apr 28 17:34:06 PDT 2013


On Sun, Apr 28, 2013 at 4:44 PM, Mark Kampe <mark.kampe at gmail.com> wrote:
>
> I will make no excuses the stubborn resistance of the US Congress to
> the the adoption of a more rational system of measure.  All nations,
> and political systems are subject to fits of insanity.  But the most
> important person to whom a log entry must make sense is the diver in
> question.

So I disagree. I agree 100% that the XML needs to be *readable*, and
that was one of the earliest requirements for me because I hate hate
HATE bad XML that isn't human-readable.

But at the same time, the absolute first requirement is that it be
*reliable*, especially for machine reading. And quite frankly, right
now we don't even bother parsing the units, because we know our native
units are in SI units (where "SI units" is *not* necessary base units
- we use "liters" and "bar" instead of the SI base units of m^3 and
pascal, because they are unambiguous and simple, and they are still
perfectly well derived units in SI, even if they may not be the "base"
unit).

Which means that if we started to actually save things in anything but
SI units, we'd have lots and lots of very fundamental problems:

 - all current and old versions of subsurface would mis-parse the new
files. As would likely anybody else who imports subsurface xml.

 - we carefully maintain our data in well-defined internal units,
which are defined in terms of SI units. We generally have no rounding
issues on reading/writing our XML files, although arguably the
conversion from C to our internal milli-Kelvin representation could
cause issues (we are fairly careful about it, though). Saving things
in imperial units would immediately start the whole "what precision"
and "double rounding" issue (not to mention the "*which* imperial
unit" issue that Dirk has mentioned).

So I really think we should maintain our data structures as SI units.
We're perfectly happy to import non-SI stuff, but let's face it,
imperial is confusing, and wrong. We *show* things in imperial, but if
you are technical enough that you want to read the XML files, I'd
suggest you just learn the proper units at that point.

                         Linus


More information about the subsurface mailing list