Belle II Software development
SavePullAnalysisRefiner Class Reference
Inheritance diagram for SavePullAnalysisRefiner:
Refiner

Public Member Functions

def __init__ (self, name=None, contact=None, title_postfix=None, part_name=None, part_names=None, truth_name=None, estimate_name=None, variance_name=None, quantity_name=None, aux_names=None, unit=None, outlier_z_score=None, absolute=False, which_plots=None)
 
def refine (self, harvesting_module, crops, tdirectory=None, groupby_part_name=None, groupby_value=None, **kwds)
 

Public Attributes

 name
 cached name for this pull analysis
 
 contact
 cached contact person for this pull analysis
 
 title_postfix
 cached suffix for the title of this pull analysis
 
 part_names
 cached array of part names for this pull analysis
 
 truth_name
 cached name for the pull analysis truth-values collection
 
 estimate_name
 cached name for the pull analysis estimates collection
 
 variance_name
 cached name for the pull analysis variances collection
 
 quantity_name
 cached name of the quantity for the pull analysis
 
 unit
 cached measurement unit for the pull analysis
 
 aux_names
 cached auxiliary names for the pull analysis
 
 outlier_z_score
 cached Z-score (for outlier detection) for the pull analysis
 
 absolute
 cached absolute-value-comparison flag for the pull analysis
 
 which_plots
 cached list of plots produced by the pull analysis
 

Static Public Attributes

str default_name = "{module.id}_{quantity_name}"
 default name for this pull analysis
 
str default_contact = "{module.contact}"
 default contact person for this pull analysis
 
str default_title_postfix = " from {module.title}"
 default suffix for the title of this pull analysis
 
str default_truth_name = "{part_name}_truth"
 default name for the pull analysis truth-values collection
 
str default_estimate_name = "{part_name}_estimate"
 default name for the pull analysis estimates collection
 
str default_variance_name = "{part_name}_variance"
 default name for the pull analysis variances collection
 

Detailed Description

Refiner for pull analyses

Definition at line 657 of file refiners.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  name = None,
  contact = None,
  title_postfix = None,
  part_name = None,
  part_names = None,
  truth_name = None,
  estimate_name = None,
  variance_name = None,
  quantity_name = None,
  aux_names = None,
  unit = None,
  outlier_z_score = None,
  absolute = False,
  which_plots = None 
)
Constructor for this refiner

Reimplemented from Refiner.

Definition at line 674 of file refiners.py.

688 which_plots=None):
689 """Constructor for this refiner"""
690 if aux_names is None:
691 aux_names = []
692
693 self.name = name
694
695 self.contact = contact
696
697 self.title_postfix = title_postfix
698
699
700 self.part_names = []
701 if part_names is not None:
702 self.part_names = part_names
703
704 if part_name is not None:
705 self.part_names.append(part_name)
706
707
708 self.truth_name = truth_name
709
710 self.estimate_name = estimate_name
711
712 self.variance_name = variance_name
713
714
715 self.quantity_name = quantity_name
716
717 self.unit = unit
718
719
720 self.aux_names = aux_names
721
722
723 self.outlier_z_score = outlier_z_score
724
725 self.absolute = absolute
726
727 self.which_plots = which_plots
728

Member Function Documentation

◆ refine()

def refine (   self,
  harvesting_module,
  crops,
  tdirectory = None,
  groupby_part_name = None,
  groupby_value = None,
**  kwds 
)
Process the pull analysis

Reimplemented from Refiner.

Definition at line 729 of file refiners.py.

735 **kwds):
736 """Process the pull analysis"""
737
738 replacement_dict = dict(
739 refiner=self,
740 module=harvesting_module,
741 # stackby_key='_' + stackby if stackby else "",
742 groupby_key='_' + groupby_part_name + groupby_value if groupby_part_name else "",
743 groupby=groupby_part_name, # deprecated
744 groupby_value=groupby_value, # deprecated
745 )
746
747 contact = self.contact or self.default_contact
748 contact = formatter.format(contact, **replacement_dict)
749
750 name = self.name or self.default_name
751
752 if self.aux_names:
753 auxiliaries = select_crop_parts(crops, self.aux_names)
754 else:
755 auxiliaries = {}
756
757 for part_name in self.part_names:
758 name = formatter.format(name, part_name=part_name, **replacement_dict)
759 plot_name = name + "_{subplot_name}"
760
761 title_postfix = self.title_postfix
762 if title_postfix is None:
763 title_postfix = self.default_title_postfix
764
765 title_postfix = formatter.format(title_postfix, part_name=part_name, **replacement_dict)
766 plot_title = "{subplot_title} of {quantity_name}" + title_postfix
767
768 if self.truth_name is not None:
769 truth_name = self.truth_name
770 else:
771 truth_name = self.default_truth_name
772
773 if self.estimate_name is not None:
774 estimate_name = self.estimate_name
775 else:
776 estimate_name = self.default_estimate_name
777
778 if self.variance_name is not None:
779 variance_name = self.variance_name
780 else:
781 variance_name = self.default_variance_name
782
783 truth_name = formatter.format(truth_name, part_name=part_name)
784 estimate_name = formatter.format(estimate_name, part_name=part_name)
785 variance_name = formatter.format(variance_name, part_name=part_name)
786
787 truths = crops[truth_name]
788 estimates = crops[estimate_name]
789 try:
790 variances = crops[variance_name]
791 except KeyError:
792 variances = None
793
794 quantity_name = self.quantity_name or part_name
795
796 which_plots = self.which_plots
797
798 pull_analysis = PullAnalysis(quantity_name,
799 unit=self.unit,
800 absolute=self.absolute,
801 outlier_z_score=self.outlier_z_score,
802 plot_name=plot_name,
803 plot_title=plot_title)
804
805 pull_analysis.analyse(truths,
806 estimates,
807 variances,
808 auxiliaries=auxiliaries,
809 which_plots=which_plots)
810
811 pull_analysis.contact = contact
812
813 if tdirectory:
814 pull_analysis.write(tdirectory)
815
816

Member Data Documentation

◆ absolute

absolute

cached absolute-value-comparison flag for the pull analysis

Definition at line 725 of file refiners.py.

◆ aux_names

aux_names

cached auxiliary names for the pull analysis

Definition at line 720 of file refiners.py.

◆ contact

contact

cached contact person for this pull analysis

Definition at line 695 of file refiners.py.

◆ default_contact

str default_contact = "{module.contact}"
static

default contact person for this pull analysis

Definition at line 663 of file refiners.py.

◆ default_estimate_name

str default_estimate_name = "{part_name}_estimate"
static

default name for the pull analysis estimates collection

Definition at line 670 of file refiners.py.

◆ default_name

str default_name = "{module.id}_{quantity_name}"
static

default name for this pull analysis

Definition at line 661 of file refiners.py.

◆ default_title_postfix

str default_title_postfix = " from {module.title}"
static

default suffix for the title of this pull analysis

Definition at line 665 of file refiners.py.

◆ default_truth_name

str default_truth_name = "{part_name}_truth"
static

default name for the pull analysis truth-values collection

Definition at line 668 of file refiners.py.

◆ default_variance_name

str default_variance_name = "{part_name}_variance"
static

default name for the pull analysis variances collection

Definition at line 672 of file refiners.py.

◆ estimate_name

estimate_name

cached name for the pull analysis estimates collection

Definition at line 710 of file refiners.py.

◆ name

name

cached name for this pull analysis

Definition at line 693 of file refiners.py.

◆ outlier_z_score

outlier_z_score

cached Z-score (for outlier detection) for the pull analysis

Definition at line 723 of file refiners.py.

◆ part_names

part_names

cached array of part names for this pull analysis

Definition at line 700 of file refiners.py.

◆ quantity_name

quantity_name

cached name of the quantity for the pull analysis

Definition at line 715 of file refiners.py.

◆ title_postfix

title_postfix

cached suffix for the title of this pull analysis

Definition at line 697 of file refiners.py.

◆ truth_name

truth_name

cached name for the pull analysis truth-values collection

Definition at line 708 of file refiners.py.

◆ unit

unit

cached measurement unit for the pull analysis

Definition at line 717 of file refiners.py.

◆ variance_name

variance_name

cached name for the pull analysis variances collection

Definition at line 712 of file refiners.py.

◆ which_plots

which_plots

cached list of plots produced by the pull analysis

Definition at line 727 of file refiners.py.


The documentation for this class was generated from the following file: