Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto test using github actions #156

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/workflows/TestHelper.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Test Example Cases
on:
push:
tags: '*'
pull_request:
branches:
- main
workflow_dispatch:
jobs:
Test:
if: ${{ !contains(github.event.head_commit.message, '#skip') || !contains(github.event.head_commit.message, 'CompatHelper') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: "recursive"
- uses: julia-actions/[email protected]
- uses: julia-actions/setup-julia@latest
with:
version: '1.8'
- name: Install dependencies
run: julia --project=@. -e 'using Pkg; Pkg.instantiate()'
- name: Test one zone case
run: julia --project=@. Example_Systems/SmallNewEngland/OneZone/Run.jl
- name: Test three zone case
run: julia --project=@. Example_Systems/SmallNewEngland/ThreeZones/Run.jl
- name: Test liquid case
run: julia --project=@. Example_Systems/SmallNewEngland/ThreeZones_Liquid/Run.jl
- name: Test north sea case
run: julia --project=@. Example_Systems/NorthSea_2030/Run.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
OverwriteResults: 1 # Overwrite existing results in output folder or create a new one; 0 = create new folder; 1 = overwrite existing results
PrintModel: 0 # Write the model formulation as an output; 0 = active; 1 = not active
SystemCO2Constraint: 2 # CO2 emissions constraint representation; 1 = Separate emissions constraint for HSC and Power; 2 = Combined emissions constraint for HSC and Power sectors (i.e. allow trading, with constraint form adopted from genx_settings)
Solver: gurobi # Available solvers: Gurobi, CPLEX, CLP, Cbc
Solver: highs # Available solvers: Gurobi, CPLEX, CLP, Cbc
WriteShadowPrices: 1 # Write shadow prices of LP or relaxed MILP; 0 = not active; 1 = active
TimeDomainReductionFolder: "TDR_Results" # Directory name where results from time domain reduction will be saved. If results already exist here, these will be used without running time domain reduction script again.
TimeDomainReduction: 1 # Time domain reduce (i.e. cluster) inputs based on Load_data.csv, Generators_variability.csv, and Fuels_data.csv; 0 = not active (use input data as provided); 1 = active (cluster input data, or use data that has already been clustered)
Expand Down
13 changes: 13 additions & 0 deletions Example_Systems/NorthSea_2030/Settings/highs_settings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# HiGHS Solver Parameters
# Common solver settings
Feasib_Tol: 1.0e-05 # Primal feasibility tolerance # [type: double, advanced: false, range: [1e-10, inf], default: 1e-07]
Optimal_Tol: 1.0e-05 # Dual feasibility tolerance # [type: double, advanced: false, range: [1e-10, inf], default: 1e-07]
TimeLimit: 1.0e23 # Time limit # [type: double, advanced: false, range: [0, inf], default: inf]
Pre_Solve: choose # Presolve option: "off", "choose" or "on" # [type: string, advanced: false, default: "choose"]
Method: ipm #HiGHS-specific solver settings # Solver option: "simplex", "choose" or "ipm" # [type: string, advanced: false, default: "choose"]

#HiGHS-specific solver settings

# Run the crossover routine for IPX
# [type: string, "off", "choose" or "on". Default: "on"]
run_crossover: on
2 changes: 2 additions & 0 deletions Example_Systems/SmallNewEngland/OneZone/Run.jl
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,5 @@ outpath_GenX = write_outputs(EP, outpath, mysetup, myinputs)
if mysetup["ModelH2"] == 1
write_HSC_outputs(EP, outpath_GenX, mysetup, myinputs)
end

compare_results(outpath_GenX, joinpath(case_dir, "Results_Example"))
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
OverwriteResults: 0 # Overwrite existing results in output folder or create a new one; 0 = create new folder; 1 = overwrite existing results
PrintModel: 0 # Write the model formulation as an output; 0 = active; 1 = not active
SystemCO2Constraint: 1 # CO2 emissions constraint representation; 0 = no CO2 constraint; 1 = Separate emissions constraint for HSC and Power; 2 = Combined emissions constraint for HSC and Power sectors (i.e. allow trading, with constraint form adopted from genx_settings)
Solver: gurobi # Available solvers: Gurobi, CPLEX, CLP, Cbc
Solver: highs # Available solvers: Gurobi, CPLEX, CLP, Cbc
WriteShadowPrices: 1 # Write shadow prices of LP or relaxed MILP; 0 = not active; 1 = active
OperationWrapping: 1 # Sets temporal resolution of the model; 0 = single period to represent the full year, with first-last time step linked; 1 = multiple representative periods
TimeDomainReductionFolder: "TDR_Results" # Directory name where results from time domain reduction will be saved. If results already exist here, these will be used without running time domain reduction script again.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,5 @@ Method: ipm #HiGHS-specific solver settings # Solver option: "simple
#HiGHS-specific solver settings

# Run the crossover routine for IPX
# [type: bool, advanced: true, range: {false, true}, default: true]
run_crossover: true


# [type: string, "off", "choose" or "on". Default: "on"]
run_crossover: on
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
OverwriteResults: 0 # Overwrite existing results in output folder or create a new one; 0 = create new folder; 1 = overwrite existing results
PrintModel: 0 # Write the model formulation as an output; 0 = active; 1 = not active
SystemCO2Constraint: 1 # CO2 emissions constraint representation; 1 = Separate emissions constraint for HSC and Power; 2 = Combined emissions constraint for HSC and Power sectors (i.e. allow trading, with constraint form adopted from genx_settings)
Solver: gurobi # Available solvers: Gurobi, CPLEX, CLP, Cbc
Solver: highs # Available solvers: Gurobi, CPLEX, CLP, Cbc
WriteShadowPrices: 1 # Write shadow prices of LP or relaxed MILP; 0 = not active; 1 = active
OperationWrapping: 1 # Sets temporal resolution of the model; 0 = single period to represent the full year, with first-last time step linked; 1 = multiple representative periods
TimeDomainReductionFolder: "TDR_Results" # Directory name where results from time domain reduction will be saved. If results already exist here, these will be used without running time domain reduction script again.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,5 @@ Method: ipm #HiGHS-specific solver settings # Solver option: "simple
#HiGHS-specific solver settings

# Run the crossover routine for IPX
# [type: bool, advanced: true, range: {false, true}, default: true]
run_crossover: true


# [type: string, "off", "choose" or "on". Default: "on"]
run_crossover: on
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
OverwriteResults: 0 # Overwrite existing results in output folder or create a new one; 0 = create new folder; 1 = overwrite existing results
PrintModel: 0 # Write the model formulation as an output; 0 = active; 1 = not active
SystemCO2Constraint: 1 # CO2 emissions constraint representation; 1 = Separate emissions constraint for HSC and Power; 2 = Combined emissions constraint for HSC and Power sectors (i.e. allow trading, with constraint form adopted from genx_settings)
Solver: Gurobi # Available solvers: Gurobi, CPLEX, CLP, Cbc
Solver: highs # Available solvers: Gurobi, CPLEX, CLP, Cbc
WriteShadowPrices: 1 # Write shadow prices of LP or relaxed MILP; 0 = not active; 1 = active
OperationWrapping: 1 # Sets temporal resolution of the model; 0 = single period to represent the full year, with first-last time step linked; 1 = multiple representative periods
TimeDomainReductionFolder: "TDR_Results" # Directory name where results from time domain reduction will be saved. If results already exist here, these will be used without running time domain reduction script again.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,5 @@ Method: ipm #HiGHS-specific solver settings # Solver option: "simple
#HiGHS-specific solver settings

# Run the crossover routine for IPX
# [type: bool, advanced: true, range: {false, true}, default: true]
run_crossover: true


# [type: string, "off", "choose" or "on". Default: "on"]
run_crossover: on
14 changes: 7 additions & 7 deletions src/configure_solver/configure_highs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ The HiGHS optimizer instance is configured with the following default parameters
TimeLimit: Inf # Time limit # [type: double, advanced: false, range: [0, inf], default: inf]
Pre_Solve: choose # Presolve option: "off", "choose" or "on" # [type: string, advanced: false, default: "choose"]
Method: ipm #choose #HiGHS-specific solver settings # Solver option: "simplex", "choose" or "ipm" # [type: string, advanced: false, default: "choose"] In order to run a case when the UCommit is set to 1, i.e. MILP instance, set the Method to choose

# HiGHS-specific solver settings
# Presolve option: "off", "choose" or "on"
# [type: string, advanced: false, default: "choose"]
Expand Down Expand Up @@ -447,7 +447,7 @@ function configure_highs(solver_settings_path::String)
if (haskey(solver_settings, "parallel"))
Myparallel = solver_settings["parallel"]
end
Myrun_crossover = false
Myrun_crossover = "off"
if (haskey(solver_settings, "run_crossover"))
Myrun_crossover = solver_settings["run_crossover"]
end
Expand Down Expand Up @@ -708,10 +708,10 @@ function configure_highs(solver_settings_path::String)
if (haskey(solver_settings, "allowed_cost_scale_factor"))
Myallowed_cost_scale_factor = solver_settings["allowed_cost_scale_factor"]
end
Mysimplex_dualise_strategy = -1
if (haskey(solver_settings, "simplex_dualise_strategy"))
Mysimplex_dualise_strategy = solver_settings["simplex_dualise_strategy"]
end
# Mysimplex_dualise_strategy = -1
# if (haskey(solver_settings, "simplex_dualise_strategy"))
# Mysimplex_dualise_strategy = solver_settings["simplex_dualise_strategy"]
# end
Mysimplex_permute_strategy = -1
if (haskey(solver_settings, "simplex_permute_strategy"))
Mysimplex_permute_strategy = solver_settings["simplex_permute_strategy"]
Expand Down Expand Up @@ -897,7 +897,7 @@ function configure_highs(solver_settings_path::String)
"cost_scale_factor" => Mycost_scale_factor,
"allowed_matrix_scale_factor" => Myallowed_matrix_scale_factor,
"allowed_cost_scale_factor" => Myallowed_cost_scale_factor,
"simplex_dualise_strategy" => Mysimplex_dualise_strategy,
# "simplex_dualise_strategy" => Mysimplex_dualise_strategy,
"simplex_permute_strategy" => Mysimplex_permute_strategy,
"max_dual_simplex_cleanup_level" => Mymax_dual_simplex_cleanup_level,
"max_dual_simplex_phase1_cleanup_level" =>
Expand Down