compress_mesa

compress_mesa.compress_dir(args)[source]

Compresses a directory containing tracks evolved with MESA.

compress_mesa.set_up_test(args)[source]

Set up a testing directory in the requested directory.

compress_mesa.textsize(filesize, floatfmt='.3g', base=1024, threshold=1000)[source]

Get a human-readable file size in string.

Parameters:
  • filesize (int or float) – The size of the file, or directory, … (in bytes)

  • floatfmt (str) – The format for the float before the size descriptor (e.g., 2.34K).

  • base (int) – The base of the units. Typically 1024 but 1000 can be used as well.

  • threshold (int or float) – The threshold for using the next unit. For example, if base is 1024 and threshold is 1000, then 1000 bytes will be returned as 0.98K.

Returns:

The filesize in string format using b, K, M, …

Return type:

str