docstr: Example metrics pipeline for comparing test data with other (full) external reference set
  
  :param str hists_key: key to test histograms in datastore. default is 'test_hists'
  :param str ref_hists_key: key to reference histograms in datastore. default is 'ref_hists'
  :return: assembled external reference pipeline
docstr_tok: ["Example","metrics","pipeline","for","comparing","test","data","with","other","(","full",")","external","reference","set",":","param","str","hists_key",":","key","to","test","histograms","in","datastore",".","default","is","'test_hists'",":","param","str","ref_hists_key",":","key","to","reference","histograms","in","datastore",".","default","is","'ref_hists'",":","return",":","assembled","external","reference","pipeline"]
code: def __init__(
      self,
      settings: Settings,
      hists_key: str = "test_hists",
      ref_hists_key: str = "ref_hists",
  ) -> None:
      """Example metrics pipeline for comparing test data with other (full) external reference set
  
      :param str hists_key: key to test histograms in datastore. default is 'test_hists'
      :param str ref_hists_key: key to reference histograms in datastore. default is 'ref_hists'
      :return: assembled external reference pipeline
      """
      from popmon.analysis.comparison import Comparisons
  
      reference_prefix = "ref"
      reference_modules: list[Module | Pipeline] = [
          # 3. Profiling of split reference histograms, then chi2 comparison with test histograms
          HistSplitter(
              read_key=ref_hists_key,
              store_key="split_ref_hists",
              features=settings.features,
              feature_begins_with=f"{settings.time_axis}:",
          ),
          ReferenceHistComparer(
              reference_key="split_ref_hists",
              assign_to_key="split_hists",
              store_key="comparisons",
          ),
          HistProfiler(
              read_key="split_ref_hists", store_key="ref_profiles"
          ),
          RefMedianMadPullCalculator(
              reference_key="comparisons",
              assign_to_key="comparisons",
              suffix_mean="_mean",
              suffix_std="_std",
              suffix_pull="_pull",
              metrics=[
                  f"{reference_prefix}_{key}"
                  for key in Comparisons.get_keys()
                  if key in ["max_prob_diff", "psi", "jsd"]
              ],
          ),
          # 4. pull calculation compared with reference mean and std, to obtain normalized residuals of profiles
          ReferencePullCalculator(
              reference_key="ref_profiles",
              assign_to_key="profiles",
              suffix_mean="_mean",
              suffix_std="_std",
              suffix_pull="_pull",
          ),
      ]
      modules = (
          get_timing_module("start_time")
          + get_splitting_modules(
              hists_key, settings.features, settings.time_axis
          )
          + reference_modules
          + get_trend_modules(settings.comparison.window)
          + get_static_bound_modules(settings.monitoring.pull_rules)
          + get_traffic_light_modules(
              settings.monitoring.monitoring_rules
          )
          + get_timing_module("end_time")
      )
      super().__init__(modules)
  
imports: from __future__ import annotations
  from popmon.alerting import AlertsSummary, DynamicBounds, StaticBounds, TrafficLightAlerts, traffic_light_summary
  from popmon.analysis.apply_func import ApplyFunc
  from popmon.analysis.comparison.hist_comparer import ExpandingHistComparer, PreviousHistComparer, ReferenceHistComparer, RollingHistComparer
  from popmon.analysis.functions import rolling_lr_zscore
  from popmon.analysis.profiling import HistProfiler
  from popmon.analysis.profiling.pull_calculator import ExpandingPullCalculator, ReferencePullCalculator, RefMedianMadPullCalculator, RollingPullCalculator
  from popmon.base import Module, Pipeline
  from popmon.config import Settings
  from popmon.hist.hist_splitter import HistSplitter
  from .timing import Timing
label_desc: Use image node_id 1 to create a new ExternalReferenceMetricsPipeline object from inherited base classes: Pipeline with example: obj = ExternalReferenceMetricsPipeline(settings, hists_key, ref_hists_key)