Skip to content
  • Tjerk Vreeken's avatar
    Add convenience method for merging bounds · 1c596b67
    Tjerk Vreeken authored
    A common desire is to update bounds on variables based on some
    additional source of data. When doing so, one wants to derive the
    intersection of the existing bounds and the bounds following from the
    additional data. When the types of these bounds do not match, this
    becomes a difficult task, resulting in users setting bounds looser than
    might be possible.
    
    The convience method added in this commit handles such type conversions
    for the user. It handles upcasting floats to Timeseries, and also
    handles various combinations of vector bounds (as 2D Timeseries or
    1D NumPy arrays).
    
    Note that this convenience does come at the cost of performance. A
    simple min/max merge on bounds which are known to be scalar can be done
    in about 350 ns, whereas the method added in this commit takes about 10
    times as long with 3.5 us. Merging a combination Timeseries and NumPy
    arrays can easily take 30-40 us per call.
    
    Closes #1074
    1c596b67