Skip to content

Commit fb1072a

Browse files
Merge pull request #2 from athenarc/topic-classes-and-fwci
Add prefix for the output file in CC.py
2 parents 4b3e261 + be0e46a commit fb1072a

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

CC.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
# Print output message if not run correctly
3535
###########################################
3636
if len(sys.argv) < 2:
37-
print ("\nUsage: CC.py <input_file> <(optional)num_partitions> <(optional) limit_year>\n")
37+
print ("\nUsage: CC.py <input_file> <(optional)num_partitions> <(optional) prefix> <(optional) limit_year>\n")
3838
sys.exit(0)
3939
###########################################
4040

@@ -48,7 +48,11 @@
4848
except:
4949
num_partitions = 1
5050
try:
51-
limit_year = int(sys.argv[3])
51+
prefix = sys.argv[3] + "_"
52+
except:
53+
prefix = "CC_"
54+
try:
55+
limit_year = int(sys.argv[4])
5256
except:
5357
limit_year = None
5458

@@ -247,7 +251,6 @@
247251

248252
########################################################################################################################################################
249253
## WRITE THE OUTPUT OF CC
250-
prefix = "CC_"
251254
if limit_year:
252255
prefix = str(limit_year) + '-year_' + prefix
253256
# Write output to file

0 commit comments

Comments
 (0)