Skip to content

Commit

Permalink
Merge branch 'master' of github.com:dpinney/omf
Browse files Browse the repository at this point in the history
  • Loading branch information
dpinney committed Mar 7, 2024
2 parents a9c4679 + 84cc637 commit bddcbfe
Show file tree
Hide file tree
Showing 36 changed files with 24,612 additions and 477 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ omf/scratch/disaggDataGeneration/regression/workingDir/*
__pycache__/
.vscode/
*.code-workspace
omf/solvers/PowerModelsONM/julia-1.7.0/*
omf/solvers/reopt_jl/testFiles/Scenario_test_POST.json
omf/solvers/reopt_jl/testFiles/resultsResilience.json
omf/solvers/reopt_jl/testFiles/results.json
Expand Down
3 changes: 2 additions & 1 deletion omf/models/microgridDesign.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ def work(modelDir, inputDict):
dieselOMCostKw = float(inputDict['dieselOMCostKw'])
dieselOMCostKwh = float(inputDict['dieselOMCostKwh'])
dieselOnlyRunsDuringOutage = bool(inputDict['dieselOnlyRunsDuringOutage'])
tolerance = float(inputDict['solverTolerance'])
loadShape = np.array(load_df)
criticalLoadShape = np.array(critical_load_df)
numRows = loadShape.shape[0]
Expand Down Expand Up @@ -281,7 +282,7 @@ def work(modelDir, inputDict):
json.dump(scenario, jsonFile)

# Run REopt API script *** => switched to REopt.jl
reopt_jl.run_reopt_jl(modelDir, "Scenario_test_POST.json", outages=run_outages, max_runtime_s = max_runtime )
reopt_jl.run_reopt_jl(modelDir, "Scenario_test_POST.json", outages=run_outages, max_runtime_s = max_runtime, tolerance = tolerance)
with open(pJoin(modelDir, 'results.json')) as jsonFile:
results = json.load(jsonFile)

Expand Down
89 changes: 80 additions & 9 deletions omf/models/resilientCommunity.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,67 @@
<label>Run Time</label>
<input type="text" id="runTime" name="runTime" value="{{allInputDataDict.runTime}}"readonly/>
</div>
<!-- NEW ADDITIONS -->
<div class="shortInput">
<label>Feeder</label>
<button id="feederButton" type="button" onclick="javascript:editFeeder(allInputData.modelName,1);" style="display:block;width:125px;">Open Editor</button>
<input type="text" id="feederName1" name="feederName1" value="{{allInputDataDict.feederName1}}" style="display:none">
</div>

<div class="shortInput">
<label class="tooltip">Equipment of Interest<span class="classic">Select Equipment of Interest </span></label>
<br>
<label>Choose Equipment</label>
<br>
<label>Lines</label>
<select name="equipment" id="equipment">
<option value="yes" {% if allInputDataDict.lines | lower == "yes" %}selected{% endif %} >Yes</option>
<option value="no" {% if allInputDataDict.lines | lower != "yes" %}selected{% endif %}>No</option>
</select>
</div>
<div class="shortInput">
<label>Transformers</label>
<select name="equipment" id="equipment">
<option value="yes" {% if allInputDataDict.transformers | lower == "yes" %}selected{% endif %}>Yes</option>
<option value="no" {% if allInputDataDict.transformers | lower != "yes" %}selected{% endif %}>No</option>
</select>
</div>
<div class="shortInput">
<label> Buses</label>
<select name="equipment" id="equipment">
<option value="yes" {% if allInputDataDict.buses | lower == "yes" %}selected{% endif %}>Yes</option>
<option value="no" {% if allInputDataDict.buses | lower != "yes" %}selected{% endif %}>No</option>
</select>
</div>
<div class="shortInput">
<label>Fuses</label>
<select name="equipment" id="equipment">
<option value="yes" {% if allInputDataDict.fuses | lower == "yes" %}selected{% endif %}>Yes</option>
<option value="no" {% if allInputDataDict.fuses | lower != "yes" %}selected{% endif %}>No</option>
</select>
</div>

<!-- option value="lines" {% if "lines" in allInputDataDict.equipment %}selected{% endif %}>Lines</option>
<option value="transformers" {% if "transformers" in allInputDataDict.equipment %}selected{% endif %}>Transformers</option>
<option value="buses" {% if "buses" in allInputDataDict.equipment %}selected{% endif %}>Buses</option>
<option value="fuses" {% if "fuses" in allInputDataDict.equipment %}selected{% endif %}>Fuses</option---->

<div class="shortInput">
<label class="tooltip">Loads Coloring By<span class="classic">Select the simulation output value that will be used to color the loads in the circuit.</span></label>
<select id="loadCol" name="nodeCol">
<option value="Base Criticality Score" {% if allInputDataDict.loadCol == "Base Criticality Score" %}selected{% endif %}>Base Criticality Score </option>
<option value="Community Criticality Score" {% if allInputDataDict.loadCol == "Community Criticality Score" %}selected{% endif %}>Community Criticality Score</option>
<option value="Base Criticality Index" {% if allInputDataDict.loadCol == "Base Criticality Index" %}selected{% endif %}>Base Criticality Index</option>
<option value="Community Criticality Index" {% if allInputDataDict.loadCol == "Community Criticality Index" %}selected{% endif %}>Community Criticality Index</option>
<option value="None" {% if allInputDataDict.nodeCol == "None" %}selected{% endif %}>No Node Coloring</option>
</select>
</div>

<!-- Model Specific Inputs -->
<div class="wideInput">
<p class="inputSectionHeader">System Parameters</p>
</div>
<hr>

<div class="shortInput">
<label class="tooltip">Circuit Data Input File <span class="classic">Import a omd file to map</span></label>
<div>{{ insert_file_upload_block('inputDataFileName','inputDataFileContent') }}</div>
Expand All @@ -51,25 +107,22 @@
</div>
{{ omfRunDebugBlock }}
{% if modelStatus == 'finished' %}
<style>td, th {padding:7 0 5 20;text-align: left;font-size:0.8em; border: 1px solid #cccccc;} </style>
<!-- Output tables, graphs, etc -->
<p class="reportTitle" style="page-break-before:always">Resilient Community Map</p>
<div id="resilienceMap" class="tightContent"></div>
<script>
var mapContent = allOutputData["resilienceMap"]
var iframe = document.createElement('iframe');
iframe.style = 'width:1000px; height:800px'


document.getElementById('resilienceMap').innerHTML = '<div class="img-div" style="position:relative;right:-390px;bottom:-795px;"><img style="position:relative" src="/Users/davidarmah/Documents/omf/omf/static/testFiles/resilientCommunity/legend.png"></div>';
iframe.style = 'width:1000px; height:800px; border-radius:8px;'
document.getElementById('resilienceMap').innerHTML = '<div class="img-div" style="position:relative;left:0;bottom:-800px;"><img style="position:relative" src="~/omf/omf/static/testFiles/resilientCommunity/legend.png"></div>';
document.getElementById('resilienceMap').appendChild(iframe);
iframe.contentWindow.document.open();
iframe.contentWindow.document.write(mapContent);
//iframe.contentWindow.document.write(img)
iframe.contentWindow.document.close();
</script>
</div>
<p class="reportTitle">Loads Data Table</p>
<div id="traditionalHostingCapacityTable" class="tightContent" style="height:300px; overflow-y: scroll;">
<div id="traditionalLoadsTable" class="tightContent" style="height:300px; overflow-y: scroll;">
<table style="width:100%">
<tr>
{% for header in allOutputDataDict["loadTableHeadings"] %}
Expand All @@ -85,8 +138,26 @@
{% endfor %}
</table>
</div>

<p class="reportTitle">Objects Data Table</p>
<div id="traditionalObjectsTable" class="tightContent" style="height:300px; overflow-y: scroll;">
<table style="width:100%">
<tr>
{% for header in allOutputDataDict["loadTableHeadings2"] %}
<th>{{ header }}</th>
{% endfor %}
</tr>
{% for values in allOutputDataDict["loadTableValues2"] %}
<tr>
{% for val in values %}
<td>{{ val }}</td>
{% endfor %}
</tr>
{% endfor %}
</table>
</div>

{{ rawOutputFiles }}
</div>
{% endif %}
</body>

Loading

0 comments on commit bddcbfe

Please sign in to comment.