On Wed, Nov 04, 2020 at 09:49:51AM +0800, Zhang Yuhang wrote:
On Wed, Nov 04, 2020 at 09:36:02AM +0800, Lu Weitao wrote:
+def get_metric_values(dimensions)
- metrics_values = {}
- dimensions.each do |dim, matrix|
- matrix.each do |metric, values|
metrics_values[metric] ||= {}
metrics_values[metric]['average'] ||= {}
metrics_values[metric]['standard_deviation'] ||= {}
metric_value = get_values(values, true)
metrics_values[metric]['average'][dim] = metric_value[:average]
metrics_values[metric]['standard_deviation'][dim] = metric_value[:stddev]
- end
- end
- get_metric_change(metrics_values)
set_metric_change(metrics_values), maybe better. :)
这里会触发rubo warning 还是只能用get了
Thanks, Weitao
Could give the warning info?
yes,
lib/compare_matrixes.rb:459:5: C: Naming/AccessorMethodName: Do not prefix writer method names with set_. def set_metric_change(metrics_values) ^^^^^^^^^^^^^^^^^
Thanks, Weitao
OK, Thanks. Try "assign_metric_change" as function name. "get_xxx" mean this function will return "xxx" value.
yes,
Thanks Weitao
Thanks, Zhang Yuhang
Thanks, Zhang Yuhang