Skip to content

Commit c534ab5

Browse files
authored
Merge pull request #172 from abce-dev/cruft_cleanup
Cleanup unused code from deprecated functions/compatibilities
2 parents 98c276e + 454117d commit c534ab5

10 files changed

Lines changed: 57 additions & 889 deletions

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,6 @@ The input files required to run ABCE are as follows:
161161

162162
* `agent_specifications.yml`: definitions for the agents: financial parameters, starting portfolios by unit type, and mandatory retirement dates for owned units
163163

164-
* `C2N_project_definitions.yml`: contains project activity cost and schedule information for coal-to-nuclear projects
165-
166164
* `demand_data.csv`: normalized peak demand levels per simulated year (used to scale the `peak_demand` parameter)
167165

168166
* `unit_specs.yml`: construction and operations cost and parameter data for all possible unit types in the model

inputs/C2N_project_definitions.yml

Lines changed: 0 additions & 155 deletions
This file was deleted.

settings.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ constants:
7171
time_before_start: -1
7272
distant_time: 9999
7373
big_number: 999999
74-
hours_per_year: 8760
7574
MW2kW: 1000 # converts MW to kW
7675

7776
# File paths and filenames
@@ -99,7 +98,6 @@ system:
9998

10099
# Settings for demand projections
101100
demand:
102-
total_forecast_horizon: 10 # Number of periods in the complete forecast horizon
103101
demand_visibility_horizon: 5
104102
demand_projection_mode: exp_termrate # flat, exp_fitted, or exp_termrate
105103
demand_projection_window: 5 # Total number of periods used to project demand
@@ -133,8 +131,6 @@ agent_opt:
133131
profit_lamda: 1.0 # Note: only the ratio between the lamdas matters
134132
credit_rating_lamda: 1.0
135133
fin_metric_horizon: 4
136-
rcdr_target_delta: 0.005
137-
icr_floor: 3.5 # weighted sum limit
138134
fcf_debt_floor: 0.16 # weighted sum limit
139135
re_debt_floor: 0.115 # weighted sum limit
140136
icr_solo_floor: 0.0 # individual

src/ABCEfunctions.jl

Lines changed: 0 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,8 @@ module ABCEfunctions
1919
using ArgParse, CPLEX,
2020
Requires, SQLite, DataFrames, CSV, JuMP, GLPK, Cbc, Logging, Tables, HiGHS, Statistics
2121

22-
# Use CPLEX if available
23-
#function __init__()
24-
# @require CPLEX = "a076750e-1247-5638-91d2-ce28b192dca0" @eval using CPLEX
25-
#end
26-
2722
include("./dispatch.jl")
2823
using .Dispatch
29-
include("./C2N_projects.jl")
30-
using .C2N
3124
include("./income_statement.jl")
3225
using .ISpf
3326

@@ -104,39 +97,6 @@ function set_up_local_paths(settings, abce_abs_path)
10497
end
10598

10699

107-
function validate_project_data(db, settings, unit_specs, C2N_specs)
108-
for unit_type in unit_specs[!, :unit_type]
109-
if occursin("C2N", unit_type)
110-
unit_type_data =
111-
filter(:unit_type => x -> x == unit_type, unit_specs)[1, :]
112-
113-
# Dummy data for schedule retrieval
114-
lag = 0
115-
fc_pd = 70
116-
current_pd = 0
117-
118-
capex_tl, activity_schedule = project_C2N_capex(
119-
db,
120-
settings,
121-
unit_type_data,
122-
lag,
123-
fc_pd,
124-
current_pd,
125-
C2N_specs,
126-
)
127-
128-
unit_specs[
129-
(unit_specs.unit_type .== unit_type),
130-
:construction_duration,
131-
] .= size(capex_tl)[1]
132-
end
133-
end
134-
135-
return unit_specs
136-
137-
end
138-
139-
140100
function set_forecast_period(unit_specs, num_lags)
141101
# Compute forecast period as the maximum possible project horizon, based
142102
# on the sum of maximum lead time, maximum construction duration,
@@ -561,7 +521,6 @@ function set_up_project_alternatives(
561521
agent_params,
562522
db,
563523
current_pd,
564-
C2N_specs,
565524
dispatch_results,
566525
)
567526
PA_summaries = create_PA_summaries(settings, unit_specs, asset_counts)
@@ -579,7 +538,6 @@ function set_up_project_alternatives(
579538
PA,
580539
fc_pd,
581540
current_pd,
582-
C2N_specs,
583541
agent_id,
584542
agent_params,
585543
dispatch_results,
@@ -704,7 +662,6 @@ function create_PA_subprojects(
704662
PA,
705663
fc_pd,
706664
current_pd,
707-
C2N_specs,
708665
agent_id,
709666
agent_params,
710667
dispatch_results,
@@ -727,7 +684,6 @@ function create_PA_subprojects(
727684
subproject,
728685
fc_pd,
729686
current_pd,
730-
C2N_specs,
731687
agent_id,
732688
agent_params,
733689
dispatch_results,
@@ -795,7 +751,6 @@ function forecast_subproject_financials(
795751
subproject,
796752
fc_pd,
797753
current_pd,
798-
C2N_specs,
799754
agent_id,
800755
agent_params,
801756
dispatch_results,
@@ -836,7 +791,6 @@ function forecast_subproject_financials(
836791
unit_type_data,
837792
subproject,
838793
current_pd,
839-
C2N_specs,
840794
deepcopy(subproject_fs),
841795
)
842796

@@ -896,7 +850,6 @@ function forecast_capex(
896850
unit_type_data,
897851
subproject,
898852
current_pd,
899-
C2N_specs,
900853
fs_copy,
901854
)
902855
capex_per_pd = (
@@ -918,64 +871,6 @@ function forecast_capex(
918871
end
919872

920873

921-
function project_C2N_capex(
922-
db,
923-
settings,
924-
unit_type_data,
925-
lag,
926-
fc_pd,
927-
current_pd,
928-
C2N_specs,
929-
)
930-
assumption = settings["simulation"]["C2N_assumption"]
931-
# Set the project parameters
932-
if occursin("C2N0", unit_type_data[:unit_type])
933-
conversion_type = "greenfield"
934-
if occursin("PWR", unit_type_data[:unit_type])
935-
rxtr_type = "PWR"
936-
elseif occursin("HTGR", unit_type_data[:unit_type])
937-
rxtr_type = "HTGR"
938-
else
939-
rxtr_type = "SFR"
940-
end
941-
942-
data = deepcopy(C2N_specs[conversion_type][rxtr_type])
943-
944-
else
945-
if occursin("C2N1", unit_type_data[:unit_type])
946-
conversion_type = "electrical"
947-
rxtr_type = "PWR"
948-
elseif occursin("C2N2", unit_type_data[:unit_type])
949-
conversion_type = "steam_noTES"
950-
rxtr_type = "HTGR"
951-
else
952-
conversion_type = "steam_TES"
953-
rxtr_type = "SFR"
954-
end
955-
data = deepcopy(C2N_specs[conversion_type][assumption])
956-
end
957-
958-
# Scale cost component data to match unit type specification data
959-
for key in keys(data)
960-
data[key]["cost_rem"] = data[key]["cost_rem"] * unit_type_data[:overnight_capital_cost]
961-
end
962-
963-
# Develop the C2N capex profile
964-
capex_tl, activity_schedule = C2N.create_C2N_capex_timeline(
965-
db,
966-
conversion_type,
967-
rxtr_type,
968-
current_pd,
969-
lag,
970-
fc_pd,
971-
data,
972-
unit_type_data,
973-
)
974-
975-
return capex_tl, activity_schedule
976-
end
977-
978-
979874
function get_capex_end(fs_copy)
980875
# Find the end of the capex accumulation period
981876
capex_end = size(fs_copy)[1]
@@ -2764,11 +2659,8 @@ end
27642659
function compute_credit_indicator_scores(settings, agent_fs)
27652660
# Credit ratings indicators
27662661
# Compute retained earnings-to-debt metric column
2767-
rcdr_target = settings["agent_opt"]["re_debt_floor"] + settings["agent_opt"]["rcdr_target_delta"]
27682662
transform!(agent_fs, [:remaining_debt_principal, :retained_earnings] => ((debt, re) -> re ./ debt) => :RE_debt_ratio)
27692663

2770-
# Use excess RE over the amount needed to reach the target ratio to subsidize FCF
2771-
27722664
# Compute effective FCF: if FCF is zero but RE is greater than zero, use RE in place of FCF
27732665

27742666
# Compute ICR metric column

0 commit comments

Comments
 (0)