irie 0.0.15__py3-none-any.whl → 0.0.17__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of irie might be problematic. Click here for more details.
- irie/apps/events/views_events.py +4 -6
- irie/apps/inventory/filters.py +37 -5
- irie/apps/inventory/models.py +14 -1
- irie/apps/inventory/sitemaps.py +19 -0
- irie/apps/inventory/views.py +2 -7
- irie/apps/prediction/forms.py +4 -1
- irie/apps/prediction/predictor.py +5 -274
- irie/apps/prediction/runners/__init__.py +17 -15
- irie/apps/prediction/runners/hazus.py +271 -182
- irie/apps/prediction/runners/opensees/__init__.py +88 -11
- irie/apps/prediction/runners/ssid.py +168 -9
- irie/apps/prediction/urls.py +3 -4
- irie/apps/prediction/views.py +8 -85
- irie/apps/sitemaps.py +14 -0
- irie/apps/templates/includes/asset-event-table.html +3 -3
- irie/apps/templates/includes/scripts.html +3 -8
- irie/apps/templates/includes/sidebar.html +1 -1
- irie/apps/templates/inventory/asset-event-summary.html +8 -8
- irie/apps/templates/inventory/asset-profile.html +10 -22
- irie/apps/templates/inventory/asset-table.html +38 -15
- irie/apps/templates/prediction/asset-predictors.html +38 -5
- irie/apps/templates/prediction/hazus/history.html +1 -1
- irie/apps/templates/prediction/new-runner.html +1 -1
- irie/apps/templates/prediction/predictor-profile.html +11 -0
- irie/apps/templates/site/index.html +6 -21
- irie/init/__main__.py +8 -5
- irie/init/data/cgs-stations.json +2967 -0
- irie/init/getCGSData.py +9 -4
- irie/init/management/commands/init_assets.py +1 -1
- irie/init/management/commands/init_cesmd.py +25 -0
- irie/rest/__main__.py +2 -3
- {irie-0.0.15.dist-info → irie-0.0.17.dist-info}/METADATA +1 -1
- {irie-0.0.15.dist-info → irie-0.0.17.dist-info}/RECORD +36 -32
- {irie-0.0.15.dist-info → irie-0.0.17.dist-info}/WHEEL +0 -0
- {irie-0.0.15.dist-info → irie-0.0.17.dist-info}/entry_points.txt +0 -0
- {irie-0.0.15.dist-info → irie-0.0.17.dist-info}/top_level.txt +0 -0
|
@@ -121,7 +121,7 @@
|
|
|
121
121
|
|
|
122
122
|
{% block content %}
|
|
123
123
|
<div class="print">
|
|
124
|
-
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center py-4">
|
|
124
|
+
<div class="col-8 mb-4 d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center py-4">
|
|
125
125
|
<div class="d-block mb-4 mb-md-0">
|
|
126
126
|
<nav aria-label="breadcrumb" class="d-none d-md-inline-block">
|
|
127
127
|
<ol class="breadcrumb breadcrumb-dark breadcrumb-transparent">
|
|
@@ -131,7 +131,7 @@
|
|
|
131
131
|
</a>
|
|
132
132
|
</li>
|
|
133
133
|
<li class="breadcrumb-item"><a href="{% url 'dashboard' %}">BRACE<sup>2</sup></a></li>
|
|
134
|
-
<li class="breadcrumb-item" aria-current="page">Inventory</li>
|
|
134
|
+
<li class="breadcrumb-item" aria-current="page"><a href="{% url 'asset_table' %}">Inventory</a></li>
|
|
135
135
|
<li class="breadcrumb-item active"><code>{{ asset.calid }}</code></li>
|
|
136
136
|
</ol>
|
|
137
137
|
</nav>
|
|
@@ -140,7 +140,7 @@
|
|
|
140
140
|
<div class="btn-toolbar mb-2 mb-md-0">
|
|
141
141
|
<a role="button"
|
|
142
142
|
href="/inventory/{{ asset.calid }}/predictors/"
|
|
143
|
-
class="btn btn-sm btn-
|
|
143
|
+
class="btn btn-sm btn-outline-primary d-inline-flex align-items-center">
|
|
144
144
|
<svg class="icon icon-xs me-2" fill="none"
|
|
145
145
|
stroke="currentColor" viewBox="0 0 24 24"
|
|
146
146
|
xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6v6m0 0v6m0-6h6m-6 0H6"></path></svg>
|
|
@@ -192,7 +192,7 @@
|
|
|
192
192
|
{% endif %}
|
|
193
193
|
{% if asset.cesmd %}
|
|
194
194
|
<div id="sensors" class="row">
|
|
195
|
-
<div class="col-
|
|
195
|
+
<div class="col-8 mb-4">
|
|
196
196
|
<div class="card h-100 bg-white-100 border-0 shadow">
|
|
197
197
|
<div class="card-header d-sm-flex flex-row align-items-center flex-0">
|
|
198
198
|
</div>
|
|
@@ -210,38 +210,26 @@
|
|
|
210
210
|
<details id="event-table" open><summary><h3>Health History</h3></summary>
|
|
211
211
|
|
|
212
212
|
<div class="row">
|
|
213
|
-
<div class="col-
|
|
214
|
-
<div class="card bg-white-100 border-0 shadow table-wrapper table-responsive">
|
|
213
|
+
<div class="col-8 mb-4">
|
|
214
|
+
<!-- <div class="card bg-white-100 border-0 shadow table-wrapper table-responsive"> -->
|
|
215
215
|
{% include 'includes/asset-event-table.html' with evaluations=evaluations %}
|
|
216
|
-
</div>
|
|
216
|
+
<!-- </div> -->
|
|
217
217
|
</div>
|
|
218
218
|
</div>
|
|
219
219
|
|
|
220
220
|
{# Hazus #}
|
|
221
221
|
<div class="row">
|
|
222
|
-
<div class="col-
|
|
222
|
+
<div class="col-8 mb-4">
|
|
223
223
|
<div class="card bg-white-100 border-0 shadow ">
|
|
224
224
|
<div class="card-header">
|
|
225
225
|
<h4>Hazus Fragility</h4>
|
|
226
226
|
</div>
|
|
227
|
-
<div class="card-body">
|
|
227
|
+
<div class="card-body d-flex align-items-center justify-content-center">
|
|
228
228
|
{% include "prediction/hazus/history.html" with hazus=hazus %}
|
|
229
229
|
</div>
|
|
230
230
|
</div>
|
|
231
231
|
</div>
|
|
232
232
|
</div>
|
|
233
|
-
|
|
234
|
-
{% if mountains %}
|
|
235
|
-
<div class="col-10 card bg-white-100 border-0 shadow mt-4">
|
|
236
|
-
<div class="card-body">
|
|
237
|
-
<h4>Spectrum</h4>
|
|
238
|
-
<div class="crop">
|
|
239
|
-
<img src="data:image/jpeg;base64,{{ mountains }}" alt="Fragility Curve">
|
|
240
|
-
</div>
|
|
241
|
-
</div>
|
|
242
|
-
</div>
|
|
243
|
-
{% endif %}
|
|
244
|
-
|
|
245
233
|
</details>
|
|
246
234
|
<hr>
|
|
247
235
|
{% endif %}
|
|
@@ -252,7 +240,7 @@
|
|
|
252
240
|
<details open><summary><h3>Structure Details</h3></summary>
|
|
253
241
|
|
|
254
242
|
<div class="row">
|
|
255
|
-
<div class="col-
|
|
243
|
+
<div class="col-8 mb-4">
|
|
256
244
|
{% for table in tables %}
|
|
257
245
|
<div class="card bg-white-100 border-0 shadow table-wrapper table-responsive">
|
|
258
246
|
<div class="card card-body shadow table-wrapper table-responsive">
|
|
@@ -93,6 +93,44 @@ table a[href^="https://"]::after
|
|
|
93
93
|
placeholder="Search assets"
|
|
94
94
|
>
|
|
95
95
|
</div>
|
|
96
|
+
|
|
97
|
+
<!-- Latest Year -->
|
|
98
|
+
<div class="input-group mb-3">
|
|
99
|
+
<span class="input-group-text">
|
|
100
|
+
<svg class="icon icon-xs" x-description="Heroicon name: solid/search" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
|
|
101
|
+
<path fill-rule="evenodd" d="M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z" clip-rule="evenodd"></path>
|
|
102
|
+
</svg>
|
|
103
|
+
</span>
|
|
104
|
+
<button type="button" class="btn input-group-text btn-outline dropdown-toggle dropdown-toggle-split" data-bs-toggle="dropdown" aria-expanded="false">
|
|
105
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-caret-down-fill" viewBox="0 0 16 16">
|
|
106
|
+
<path d="M7.247 11.14l-4.796-5.481C2.014 5.334 2.482 4.5 3.25 4.5h9.5c.768 0 1.236.835.799 1.159l-4.796 5.481a1 1 0 0 1-1.506 0z"/>
|
|
107
|
+
</svg>
|
|
108
|
+
<span class="visually-hidden">Toggle Dropdown</span>
|
|
109
|
+
</button>
|
|
110
|
+
<ul class="dropdown-menu">
|
|
111
|
+
<li><a class="dropdown-item" href="#">Include fields:</a></li>
|
|
112
|
+
<li><hr class="dropdown-divider"></li>
|
|
113
|
+
<li><div class="form-check form-switch">
|
|
114
|
+
<input class="form-check-input" type="checkbox" role="switch" id="flexSwitchCheckDefault">
|
|
115
|
+
<label class="form-check-label" for="flexSwitchCheckDefault">Retrofit</label>
|
|
116
|
+
</div></li>
|
|
117
|
+
<li><div class="form-check form-switch">
|
|
118
|
+
<input class="form-check-input" type="checkbox" role="switch" id="flexSwitchCheckChecked" checked>
|
|
119
|
+
<label class="form-check-label" for="flexSwitchCheckChecked">Built</label>
|
|
120
|
+
</div></li>
|
|
121
|
+
</ul>
|
|
122
|
+
<input
|
|
123
|
+
id="max_year"
|
|
124
|
+
name="max_year"
|
|
125
|
+
type="number"
|
|
126
|
+
max="2024"
|
|
127
|
+
step="1"
|
|
128
|
+
class="form-control"
|
|
129
|
+
value="{{ filter.form.max_year.value|default_if_none:'2024' }}"
|
|
130
|
+
placeholder="Latest Year Built"
|
|
131
|
+
>
|
|
132
|
+
</div>
|
|
133
|
+
|
|
96
134
|
|
|
97
135
|
<!-- CESMD Not Null Checkbox -->
|
|
98
136
|
<div class="col-12">
|
|
@@ -108,21 +146,6 @@ table a[href^="https://"]::after
|
|
|
108
146
|
</label>
|
|
109
147
|
</div>
|
|
110
148
|
</div>
|
|
111
|
-
|
|
112
|
-
{# Is Complete Checkbox #}
|
|
113
|
-
<div class="col-12">
|
|
114
|
-
<div class="form-check">
|
|
115
|
-
<input
|
|
116
|
-
type="checkbox"
|
|
117
|
-
name="is_complete"
|
|
118
|
-
id="is_complete"
|
|
119
|
-
class="form-check-input"
|
|
120
|
-
{% if filter.form.is_complete.value %}checked{% endif %}>
|
|
121
|
-
<label for="is_complete" class="form-check-label">
|
|
122
|
-
{{ filter.form.is_complete.label }}
|
|
123
|
-
</label>
|
|
124
|
-
</div>
|
|
125
|
-
</div>
|
|
126
149
|
|
|
127
150
|
{# Buttons #}
|
|
128
151
|
<div class="col-12 d-flex justify-content-between">
|
|
@@ -46,9 +46,7 @@ Claudio Perez, Summer 2023
|
|
|
46
46
|
{% for predictor in asset.predictors.values %}
|
|
47
47
|
<div class="accordion-item">
|
|
48
48
|
<button class="btn {%if predictor.active %}btn-outline-success{%else%}btn-outline-dark{%endif%}" type="button">Active</button>
|
|
49
|
-
|
|
50
|
-
<button class="btn btn-outline-danger" type="button">Delete</button>
|
|
51
|
-
{% endif %}
|
|
49
|
+
|
|
52
50
|
<button class="btn" type="button"
|
|
53
51
|
data-bs-toggle="collapse"
|
|
54
52
|
data-bs-target="#flush-collapse{{forloop.counter}}"
|
|
@@ -56,9 +54,11 @@ Claudio Perez, Summer 2023
|
|
|
56
54
|
Details</button>
|
|
57
55
|
|
|
58
56
|
<h6 class="accordion-header" style="display:inline" id="flush-heading{{forloop.counter}}">
|
|
57
|
+
<a href="./{{predictor.id}}" >
|
|
59
58
|
{{predictor.name}}
|
|
59
|
+
</a>
|
|
60
60
|
</h6>
|
|
61
|
-
(<code>{{predictor.platform}}</code>)
|
|
61
|
+
(<code>{{ predictor.platform }}</code>)
|
|
62
62
|
{% if False %}
|
|
63
63
|
<button class="accordion-button btn collapsed" type="button"
|
|
64
64
|
data-bs-toggle="collapse"
|
|
@@ -88,6 +88,8 @@ Claudio Perez, Summer 2023
|
|
|
88
88
|
<script src="https://cdn.jsdelivr.net/npm/@json-editor/json-editor@latest/dist/jsoneditor.min.js"></script>
|
|
89
89
|
<script>
|
|
90
90
|
|
|
91
|
+
const csrftoken = document.querySelector('[name=csrfmiddlewaretoken]').value;
|
|
92
|
+
|
|
91
93
|
for (const element of document.querySelectorAll("form")) {
|
|
92
94
|
let editor_elem = element.querySelector(`#${element.id}-editor`);
|
|
93
95
|
let config = {
|
|
@@ -103,7 +105,38 @@ Claudio Perez, Summer 2023
|
|
|
103
105
|
|
|
104
106
|
editor.on('change', function () {
|
|
105
107
|
element.querySelector('#editor-input').value = JSON.stringify(editor.getValue())
|
|
106
|
-
})
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
element.addEventListener('submit', async function (event) {
|
|
112
|
+
event.preventDefault(); // Prevent the default form submission
|
|
113
|
+
|
|
114
|
+
// Get the form data
|
|
115
|
+
// const formData = new FormData(event.target);
|
|
116
|
+
// const data = Object.fromEntries(formData.entries());
|
|
117
|
+
|
|
118
|
+
// Send the data to the API
|
|
119
|
+
try {
|
|
120
|
+
const response = await fetch(`./create?runner=${editor_elem.dataset.protocol}`, {
|
|
121
|
+
method: 'POST',
|
|
122
|
+
headers: {
|
|
123
|
+
'Content-Type': 'application/json',
|
|
124
|
+
'X-CSRFToken': csrftoken,
|
|
125
|
+
},
|
|
126
|
+
body: JSON.stringify(editor.getValue()),
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
// Handle the response
|
|
130
|
+
if (response.ok) {
|
|
131
|
+
document.getElementById('status').textContent = 'Form submitted successfully!';
|
|
132
|
+
} else {
|
|
133
|
+
document.getElementById('status').textContent = 'Error submitting the form.';
|
|
134
|
+
}
|
|
135
|
+
} catch (error) {
|
|
136
|
+
document.getElementById('status').textContent = 'An error occurred while submitting the form.';
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
|
|
107
140
|
}
|
|
108
141
|
</script>
|
|
109
142
|
{% endblock %}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<div id="hazusPlot" data-hazus-x="{{ hazus.sa_range }}" data-hazus-curves="{{ hazus.curves }}"></div>
|
|
1
|
+
<div id="hazusPlot" class="chart" style="width: 100%;" data-hazus-x="{{ hazus.sa_range }}" data-hazus-curves="{{ hazus.curves }}"></div>
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
{# form.as_p #}
|
|
44
44
|
|
|
45
45
|
<div class="form-group"></div>
|
|
46
|
-
<form id="{{runner.name}}" action="./" method="post" >
|
|
46
|
+
<form id="{{runner.name}}" action="./create/" method="post" >
|
|
47
47
|
{% csrf_token %}
|
|
48
48
|
<input id="editor-input" type="hidden" name="json">
|
|
49
49
|
<div id="{{runner.name}}-editor"
|
|
@@ -132,9 +132,20 @@
|
|
|
132
132
|
<div class="col-12 mb-4">
|
|
133
133
|
</div>
|
|
134
134
|
</div>
|
|
135
|
+
|
|
135
136
|
</details>
|
|
136
137
|
<hr>
|
|
137
138
|
|
|
139
|
+
<div class="col-10 card bg-white-100 border-0 shadow mb-4">
|
|
140
|
+
<div class="card-body">
|
|
141
|
+
<div class="crop">
|
|
142
|
+
<img src="data:image/jpeg;base64,{{ predictor.render }}" alt="Spectral content">
|
|
143
|
+
</div>
|
|
144
|
+
</div>
|
|
145
|
+
<div class="card-footer">
|
|
146
|
+
Powered by <a href="https://chrystalchern.github.io/mdof"><em>mdof</em></a>
|
|
147
|
+
</div>
|
|
148
|
+
</div>
|
|
138
149
|
</div>
|
|
139
150
|
{% endblock content %}
|
|
140
151
|
|
|
@@ -201,37 +201,22 @@ td.left-text{vertical-align:middle}
|
|
|
201
201
|
<div class="row justify-content-between align-items-center">
|
|
202
202
|
<div class="col-lg-5 order-lg-2 mb-5 mb-lg-0">
|
|
203
203
|
<h2 class="h1">Health Diagnosis</h2>
|
|
204
|
-
<p class="mb-4">...</p>
|
|
205
|
-
<a
|
|
206
|
-
href="" target="_blank"
|
|
207
|
-
class="btn btn-outline-gray-600 d-inline-flex align-items-center"><svg class="icon icon-xs me-2"
|
|
208
|
-
fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
|
|
209
|
-
<path
|
|
210
|
-
d="M9 4.804A7.968 7.968 0 005.5 4c-1.255 0-2.443.29-3.5.804v10A7.969 7.969 0 015.5 14c1.669 0 3.218.51 4.5 1.385A7.962 7.962 0 0114.5 14c1.255 0 2.443.29 3.5.804v-10A7.968 7.968 0 0014.5 4c-1.255 0-2.443.29-3.5.804V12a1 1 0 11-2 0V4.804z">
|
|
211
|
-
</path>
|
|
212
|
-
</svg> Getting started</a>
|
|
213
204
|
</div>
|
|
214
205
|
<div class="col-lg-6 order-lg-1"><img src="{{ ASSETS_ROOT }}/img/metric.png"
|
|
215
206
|
alt="Front pages overview"></div>
|
|
216
207
|
</div>
|
|
217
208
|
<div class="col-lg-5 mb-5 mb-lg-0">
|
|
218
|
-
<h2 class="h1 d-flex align-items-center">
|
|
219
|
-
<p class="mb-4"
|
|
220
|
-
|
|
221
|
-
fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
|
|
222
|
-
<path
|
|
223
|
-
d="M5 3a2 2 0 00-2 2v2a2 2 0 002 2h2a2 2 0 002-2V5a2 2 0 00-2-2H5zM5 11a2 2 0 00-2 2v2a2 2 0 002 2h2a2 2 0 002-2v-2a2 2 0 00-2-2H5zM11 5a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2V5zM11 13a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2v-2z">
|
|
224
|
-
</path>
|
|
225
|
-
</svg> Demo
|
|
226
|
-
</a>
|
|
209
|
+
<h2 class="h1 d-flex align-items-center">Real-time notification</h2>
|
|
210
|
+
<p class="mb-4">PEER is partnering with the <em>California Strong Motion Intrumentation Program</em>
|
|
211
|
+
to push sensor data to stakeholders in real-time.</p>
|
|
227
212
|
</div>
|
|
228
213
|
<div class="col-lg-6"><img src="{{ ASSETS_ROOT}}/img/earthquake-hazard.png" alt="Sensor Preview"></div>
|
|
229
214
|
</div>
|
|
230
|
-
<div class="row justify-content-between align-items-center mb-
|
|
215
|
+
<div class="row justify-content-between align-items-center mb-4 mb-lg-7">
|
|
231
216
|
<div class="row justify-content-between align-items-center">
|
|
232
217
|
<div class="col-lg-5 order-lg-2 mb-5 mb-lg-0">
|
|
233
218
|
<h2 class="h1">Digital Twins</h2>
|
|
234
|
-
<p class="mb-4">
|
|
219
|
+
<p class="mb-4">Integrated state of the art modeling software</p>
|
|
235
220
|
<a
|
|
236
221
|
href="" target="_blank"
|
|
237
222
|
class="btn btn-outline-gray-600 d-inline-flex align-items-center"><svg class="icon icon-xs me-2"
|
|
@@ -241,7 +226,7 @@ td.left-text{vertical-align:middle}
|
|
|
241
226
|
</path>
|
|
242
227
|
</svg> Getting started</a>
|
|
243
228
|
</div>
|
|
244
|
-
<div class="col-lg-
|
|
229
|
+
<div class="col-lg-4 order-lg-1 card shadow"><img src="{{ ASSETS_ROOT }}/img/metric.png"
|
|
245
230
|
alt="Digital twins"></div>
|
|
246
231
|
</div>
|
|
247
232
|
{% comment %}
|
irie/init/__main__.py
CHANGED
|
@@ -16,15 +16,18 @@ def init(settings):
|
|
|
16
16
|
"migrate"
|
|
17
17
|
])
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
# call_command("makemigrations")
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
# call_command("migrate")
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
# call_command("init_assets")
|
|
24
24
|
|
|
25
|
-
call_command("
|
|
25
|
+
call_command("init_cesmd")
|
|
26
|
+
|
|
27
|
+
# call_command("init_corridors")
|
|
28
|
+
|
|
29
|
+
# call_command("init_predictors")
|
|
26
30
|
|
|
27
|
-
call_command("init_predictors")
|
|
28
31
|
|
|
29
32
|
|
|
30
33
|
|