Skip to content

Commit

Permalink
Apply pre-commmit fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
cameronrutherford authored and actions-user committed Nov 20, 2023
1 parent 54f51bf commit ce76804
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
10 changes: 5 additions & 5 deletions src/ps/psreaddata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1048,11 +1048,11 @@ PetscErrorCode PSReadGICData(PS ps) {
sscanf(line, "%d %d", &bus_num, &subst_num);
// This is really ugly and slow, need to fix this idx business
int idx = -1;
for(int i=0; i < ps->nsubstations; i++) {
if(subst_num == ps->substations[i].num) {
idx = i;
break;
}
for (int i = 0; i < ps->nsubstations; i++) {
if (subst_num == ps->substations[i].num) {
idx = i;
break;
}
}
subst = &ps->substations[idx];
bus = &ps->bus[ps->busext2intmap[bus_num]];
Expand Down
6 changes: 3 additions & 3 deletions tutorials/scopflow-example.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
# Create security-constrained ACOPF (SCOPF) object
scopf = exago.SCOPFLOW()

netfile='/Users/abhy245/software/ExaGO/datafiles/case9/case9mod.m'
ctgcfile='/Users/abhy245/software/ExaGO/datafiles/case9/case9.cont'
netfile = '/Users/abhy245/software/ExaGO/datafiles/case9/case9mod.m'
ctgcfile = '/Users/abhy245/software/ExaGO/datafiles/case9/case9.cont'

# Set network data
scopf.set_network_data(netfile)

# Set contingency data file and input format
scopf.set_contingency_data(ctgcfile,exago.ContingencyFileInputFormat.NATIVE)
scopf.set_contingency_data(ctgcfile, exago.ContingencyFileInputFormat.NATIVE)

# Set number of contingencies, we select all (-1)
scopf.set_num_contingencies(-1)
Expand Down
14 changes: 7 additions & 7 deletions tutorials/sopflow-example.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
rank = comm.Get_rank()

# Input files
netfile='/Users/abhy245/software/ExaGO/datafiles/case9/case9mod.m'
ctgcfile='/Users/abhy245/software/ExaGO/datafiles/case9/case9.cont'
scenfile='/Users/abhy245/software/ExaGO/datafiles/case9/10_scenarios_9bus.csv'
netfile = '/Users/abhy245/software/ExaGO/datafiles/case9/case9mod.m'
ctgcfile = '/Users/abhy245/software/ExaGO/datafiles/case9/case9.cont'
scenfile = '/Users/abhy245/software/ExaGO/datafiles/case9/10_scenarios_9bus.csv'

# Initialize ExaGO
exago.initialize("app", comm)
Expand All @@ -21,11 +21,11 @@
sopf.set_network_data(netfile)

# Set contingency data file and input format
sopf.set_contingency_data(ctgcfile,exago.ContingencyFileInputFormat.NATIVE)
sopf.set_contingency_data(ctgcfile, exago.ContingencyFileInputFormat.NATIVE)

# Set scenario data
sopf.set_scenario_data(scenfile,exago.ScenarioFileInputFormat.NATIVE_SINGLEPERIOD,
exago.ScenarioUncertaintyType.WIND)
sopf.set_scenario_data(scenfile, exago.ScenarioFileInputFormat.NATIVE_SINGLEPERIOD,
exago.ScenarioUncertaintyType.WIND)

# Set number of scenarios, we select all (-1)
sopf.set_num_scenarios(-1)
Expand All @@ -52,4 +52,4 @@
del sopf

# Close ExaGO
exago.finalize()
exago.finalize()

0 comments on commit ce76804

Please sign in to comment.