Skip to content
Snippets Groups Projects
  • Alan De Smet's avatar
    7470eaa5
    Statistics now work on scalar values (0d arrays) · 7470eaa5
    Alan De Smet authored
    For variables who shape is "0" (that is, a simple scalar value), statistics calculations now work.  Although many of the statistics are silly, this is useful for report generation.
    
    Implementation: DataObject has a new function "holding_array" which in most cases returns itself. But if self.data.shape==0, it returns a copy of itself with self.data's scalar value tossed into a single element array.  Now that the data is an array, as expected, the statistics code works fine.
    7470eaa5
    History
    Statistics now work on scalar values (0d arrays)
    Alan De Smet authored
    For variables who shape is "0" (that is, a simple scalar value), statistics calculations now work.  Although many of the statistics are silly, this is useful for report generation.
    
    Implementation: DataObject has a new function "holding_array" which in most cases returns itself. But if self.data.shape==0, it returns a copy of itself with self.data's scalar value tossed into a single element array.  Now that the data is an array, as expected, the statistics code works fine.