Skip to content

Commit 377b072

Browse files
authored
Fix none function based on Rayce's review
1 parent 786dbfb commit 377b072

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/github_analysis/main.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,18 +81,18 @@ def main(args):
8181
print("Total Time:\t\t" + str(freqGraphTime - startTime) + "\tseconds")
8282

8383

84-
def none_or_str(value):
84+
def none_or_int(value):
8585
if value == 'None':
8686
return None
87-
return value
87+
return int(value)
8888

8989
if __name__ == '__main__':
9090
parser = argparse.ArgumentParser()
9191
parser.add_argument("-rp", "--results_path", help="The folder to output results of the analysis. e.g. embeddings and plots", default="./results/")
9292
parser.add_argument("-nw", "--n_workers", help="The number of workers to use when running the analysis.", default=8, type=int)
9393
parser.add_argument("-dp", "--data_path", help="The path to the commits.feather file. e.g. /home/user/RStudio-Data-Repository/clean_data/commits_by_org.feather", default="/home/user/RStudio-Data-Repository/clean_data/commits_by_org.feather")
9494
parser.add_argument("-np", "--n_projects", help="The number of projects to sample from the dataset.", default=1000, type=int)
95-
parser.add_argument("-mc", "--min_commits", help="The minimum number of commits for a project to be included in the sample.", default=None, type=none_or_str)
95+
parser.add_argument("-mc", "--min_commits", help="The minimum number of commits for a project to be included in the sample.", default=None, type=none_or_int)
9696
parser.add_argument("-mcount", "--min_count", help="The min_count parameter for the graph2vec model.", default=5, type=int)
9797
parser.add_argument("-nps", "--n_personas", help="The number of personas to extract from each cluster.", default=5, type=int)
9898
parser.add_argument("-nn", "--n_neurons", help="The number of neurons to use for Graph2Vec (project level)", default=128, type=int)
@@ -140,4 +140,4 @@ def none_or_str(value):
140140
# left join `ghtorrent-bq.ght.commit_parents` cp on (cp.commit_id = c.id)
141141
# where (p.id = """ + str(projectId) + """)
142142
# """
143-
#
143+
#

0 commit comments

Comments
 (0)