Skip to content

Commit

Permalink
Merge pull request #23 from tamadalab/ship_1.2.1
Browse files Browse the repository at this point in the history
fix bug for analyzing rates
  • Loading branch information
tamada authored Jun 16, 2021
2 parents 8b78cc4 + e87a994 commit fadcdbc
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
GO := go
VERSION := 1.2.0
VERSION := 1.2.1
NAME := kani
DIST := $(NAME)-$(VERSION)

Expand Down
2 changes: 1 addition & 1 deletion README.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
初学者のためのGit/GitHub操作補助フレームワーク.

[![License](https://img.shields.io/badge/License-CC0--1.0-blue?logo=spdx)](https://creativecommons.org/publicdomain/zero/1.0/)
[![Version](https://img.shields.io/badge/Version-1.2.0-blue.svg)](https://github.com/tamadalab/kani/releases/tag/v1.2.0)
[![Version](https://img.shields.io/badge/Version-1.2.1-blue.svg)](https://github.com/tamadalab/kani/releases/tag/v1.2.1)
[![DOI](https://zenodo.org/badge/285447906.svg)](https://zenodo.org/badge/latestdoi/285447906)

[![tamada/brew/kani](https://img.shields.io/badge/Homebrew-tamadalab%2Fbrew%2Fkani-green?logo=homebrew)](https://github.com/tamadalab/homebrew-brew)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
A tool for supporting git/GitHub operation for the novice developers.

[![License](https://img.shields.io/badge/License-CC0--1.0-blue?logo=spdx)](https://creativecommons.org/publicdomain/zero/1.0/)
[![Version](https://img.shields.io/badge/Version-1.2.0-blue.svg)](https://github.com/tamadalab/kani/releases/tag/v1.2.0)
[![Version](https://img.shields.io/badge/Version-1.2.1-blue.svg)](https://github.com/tamadalab/kani/releases/tag/v1.2.1)
[![DOI](https://zenodo.org/badge/285447906.svg)](https://zenodo.org/badge/latestdoi/285447906)

[![tamada/brew/kani](https://img.shields.io/badge/Homebrew-tamadalab%2Fbrew%2Fkani-green?logo=homebrew)](https://github.com/tamadalab/homebrew-brew)
Expand Down
21 changes: 12 additions & 9 deletions cmd/analyzeCmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,13 +230,13 @@ func printRecommendationFollowingRates(has []*historyAnalyzer, names []string) {
anyOk := false
anyOkDenominator := false
for _, name := range names {
_, ok1 := ha.m[name]
value := ha.m[name].PerformCode
ok2 := ha.a[name]
if ok1 && ok2 {
if value != 0 && ok2 {
counts[name] = counts[name] + 1
anyOk = true
}
if ok1 {
if value != 0 {
denominators[name] = denominators[name] + 1
anyOkDenominator = true
}
Expand All @@ -248,12 +248,12 @@ func printRecommendationFollowingRates(has []*historyAnalyzer, names []string) {
denominator++
}
}
fmt.Printf("recommendation following rates,%f", float64(countAll)/float64(len(has)))
fmt.Printf("recommendation following rates,%d,%f", len(has), float64(countAll)/float64(len(has)))
for _, name := range names {
fmt.Printf(",%f", float64(counts[name])/float64(len(has)))
}
fmt.Println()
fmt.Printf("recommendation following rates (recommended),%f", float64(countAll)/float64(denominator))
fmt.Printf("recommendation following rates (recommended),%d,%f", denominator, float64(countAll)/float64(denominator))
for _, name := range names {
fmt.Printf(",%f", float64(counts[name])/float64(denominators[name]))
}
Expand All @@ -266,8 +266,8 @@ func printRecommendationRates(has []*historyAnalyzer, names []string) {
for _, ha := range has {
anyOk := false
for _, name := range names {
_, ok := ha.m[name]
if ok {
value := ha.m[name].PerformCode
if value != 0 {
counts[name] = counts[name] + 1
anyOk = true
}
Expand All @@ -276,7 +276,11 @@ func printRecommendationRates(has []*historyAnalyzer, names []string) {
countAll++
}
}
fmt.Printf("recommendation rates,%f", float64(countAll)/float64(len(has)))
fmt.Printf("recommendation count,%d,%d", len(has), countAll)
for _, name := range names {
fmt.Printf(",%d", counts[name])
}
fmt.Printf("\nrecommendation rates,%d,%f", len(has), float64(countAll)/float64(len(has)))
for _, name := range names {
fmt.Printf(",%f", float64(counts[name])/float64(len(has)))
}
Expand All @@ -285,7 +289,6 @@ func printRecommendationRates(has []*historyAnalyzer, names []string) {

func analyzeDatabase(cmd *cobra.Command, args []string) error {
path := findDatabasePath(opts)
fmt.Printf("findDatabasePath(): %s\n", path)
histories, analyzers, err := readAllData(path)
if err != nil {
return fmt.Errorf("readAllData(%s) failed: %w", path, err)
Expand Down
2 changes: 1 addition & 1 deletion cmd/rootCmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ var RootCmd = &cobra.Command{
Use: "kani",
Short: "kani",
Long: "",
Version: "1.2.0",
Version: "1.2.1",
Run: func(cmd *cobra.Command, args []string) {
fmt.Println(helpMessage())
},
Expand Down
2 changes: 1 addition & 1 deletion docs/content/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: ":house: Home"
---

[![License](https://img.shields.io/badge/License-CC0--1.0-blue?logo=spdx)](https://creativecommons.org/publicdomain/zero/1.0/)
[![Version](https://img.shields.io/badge/Version-1.2.0-blue.svg)](https://github.com/tamadalab/kani/releases/tag/v1.2.0)
[![Version](https://img.shields.io/badge/Version-1.2.1-blue.svg)](https://github.com/tamadalab/kani/releases/tag/v1.2.1)

[![tamada/brew/wildcat](https://img.shields.io/badge/Homebrew-tamadalab%2Fbrew%2Fkani-green?logo=homebrew)](https://github.com/tamadalab/homebrew-brew)

Expand Down

0 comments on commit fadcdbc

Please sign in to comment.