Skip to content

Commit 0d92178

Browse files
committed
Handle if None is passed from commandline from main
1 parent afe83f3 commit 0d92178

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/github_analysis/main.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,19 @@ def main(args):
8080
print("Frequency Graph Time:\t" + str(freqGraphTime - motifTime) + "\tseconds")
8181
print("Total Time:\t\t" + str(freqGraphTime - startTime) + "\tseconds")
8282

83+
84+
def none_or_str(value):
85+
if value == 'None':
86+
return None
87+
return value
88+
8389
if __name__ == '__main__':
8490
parser = argparse.ArgumentParser()
8591
parser.add_argument("-rp", "--results_path", help="The folder to output results of the analysis. e.g. embeddings and plots", default="./results/")
8692
parser.add_argument("-nw", "--n_workers", help="The number of workers to use when running the analysis.", default=8, type=int)
8793
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="./results/")
8894
parser.add_argument("-np", "--n_projects", help="The number of projects to sample from the dataset.", default=1000, type=int)
89-
parser.add_argument("-mc", "--min_commits", help="The minimum number of commits for a project to be included in the sample.", default=None, 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)
9096
parser.add_argument("-mcount", "--min_count", help="The min_count parameter for the graph2vec model.", default=5, type=int)
9197
parser.add_argument("-nps", "--n_personas", help="The number of personas to extract from each cluster.", default=5, type=int)
9298
parser.add_argument("-nn", "--n_neurons", help="The number of neurons to use for Graph2Vec (project level)", default=128, type=int)

0 commit comments

Comments
 (0)