sstsimulator / sst-core

SST Structural Simulation Toolkit Parallel Discrete Event Core and Services
http://www.sst-simulator.org
Other
129 stars 88 forks source link

UnitAlgebra BestSI for time #305

Open ghost opened 7 years ago

ghost commented 7 years ago

It would be nice to special-case the BestSI functions on UnitAlgebra for time, specifically when the amount of time passed is greater than seconds. Most people don't typically think in KiloSeconds and MegaSeconds, but rather minutes, hours, days, etc.

jjwilke commented 5 years ago

I agree that Ks and Ms are weird units. I worry that this might break any string parsing code out there - and might make plotting results MORE difficult. If I grab a time from the file, I don't want to have to parse hours + minutes + seconds and convert to seconds.

What if we print us, ms, s - then stop at seconds and just print larger seconds. In parentheses, we could print hours, minutes, seconds for human readable but still keep seconds available for parsing and avoid breaking anyone's parsing scripts.

1.3456Ks -> 1345.6s (22m 25.6s)
feldergast commented 3 years ago

This is a challenge to do since UnitAlgebra doesn't really know anything about the units that are registered with it. We could possibly change the unit registration to include the ability to have functions that can do some of these conversions. I'll look into it.