irie 0.0.2__py3-none-any.whl → 0.0.4__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/__main__.py +1 -8
- irie/apps/config.py +0 -1
- irie/apps/events/apps.py +0 -2
- irie/apps/site/config.py +5 -0
- irie/apps/templates/networks/networks.js +48 -17
- irie/core/urls.py +3 -3
- irie/init/management/commands/init_assets.py +1 -1
- {irie-0.0.2.dist-info → irie-0.0.4.dist-info}/METADATA +15 -12
- {irie-0.0.2.dist-info → irie-0.0.4.dist-info}/RECORD +12 -13
- irie/mgmt.py +0 -20
- {irie-0.0.2.dist-info → irie-0.0.4.dist-info}/WHEEL +0 -0
- {irie-0.0.2.dist-info → irie-0.0.4.dist-info}/entry_points.txt +0 -0
- {irie-0.0.2.dist-info → irie-0.0.4.dist-info}/top_level.txt +0 -0
irie/__main__.py
CHANGED
|
@@ -7,17 +7,10 @@
|
|
|
7
7
|
|
|
8
8
|
import os
|
|
9
9
|
import sys
|
|
10
|
+
from django.core.management import execute_from_command_line
|
|
10
11
|
|
|
11
12
|
def main():
|
|
12
13
|
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'irie.core.settings')
|
|
13
|
-
try:
|
|
14
|
-
from django.core.management import execute_from_command_line
|
|
15
|
-
except ImportError as exc:
|
|
16
|
-
raise ImportError(
|
|
17
|
-
"Couldn't import Django. Are you sure it's installed and "
|
|
18
|
-
"available on your PYTHONPATH environment variable? Did you "
|
|
19
|
-
"forget to activate a virtual environment?"
|
|
20
|
-
) from exc
|
|
21
14
|
execute_from_command_line(sys.argv)
|
|
22
15
|
|
|
23
16
|
if __name__ == '__main__':
|
irie/apps/config.py
CHANGED
irie/apps/events/apps.py
CHANGED
irie/apps/site/config.py
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
#===----------------------------------------------------------------------===#
|
|
2
|
+
#
|
|
3
|
+
# STAIRLab -- STructural Artificial Intelligence Laboratory
|
|
4
|
+
#
|
|
5
|
+
#===----------------------------------------------------------------------===#
|
|
1
6
|
from django.apps import AppConfig
|
|
2
7
|
|
|
3
8
|
|
|
@@ -164,26 +164,57 @@ function handleClickedTab(tabLink) {
|
|
|
164
164
|
}
|
|
165
165
|
|
|
166
166
|
function handleCorridorUpdate(event) {
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
167
|
+
// Prevent the form from submitting in the traditional way
|
|
168
|
+
event.preventDefault();
|
|
169
|
+
|
|
170
|
+
// Get the form element
|
|
171
|
+
const form = event.target;
|
|
172
|
+
const tab = "tab1";
|
|
173
|
+
|
|
174
|
+
// Normalize form fields with "weight" in their name to sum to 1.0
|
|
175
|
+
const formData = new FormData(form);
|
|
176
|
+
const weightFields = [];
|
|
177
|
+
let totalWeight = 0;
|
|
178
|
+
|
|
179
|
+
// Collect "weight" fields and calculate total weight
|
|
180
|
+
formData.forEach((value, key) => {
|
|
181
|
+
if (key.toLowerCase().includes("weight")) {
|
|
182
|
+
// Ensure valid number, default to 0
|
|
183
|
+
const numericValue = parseFloat(value) || 0;
|
|
184
|
+
weightFields.push({ key, value: numericValue });
|
|
185
|
+
totalWeight += numericValue;
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
|
|
189
|
+
// Normalize weights if totalWeight > 0 to avoid division by zero
|
|
190
|
+
if (totalWeight > 0) {
|
|
191
|
+
weightFields.forEach(field => {
|
|
192
|
+
const normalizedValue = field.value / totalWeight;
|
|
193
|
+
formData.set(field.key, normalizedValue);
|
|
194
|
+
|
|
195
|
+
// Update the input field in the form
|
|
196
|
+
const inputElement = form.querySelector(`[name="${field.key}"]`);
|
|
197
|
+
if (inputElement) {
|
|
198
|
+
// Limit decimals for readability
|
|
199
|
+
inputElement.value = normalizedValue.toFixed(4);
|
|
200
|
+
}
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
// Close all bridge tabs except the first one
|
|
205
|
+
initializedTabs.slice(1, initializedTabs.length).forEach(tab => {
|
|
206
|
+
if (tab.startsWith('c')) {
|
|
177
207
|
console.log(tab);
|
|
178
208
|
delCorridorTab(document.getElementById(`${tab}-tab`));
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
209
|
+
}
|
|
210
|
+
});
|
|
211
|
+
|
|
212
|
+
// Create a URLSearchParams object from the form data
|
|
213
|
+
// and fetch the data for the selected tab
|
|
214
|
+
loadContent(tab, formData);
|
|
185
215
|
}
|
|
186
216
|
|
|
217
|
+
|
|
187
218
|
// Event delegation: Listen for clicks on all nav links
|
|
188
219
|
document.addEventListener('DOMContentLoaded', function () {
|
|
189
220
|
initializedTabs.push('tab1');
|
|
@@ -197,4 +228,4 @@ document.addEventListener('DOMContentLoaded', function () {
|
|
|
197
228
|
e.preventDefault(); handleClickedTab(tab);
|
|
198
229
|
});
|
|
199
230
|
});
|
|
200
|
-
});
|
|
231
|
+
});
|
irie/core/urls.py
CHANGED
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
from django.contrib import admin
|
|
12
12
|
from django.urls import path, include
|
|
13
13
|
|
|
14
|
-
admin.site.site_header = "
|
|
15
|
-
admin.site.index_title = "
|
|
16
|
-
admin.site.site_title = "
|
|
14
|
+
admin.site.site_header = "IRiE"
|
|
15
|
+
admin.site.index_title = "IRiE"
|
|
16
|
+
admin.site.site_title = "IRiE"
|
|
17
17
|
|
|
18
18
|
urlpatterns = [
|
|
19
19
|
path('admin/', admin.site.urls),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: irie
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.4
|
|
4
4
|
Summary: Infrastructure Resilience Engine
|
|
5
5
|
Author-email: wd <5018-006+wd@users.noreply.github.com>
|
|
6
6
|
Project-URL: Repository, https://github.com/STAIRLab/irie
|
|
@@ -31,9 +31,15 @@ Requires-Dist: opensees
|
|
|
31
31
|
Requires-Dist: quakeio
|
|
32
32
|
Requires-Dist: bottle
|
|
33
33
|
Requires-Dist: openbim
|
|
34
|
+
Requires-Dist: folium
|
|
35
|
+
Requires-Dist: pandas
|
|
36
|
+
Requires-Dist: numpy
|
|
37
|
+
Requires-Dist: orjson
|
|
38
|
+
Requires-Dist: jsonschema
|
|
39
|
+
Requires-Dist: beautifulsoup4
|
|
40
|
+
Requires-Dist: autopep8
|
|
34
41
|
Requires-Dist: Django==5.1.2
|
|
35
42
|
Requires-Dist: asgiref==3.8.1
|
|
36
|
-
Requires-Dist: autopep8
|
|
37
43
|
Requires-Dist: gunicorn==23.0.0
|
|
38
44
|
Requires-Dist: pytz==2021.3
|
|
39
45
|
Requires-Dist: sqlparse==0.5.1
|
|
@@ -44,24 +50,21 @@ Requires-Dist: django-crispy-forms
|
|
|
44
50
|
Requires-Dist: django-environ==0.11.2
|
|
45
51
|
Requires-Dist: djangorestframework==3.15.2
|
|
46
52
|
Requires-Dist: djangorestframework-simplejwt==5.3.1
|
|
47
|
-
Requires-Dist: folium
|
|
48
|
-
Requires-Dist: pandas
|
|
49
|
-
Requires-Dist: numpy
|
|
50
|
-
Requires-Dist: orjson
|
|
51
|
-
Requires-Dist: jsonschema
|
|
52
53
|
Requires-Dist: dj-database-url==2.1.0
|
|
53
54
|
|
|
54
55
|
<div align="center">
|
|
55
|
-
<
|
|
56
|
-
<
|
|
56
|
+
<h4><code>irie</code></h4>
|
|
57
|
+
<hr>
|
|
58
|
+
<span style="font-size: 150;"><i><b>i</b>nfrastructure <b>r</b>el<b>i</b>ability <b>e</b>ngine</i></span>
|
|
59
|
+
<hr>
|
|
57
60
|
<h4>PEER</h4>
|
|
58
61
|
</div>
|
|
59
62
|
|
|
60
|
-
###
|
|
63
|
+
### Powered By
|
|
61
64
|
|
|
62
|
-
- [`quakeio`](https://pypi.org/project/quakeio)
|
|
63
65
|
- [`opensees`](https://pypi.org/project/opensees)
|
|
66
|
+
- [`quakeio`](https://pypi.org/project/quakeio)
|
|
64
67
|
- [`mdof`](https://pypi.org/project/mdof)
|
|
68
|
+
- [`sees`](https://pypi.org/project/sees)
|
|
65
69
|
- [`sdof`](https://pypi.org/project/sdof)
|
|
66
70
|
|
|
67
|
-
For developer notes, see [`help/README.md`](help/README.md).
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
irie/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
irie/__main__.py,sha256=
|
|
3
|
-
irie/mgmt.py,sha256=KTo_shkPWfBSRjG815PAj5ntmoasAKqJeVDUOvjBY1o,550
|
|
2
|
+
irie/__main__.py,sha256=JTbP1tFc8z2e_wXuurYT9MBe3pLt9UwY_HHnuEZvI2c,501
|
|
4
3
|
irie/apps/__init__.py,sha256=wkkNngGxgYcCM745-rlvP6ynrI0b0QN3aWmLWDsR8zU,230
|
|
5
|
-
irie/apps/config.py,sha256=
|
|
4
|
+
irie/apps/config.py,sha256=63zGFCvptXwnYXb5_Be0njFGgkJQtnWOcYnkeEJN-QU,170
|
|
6
5
|
irie/apps/context_processors.py,sha256=kdMNU9-yK7rd8QWH5KxiKyQufFEmMLfZMRl7G8p7XHk,114
|
|
7
6
|
irie/apps/authentication/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
8
7
|
irie/apps/authentication/admin.py,sha256=2h43pTXd3NKV8-_fkUEkzkS4zqih0qBLE8q6Yj7fpEg,33
|
|
@@ -32,7 +31,7 @@ irie/apps/evaluation/migrations/0001_initial.py,sha256=Bu9By3pDY-Dls_dSUGBQOGlrs
|
|
|
32
31
|
irie/apps/evaluation/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
33
32
|
irie/apps/events/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
34
33
|
irie/apps/events/admin.py,sha256=k0XveXjnXzR5WDAhX6sIbFUXLD9fzO1TLhMqllQET4k,317
|
|
35
|
-
irie/apps/events/apps.py,sha256=
|
|
34
|
+
irie/apps/events/apps.py,sha256=avHJMVjGJlpGSwhTuFSP4jkbFMeXs7wASP2H4Z2nYhE,353
|
|
36
35
|
irie/apps/events/models.py,sha256=F2QrIcWi7x6fqE4i3ZviunKAAHQR3F0EhttSdNHovMo,2351
|
|
37
36
|
irie/apps/events/tests.py,sha256=PSZUTXteVS5Fim2upOndb1HW5Pu7DoC1r25-7_1i-so,33
|
|
38
37
|
irie/apps/events/tests_events.py,sha256=iVNwnlZgqug1MtEIGS_E82wcQ7522m-0q47kreN_D90,8363
|
|
@@ -90,7 +89,7 @@ irie/apps/prediction/templatetags/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeR
|
|
|
90
89
|
irie/apps/prediction/templatetags/predictor.py,sha256=43MXAC-Y-ex_w9_cdvl4UbkrdlZWN_PUg0NVM8C0rHY,793
|
|
91
90
|
irie/apps/site/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
92
91
|
irie/apps/site/admin.py,sha256=2h43pTXd3NKV8-_fkUEkzkS4zqih0qBLE8q6Yj7fpEg,33
|
|
93
|
-
irie/apps/site/config.py,sha256=
|
|
92
|
+
irie/apps/site/config.py,sha256=VFlhAZpacFZWpHHGBKaPvsIEpEydkSL9IaB8OWyEue8,345
|
|
94
93
|
irie/apps/site/models.py,sha256=EIjVfI3vKdeloNjkmLHRB3UTkYh3EhETvuK-Th5_VM8,73
|
|
95
94
|
irie/apps/site/tests.py,sha256=PSZUTXteVS5Fim2upOndb1HW5Pu7DoC1r25-7_1i-so,33
|
|
96
95
|
irie/apps/site/urls.py,sha256=NZP5FlFVS_CeoxU_CLsFMv2zvtAwsY3bbxCx6MX7Xzs,256
|
|
@@ -423,7 +422,7 @@ irie/apps/templates/layouts/base-fullscreen.html,sha256=14X-eubwjujt4jGMJGvbYqaW
|
|
|
423
422
|
irie/apps/templates/layouts/base.html,sha256=1fJ-YCAQMd-Lf83B4Lf1sMPkS6oGAzrmD5_h1xs-SKI,2313
|
|
424
423
|
irie/apps/templates/layouts/json-form.html,sha256=cT6Pd2168Z3p8RODS7SulUC79LnuzSs0EVLVxkGOXAo,1333
|
|
425
424
|
irie/apps/templates/networks/corridor_table.html,sha256=VijOUKq15D3zqru5nq-WZin59YIwb5FvOB1F8-K_MJQ,894
|
|
426
|
-
irie/apps/templates/networks/networks.js,sha256=
|
|
425
|
+
irie/apps/templates/networks/networks.js,sha256=oENJ0SqTJYfbgHmI1w-QcUPbgI182kRienSrxyRPD4o,7440
|
|
427
426
|
irie/apps/templates/networks/styled_inputs.html,sha256=4IqtA4oQw6zAc2oypEYspIn_dS0syvVtZvkshhj1Tco,118
|
|
428
427
|
irie/apps/templates/prediction/asset-predictors.html,sha256=Uu4QdwYe7xvtTG0NSMg9Fu5azajJBCiJTYyWnLBbhkk,3810
|
|
429
428
|
irie/apps/templates/prediction/form-submission.html,sha256=IBAHLK2gr7kMgD-nemx-VVGpT4npEQwdsL5uGYiOhy8,5564
|
|
@@ -451,7 +450,7 @@ irie/apps/templates/site/unused-dashboard-cards.html,sha256=DDNWrnIf4o0wj06WYH8Y
|
|
|
451
450
|
irie/core/__init__.py,sha256=wkkNngGxgYcCM745-rlvP6ynrI0b0QN3aWmLWDsR8zU,230
|
|
452
451
|
irie/core/asgi.py,sha256=3lVQKFRA4bznM2mWu5Cv24a5H9pfb6YU07q-I_TN0DM,395
|
|
453
452
|
irie/core/settings.py,sha256=XQOGRUhIXEF0oIlK9V47UJ9jmIknCKtzcp-Y89RHLhs,6479
|
|
454
|
-
irie/core/urls.py,sha256=
|
|
453
|
+
irie/core/urls.py,sha256=FCZ9jQfUDJ3HfY7iVv_DPlC5kyRxnq0Z8l8DUTgFJPk,1064
|
|
455
454
|
irie/core/wsgi.py,sha256=8dxK789vOoRWm0IatEhNqMgZhov9TlspjM6hOUbjg24,395
|
|
456
455
|
irie/init/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
457
456
|
irie/init/__main__.py,sha256=YGMfr1r3zkx7nl_sjCHDVhamsq0y7SxwcxQj5eodwK4,519
|
|
@@ -465,11 +464,11 @@ irie/init/data/cgs_data.json,sha256=l2lADALMXVLKY6jn-rvEZjYWcZjGHLk22ZudocdR81Q,
|
|
|
465
464
|
irie/init/data/nbi_codes-california.json,sha256=UPFbBzxY2NshREecsP4evCA8vdvXFRvG4rYT4_KHmQs,2398694
|
|
466
465
|
irie/init/data/nbi_data-california.json,sha256=nyslZbMf30WrtdyqCpMvxd-NNxNzFHtZX_TDWRZFob0,8534365
|
|
467
466
|
irie/init/data/networks/soga_corridors.json,sha256=AQOUaKGNWkQxQKLfqphE9Qb_-NRmjN9IwK59SGjutxE,45496
|
|
468
|
-
irie/init/management/commands/init_assets.py,sha256=
|
|
467
|
+
irie/init/management/commands/init_assets.py,sha256=LtptSA90Czy9vh3qfn6QqfLkR6o3Nw30QRQh4Poe8Qk,6426
|
|
469
468
|
irie/init/management/commands/init_corridors.py,sha256=kvcY8V5blEdyUxVGxm3wtBhv9AddPz0wAUJFRufZVxo,1359
|
|
470
469
|
irie/init/management/commands/init_predictors.py,sha256=5JwAb8vJUTCMVtwzolZLjxrN-O-UJxiiZg-ugTtbGoA,1993
|
|
471
|
-
irie-0.0.
|
|
472
|
-
irie-0.0.
|
|
473
|
-
irie-0.0.
|
|
474
|
-
irie-0.0.
|
|
475
|
-
irie-0.0.
|
|
470
|
+
irie-0.0.4.dist-info/METADATA,sha256=Z0E5iXGM8hOa_ezoqZIQVV_vhWPQJugK0wyLOyTgv_s,2457
|
|
471
|
+
irie-0.0.4.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
|
472
|
+
irie-0.0.4.dist-info/entry_points.txt,sha256=A_3h9wPBGfxGQ78_MGa-nO6Z0foxOYeAnIE47jxEztg,44
|
|
473
|
+
irie-0.0.4.dist-info/top_level.txt,sha256=zVCxi5E2nkISZPzKq8VEhWe_dGuPcefLYV1tYqQdwlY,5
|
|
474
|
+
irie-0.0.4.dist-info/RECORD,,
|
irie/mgmt.py
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python
|
|
2
|
-
#===----------------------------------------------------------------------===#
|
|
3
|
-
#
|
|
4
|
-
# STAIRLab -- STructural Artificial Intelligence Laboratory
|
|
5
|
-
#
|
|
6
|
-
#===----------------------------------------------------------------------===#
|
|
7
|
-
|
|
8
|
-
import os
|
|
9
|
-
import sys
|
|
10
|
-
from django.core.management import execute_from_command_line
|
|
11
|
-
|
|
12
|
-
def main():
|
|
13
|
-
# os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'irie.core.settings')
|
|
14
|
-
# print(sys.stdin.read())
|
|
15
|
-
execute_from_command_line(sys.argv)
|
|
16
|
-
# print(sys.argv)
|
|
17
|
-
|
|
18
|
-
if __name__ == '__main__':
|
|
19
|
-
main()
|
|
20
|
-
|
|
File without changes
|
|
File without changes
|
|
File without changes
|