-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
89 lines (63 loc) · 2.39 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# Assessment of power development plans for Vietnam
# The model is a recursive simulation based on OSEMOSYS equations
#
# (c) Minh Ha-Duong, An Ha Truong 2016, 2017, 2018
# Creative Commons Attribution-ShareAlike 4.0 International
#
PYTHON = python3
COVERAGE = python3-coverage
PYTEST = py.test-3
# Tables and figures for the paper on CCS
tables-CCS = table-parameters.fwf table-comparison.fwf run_sensitivity_analysis_ccs.txt
figures-CCS = plan_baseline.pdf plan_with_ccs.pdf figure_capacities.pdf figure_capacities.png
# Tables and figures for the paper on sensitivity analysis to international prices of coal and gas
tables-moreGas = price_fuel.txt prices_data_international.txt run_sensitivity_lcoe.txt run_baseline_vs_more_gas.txt
figures-moreGas = plan_more_gas.pdf figure_prices.pdf price_fuel.pdf run_sensitivity_lcoe.pdf
all-parallel:
make all -j
all: all-CCS all-moreGas
all-CCS: $(tables-CCS) $(figures-CCS)
all-moreGas: $(tables-moreGas) $(figures-moreGas)
table-parameters.fwf: parameter_reference.txt
head -13 $< | tail -11 > $@
table-comparison.fwf: run_baseline_vs_ccs.txt
head -26 $< | tail -16 > $@
%.txt: %.py
@-sed -i "s/VERBOSE = True/VERBOSE = False/" init.py
$(PYTHON) $< summarize > $@
%.pdf: %.py
$(PYTHON) $< plot $@
%.png: %.py
$(PYTHON) $< plot $@
test: cleaner
$(PYTEST) --doctest-modules
coverage: coverage.xml
$(COVERAGE) html
see htmlcov/index.html
coverage.xml:
$(PYTEST) --doctest-modules --cov=. --cov-report term-missing --cov-report xml
regtest-reset:
$(PYTEST) --regtest-reset
lint:
pylint3 *py
docstyle:
# Ignored messages:
# D102: Missing docstring in public method too many positives
# D105: Missing docstring in magic method why does it need a docstring ?
# D203: 1 blank line required before class docstring bug in the tool
# D213: Multi-line docstring summary should start at the second line """We choose D212 ;)
pydocstyle --ignore=D102,D105,D203,D213 *py
codestyle:
pycodestyle *py
.PHONY: test regtest-reset lint docstyle codestyle clean cleaner
clean:
rm -f $(tables-CCS) $(tables-moreGas)
rm -f $(figures-CCS) $(figures-moreGas)
rm -f run_baseline_vs_ccs.txt parameter_reference.txt
cleaner: clean
find . -type f -name '*.pyc' -delete
rm -f table-price-run.txt tmp.ps
rm -rf __pycache__
rm -f *.bak
rm -rf .coverage coverage.xml htmlcov