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

Public Member Functions

 __init__ (self, wrapped_refiner, select=None, exclude=None)
 
 refine (self, harvesting_module, crops, *args, **kwds)
 
 __get__ (self, harvesting_module, cls=None)
 
 __call__ (self, harvesting_module, crops=None, *args, **kwds)
 

Public Attributes

 wrapped_refiner = wrapped_refiner
 cached value of the wrapped refiner
 
 select = select
 cached value of the selector
 
 exclude = exclude
 cached value of the exclusion flag
 
 refiner_function = refiner_function
 cached copy of the instance's refiner function
 

Detailed Description

Refiner for selection

Definition at line 917 of file refiners.py.

Constructor & Destructor Documentation

◆ __init__()

__init__ ( self,
wrapped_refiner,
select = None,
exclude = None )
Constructor for this refiner

Definition at line 920 of file refiners.py.

920 def __init__(self, wrapped_refiner, select=None, exclude=None):
921 """Constructor for this refiner"""
922 if select is None:
923 select = []
924 if exclude is None:
925 exclude = []
926 ## cached value of the wrapped refiner
927 self.wrapped_refiner = wrapped_refiner
928 ## cached value of the selector
929 self.select = select
930 ## cached value of the exclusion flag
931 self.exclude = exclude
932

Member Function Documentation

◆ __call__()

__call__ ( self,
harvesting_module,
crops = None,
* args,
** kwds )
inherited
implementation of the function-call of the Refiner instance
     r = Refiner()
     r(harvester) # decoration
     r(harvester, crops, args, keywords) # refinement

Definition at line 55 of file refiners.py.

55 def __call__(self, harvesting_module, crops=None, *args, **kwds):
56 """implementation of the function-call of the Refiner instance
57 r = Refiner()
58 r(harvester) # decoration
59 r(harvester, crops, args, keywords) # refinement
60 """
61 if crops is None:
62 # Decoration mode
63 harvesting_module.refiners.append(self)
64 return harvesting_module
65 else:
66 # Refining mode
67 return self.refine(harvesting_module, crops, *args, **kwds)
68

◆ __get__()

__get__ ( self,
harvesting_module,
cls = None )
inherited
Getter of the Refiner instance

Definition at line 42 of file refiners.py.

42 def __get__(self, harvesting_module, cls=None):
43 """Getter of the Refiner instance"""
44 if harvesting_module is None:
45 # Class access
46 return self
47 else:
48 # Instance access
49 refine = self.refine
50
51 def bound_call(*args, **kwds):
52 return refine(harvesting_module, *args, **kwds)
53 return bound_call
54

◆ refine()

refine ( self,
harvesting_module,
crops,
* args,
** kwds )
Process this selection

Reimplemented from Refiner.

Definition at line 933 of file refiners.py.

933 def refine(self, harvesting_module, crops, *args, **kwds):
934 """Process this selection"""
935 selected_crops = select_crop_parts(crops, select=self.select, exclude=self.exclude)
936 self.wrapped_refiner(harvesting_module, selected_crops, *args, **kwds)
937
938

Member Data Documentation

◆ exclude

exclude = exclude

cached value of the exclusion flag

Definition at line 931 of file refiners.py.

◆ refiner_function

refiner_function = refiner_function
inherited

cached copy of the instance's refiner function

Definition at line 40 of file refiners.py.

◆ select

select = select

cached value of the selector

Definition at line 929 of file refiners.py.

◆ wrapped_refiner

wrapped_refiner = wrapped_refiner

cached value of the wrapped refiner

Definition at line 927 of file refiners.py.


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