opensim-org / opensim-core

SimTK OpenSim C++ libraries and command-line applications, and Java/Python wrapping.
https://opensim.stanford.edu
Apache License 2.0
783 stars 316 forks source link

Output precision for different tools and files #3649

Closed carmichaelong closed 4 months ago

carmichaelong commented 9 months ago
  1. Define output precision needs for different tools and files
  2. Document what the goal is for each tool and file (either in a unified file or at the top of different files). For instance, perhaps states files can be full precision to satisfy a need for exact reproducibility so that you can continue an optimization.
mrrezaie commented 9 months ago

Hi, I was about to suggest a new feature in this regard. It would be great if you let users to set the output precision when writing files with STOFileAdapter and TRCFileAdapter. Compared to Storage output which has fixed 8-digit decimals, STOFileAdapter output may have up to 19 decimal digits. For example, a new argument like setPrecision in the write methods with a default value of -1, which means full precision.

But, it's great that STOFileAdapter ignores trailing zeros unlike Storage.

This feature would help reduce the size of the written files.

Thank you.

aymanhab commented 5 months ago

@fcanderson Please confirm if this issue can be closed per your simbody changes. Thank you