rename cc to c
@@ -45,12 +45,12 @@ def _comparison_records(record_as_dict, comparison: Comparison):
output_records = []
waterfall_record = {}
- cc = comparison
- cv_value = record_as_dict[cc._gamma_column_name]
+ c = comparison
+ cv_value = record_as_dict[c._gamma_column_name]
- cl = cc._get_comparison_level_by_comparison_vector_value(cv_value)
+ cl = c._get_comparison_level_by_comparison_vector_value(cv_value)
- waterfall_record["column_name"] = cc._output_column_name
+ waterfall_record["column_name"] = c._output_column_name
waterfall_record["label_for_charts"] = cl._label_for_charts
waterfall_record["sql_condition"] = cl.sql_condition
@@ -60,7 +60,7 @@ def _comparison_records(record_as_dict, comparison: Comparison):
waterfall_record["m_probability"] = cl.m_probability
waterfall_record["u_probability"] = cl.u_probability
waterfall_record["bayes_factor_description"] = cl._bayes_factor_description
- input_cols_used = cc._input_columns_used_by_case_statement
+ input_cols_used = c._input_columns_used_by_case_statement
input_cols_l = [ic.name_l(escape=False) for ic in input_cols_used]
input_cols_r = [ic.name_r(escape=False) for ic in input_cols_used]
waterfall_record["value_l"] = ", ".join(
@@ -74,7 +74,7 @@ def _comparison_records(record_as_dict, comparison: Comparison):
output_records.append(waterfall_record)
# Term frequency record if needed
- if cc._has_tf_adjustments:
+ if c._has_tf_adjustments:
waterfall_record_2 = deepcopy(waterfall_record)
if cl._tf_adjustment_input_column is not None:
@@ -88,7 +88,7 @@ def _comparison_records(record_as_dict, comparison: Comparison):
waterfall_record_2["value_l"] = ""
waterfall_record_2["value_r"] = ""
- waterfall_record_2["column_name"] = "tf_" + cc._output_column_name
+ waterfall_record_2["column_name"] = "tf_" + c._output_column_name
waterfall_record_2["term_frequency_adjustment"] = True
waterfall_record_2["bayes_factor"] = 1.0
waterfall_record_2["log2_bayes_factor"] = math.log2(1.0)
@@ -97,7 +97,7 @@ def _comparison_records(record_as_dict, comparison: Comparison):
f"Term freq adjustment on {cl._tf_adjustment_input_column.input_name} "
"with weight {cl.tf_adjustment_weight}"
)
- bf = record_as_dict[cc._bf_tf_adj_column_name]
+ bf = record_as_dict[c._bf_tf_adj_column_name]
waterfall_record_2["bayes_factor"] = bf
waterfall_record_2["log2_bayes_factor"] = math.log2(bf)
waterfall_record_2["m_probability"] = None
