def _filter_graph_data(self,
                        scene,
                        population,
                        sequence_params,
                        operator=Default.filter_operator):
     """
     This method filters match product in scene DataFrame for the graph's creation.
     """
     filtered_matches = self._matches.loc[self._matches.scene_fk == scene]
     if not sequence_params[AdditionalAttr.INCLUDE_STACKING]:
         filtered_matches = CalculationUtils.adjust_stacking(
             filtered_matches)
     filters, excludes = [population
                          ], sequence_params[AdditionalAttr.EXCLUDE_FILTER]
     if sequence_params[
             AdditionalAttr.ALLOWED_PRODUCTS_FILTERS] is not None:
         filters.append(
             sequence_params[AdditionalAttr.ALLOWED_PRODUCTS_FILTERS])
     conditions = {
         self.input_parser.POPULATION: {
             self.input_parser.INCLUDE: filters,
             self.input_parser.EXCLUDE: excludes,
             'include_operator': operator
         }
     }
     filtered_df = self.input_parser.filter_df(conditions, filtered_matches)
     return filtered_df
Пример #2
0
 def _get_no_stack_data(self, matches_df):
     return CalculationUtils.adjust_stacking(matches_df)