class_docstr: Module stitches histograms by date
docstr: Get sum of histograms using h1.bins.update(h2.bins), from first to last hist
  
  Get sum of list of histograms by using bins.update(), where the update is applied
  by iterating over the histogram list, from the first to the last histogram.
  Meaning the next bins can overwrite the previous bins.
  This is used for merging (bins of) histograms that can be topped up over time.
  
  :param str mode: options for histogram stitching: "add" or "replace". default is "add".
  :param list hist_list: list of input histogrammar histograms
  :return: list of consistent 1d numpy arrays with bin_entries for list of input histograms
docstr_tok: ["Get","sum","of","histograms","using","h1.bins.update","(","h2.bins",")",",","from","first","to","last","hist","Get","sum","of","list","of","histograms","by","using","bins.update","(",")",",","where","the","update","is","applied","by","iterating","over","the","histogram","list",",","from","the","first","to","the","last","histogram",".","Meaning","the","next","bins","can","overwrite","the","previous","bins",".","This","is","used","for","merging","(","bins","of",")","histograms","that","can","be","topped","up","over","time",".",":","param","str","mode",":","options","for","histogram","stitching",":","``","add","''","or","``","replace","''",".","default","is","``","add","''",".",":","param","list","hist_list",":","list","of","input","histogrammar","histograms",":","return",":","list","of","consistent","1d","numpy","arrays","with","bin_entries","for","list","of","input","histograms"]
code: def _stitch_by_update(self, mode, hist_list):
      """Get sum of histograms using h1.bins.update(h2.bins), from first to last hist
  
      Get sum of list of histograms by using bins.update(), where the update is applied
      by iterating over the histogram list, from the first to the last histogram.
      Meaning the next bins can overwrite the previous bins.
      This is used for merging (bins of) histograms that can be topped up over time.
  
      :param str mode: options for histogram stitching: "add" or "replace". default is "add".
      :param list hist_list: list of input histogrammar histograms
      :return: list of consistent 1d numpy arrays with bin_entries for list of input histograms
      """
      # --- basic checks
      if len(hist_list) == 0:
          raise ValueError("Input histogram list has zero length.")
      assert_similar_hists(hist_list)
  
      # --- loop over all histograms and update zeroed-original consecutively
      hsum = hist_list[0].zero()
  
      if mode == "replace":
          # check consistency of histogram bins attributes
          is_bins = all(hasattr(hist, "bins") for hist in hist_list)
          if not is_bins:
              raise TypeError(
                  "Not all input histograms have bins attribute."
              )
          # update bins consecutively for each time-delta.
          for hist in hist_list:
              hsum.bins.update(hist.bins)
          hsum.entries = sum(b.entries for b in hsum.bins.values())
      else:
          for hist in hist_list:
              hsum += hist
      return hsum
  
file_path: popmon/popmon/stitching/hist_stitcher.py
imports: import histogrammar
  import numpy
  from popmon.analysis.hist_numpy import assert_similar_hists
  from popmon.base import Module
label_desc: Use image node_id 9 for calling the HistStitcher obj's underlying member method code with example usage: obj._stitch_by_update(mode, hist_list) and returns: hsum