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

Public Member Functions

def __init__ (self, wrapped_refiner, folder_name=None, groupby_addition=None)
 
def refine (self, harvesting_module, crops, tdirectory=None, groupby_part_name=None, groupby_value=None, *args, **kwds)
 

Public Attributes

 wrapped_refiner
 cached value of the wrapped refiner
 
 folder_name
 cached value of the folder name
 
 groupby_addition
 cached value of the suffix for a groupby selection
 

Static Public Attributes

str default_folder_name = ""
 Folder name to be used if a groupby selection is active.
 
str default_groupby_addition = "_groupby_{groupby}_{groupby_value}"
 Default suffix for a groupby selection.
 

Detailed Description

Refiner for change-directory

Definition at line 1039 of file refiners.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  wrapped_refiner,
  folder_name = None,
  groupby_addition = None 
)
Constructor for this refiner

Reimplemented from Refiner.

Definition at line 1047 of file refiners.py.

1050 groupby_addition=None):
1051 """Constructor for this refiner"""
1052
1053
1054 self.wrapped_refiner = wrapped_refiner
1055
1056 self.folder_name = folder_name
1057
1058 self.groupby_addition = groupby_addition
1059

Member Function Documentation

◆ refine()

def refine (   self,
  harvesting_module,
  crops,
  tdirectory = None,
  groupby_part_name = None,
  groupby_value = None,
args,
**  kwds 
)
Process the change-directory

Reimplemented from Refiner.

Definition at line 1060 of file refiners.py.

1067 **kwds):
1068 """Process the change-directory"""
1069
1070 folder_name = self.folder_name
1071 if folder_name is None:
1072 if groupby_value is not None:
1073 folder_name = "{groupby_addition}"
1074 else:
1075 folder_name = self.default_folder_name
1076
1077 groupby_addition = self.groupby_addition
1078
1079 if groupby_addition is None:
1080 groupby_addition = self.default_groupby_addition
1081
1082 if groupby_part_name is None and groupby_value is None:
1083 groupby_addition = ""
1084 else:
1085 groupby_addition = formatter.format(groupby_addition,
1086 groupby=groupby_part_name,
1087 groupby_value=groupby_value)
1088
1089 folder_name = formatter.format(folder_name,
1090 groupby_addition=groupby_addition,
1091 groupby=groupby_part_name,
1092 groupby_value=groupby_value)
1093
1094 folder_name = '/'.join(root_save_name(name) for name in folder_name.split('/'))
1095
1096 with root_cd(tdirectory):
1097 with root_cd(folder_name) as tdirectory:
1098 self.wrapped_refiner(harvesting_module,
1099 crops,
1100 tdirectory=tdirectory,
1101 groupby_part_name=groupby_part_name,
1102 groupby_value=groupby_value,
1103 *args,
1104 **kwds)
1105
1106

Member Data Documentation

◆ default_folder_name

str default_folder_name = ""
static

Folder name to be used if a groupby selection is active.

Definition at line 1043 of file refiners.py.

◆ default_groupby_addition

str default_groupby_addition = "_groupby_{groupby}_{groupby_value}"
static

Default suffix for a groupby selection.

Definition at line 1045 of file refiners.py.

◆ folder_name

folder_name

cached value of the folder name

Definition at line 1056 of file refiners.py.

◆ groupby_addition

groupby_addition

cached value of the suffix for a groupby selection

Definition at line 1058 of file refiners.py.

◆ wrapped_refiner

wrapped_refiner

cached value of the wrapped refiner

Definition at line 1054 of file refiners.py.


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