romspline/helpers.py
def total_compression(*compressions):
  """Compute the total amount of compression achieved for
  multiple datasets that have the same number of samples.
  
  Input
  -----
    compressions -- list or array containing the compression
                    factors for each dataset
  
  Output
  ------
    The total compression factor is defined as the sum of 
  the full dataset sizes divided by the sum of the reduced 
  dataset sizes.
  
  Comments
  --------
  When the full datasets have the same number of samples then
  the definition for the total compression factor can be simplified
  to the number of datasets divided by the sum of the reciprocal 
  compression factors for each dataset.
  """
  _sum = 0.
  for cc in compressions:
    _sum += 1./cc
  
  return len(compressions) / _sum
Compute the total amount of compression achieved for
  multiple datasets that have the same number of samples.
  
  Input
  -----
    compressions -- list or array containing the compression
                    factors for each dataset
  
  Output
  ------
    The total compression factor is defined as the sum of 
  the full dataset sizes divided by the sum of the reduced 
  dataset sizes.
  
  Comments
  --------
  When the full datasets have the same number of samples then
  the definition for the total compression factor can be simplified
  to the number of datasets divided by the sum of the reciprocal 
  compression factors for each dataset.
  
Compute the total amount of compression achieved for
multiple datasets that have the same number of samples.

Input

- list or array containing the compression
factors for each dataset

Output

The total compression factor is defined as the sum of
the full dataset sizes divided by the sum of the reduced
dataset sizes.

Comments

When the full datasets have the same number of samples then
the definition for the total compression factor can be simplified
to the number of datasets divided by the sum of the reciprocal
compression factors for each dataset.
Compute the total amount of compression achieved for multiple datasets that have the same number of samples . Input - list or array containing the compression factors for each dataset Output The total compression factor is defined as the sum of the full dataset sizes divided by the sum of the reduced dataset sizes . Comments When the full datasets have the same number of samples then the definition for the total compression factor can be simplified to the number of datasets divided by the sum of the reciprocal compression factors for each dataset .
def total_compression(*compressions):
  _sum = 0.
  for cc in compressions:
    _sum += 1./cc
  return len(compressions) / _sum
def total_compression ( * compressions ) : _sum = 0. for cc in compressions : _sum += 1. / cc return len ( compressions ) / _sum
Compute the total amount of compression achieved for
multiple datasets that have the same number of samples.
Compute the total amount of compression achieved for multiple datasets that have the same number of samples .
"""Compute the total amount of compression achieved for
  multiple datasets that have the same number of samples.
  
  Input
  -----
    compressions -- list or array containing the compression
                    factors for each dataset
  
  Output
  ------
    The total compression factor is defined as the sum of 
  the full dataset sizes divided by the sum of the reduced 
  dataset sizes.
  
  Comments
  --------
  When the full datasets have the same number of samples then
  the definition for the total compression factor can be simplified
  to the number of datasets divided by the sum of the reciprocal 
  compression factors for each dataset.
  """