diff --git a/output_data/.gitkeep b/output_data/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/results/.gitkeep b/results/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/run_analysis.sh b/run_analysis.sh new file mode 100644 index 0000000..7c4442d --- /dev/null +++ b/run_analysis.sh @@ -0,0 +1,4 @@ +python scripts/excel_to_osemosys.py input_data TEMBA_03_07_Ref.xlsx +python scripts/CBC_results_AS_MODEX.py output_data/output.txt + +glpsol -m model/Temba_0406_modex.txt -d output_data/output.txt --wlp temba.lp --check \ No newline at end of file diff --git a/scripts/excel_to_osemosys.py b/scripts/excel_to_osemosys.py index 18a9ac0..203090e 100644 --- a/scripts/excel_to_osemosys.py +++ b/scripts/excel_to_osemosys.py @@ -44,8 +44,8 @@ def csv_from_excel(filepath, input_workbook): # I create a txt file - string that contains the csv files fileOutput = parseCSVFilesAndConvert(modifiedSheetNames) - if not os.path.exists("output"): # I create the output folder - os.makedirs("output") + if not os.path.exists("output_data"): # I create the output folder + os.makedirs("output_data") with open("output_data/output.txt", "w") as text_file: text_file.write(fileOutput) diff --git a/scripts/transform_31072013.py b/scripts/transform_31072013.py new file mode 100644 index 0000000..4ef0f64 --- /dev/null +++ b/scripts/transform_31072013.py @@ -0,0 +1,106 @@ +import os, sys, time + +######################################################################################### +######################################################################################### + +#if len(sys.argv) != 3: +# print '''Usage: {0} +# +# \n\n\n'''.format(sys.argv[0]) +# sys.exit() + +finput, foutput = sys.argv[1:] + +# Section 1: Reading into memory, and possibly time-inefficient +#OUT = open(foutput,'w') +#with open(finput) as IN: +# lines = [] +# t1 = time.time() +# for line in IN: +# if "