Skip to content

Commit

Permalink
Add more logging and fix some code style issues
Browse files Browse the repository at this point in the history
  • Loading branch information
HardNorth committed Oct 31, 2023
1 parent 3445d3e commit a980fc3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
5 changes: 2 additions & 3 deletions app/boosting_decision_making/boosting_featurizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@

class BoostingFeaturizer:

def __init__(self, all_results, config, feature_ids,
weighted_log_similarity_calculator=None,
def __init__(self, all_results, config, feature_ids, weighted_log_similarity_calculator=None,
features_dict_with_saved_objects=None):
self.config = config
self.previously_gathered_features = {}
Expand All @@ -39,7 +38,7 @@ def __init__(self, all_results, config, feature_ids,
self.similarity_calculator = similarity_calculator.SimilarityCalculator(
self.config,
weighted_similarity_calculator=weighted_log_similarity_calculator)
if type(feature_ids) == str:
if type(feature_ids) is str:
self.feature_ids = text_processing.transform_string_feature_range_into_list(feature_ids)
else:
self.feature_ids = feature_ids
Expand Down
8 changes: 3 additions & 5 deletions app/boosting_decision_making/suggest_boosting_featurizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,9 @@ class SuggestBoostingFeaturizer(boosting_featurizer.BoostingFeaturizer):
def __init__(self, all_results, config, feature_ids,
weighted_log_similarity_calculator=None,
features_dict_with_saved_objects=None):
boosting_featurizer.BoostingFeaturizer.__init__(
self,
all_results, config, feature_ids=feature_ids,
weighted_log_similarity_calculator=weighted_log_similarity_calculator,
features_dict_with_saved_objects=features_dict_with_saved_objects)
super().__init__(all_results, config, feature_ids,
weighted_log_similarity_calculator=weighted_log_similarity_calculator,
features_dict_with_saved_objects=features_dict_with_saved_objects)

def _calculate_percent_issue_types(self):
scores_by_issue_type = self.find_most_relevant_by_type()
Expand Down
1 change: 1 addition & 0 deletions app/service/suggest_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,7 @@ def suggest_items(self, test_item_info):
logger.info(f'Number of logs for suggestions: {len(logs)}')
logger.debug(f'Logs for suggestions: {json.dumps(logs)}')
searched_res = self.query_es_for_suggested_items(test_item_info, logs)
logger.debug(f'Suggested items by FTS (KNN): {json.dumps(searched_res)}')

boosting_config = self.get_config_for_boosting_suggests(test_item_info.analyzerConfig)
boosting_config["chosen_namespaces"] = self.namespace_finder.get_chosen_namespaces(
Expand Down

0 comments on commit a980fc3

Please sign in to comment.