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 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
@@ -1,6 +1,5 @@
1
1
  from django.apps import AppConfig
2
2
 
3
-
4
3
  class AppsConfig(AppConfig):
5
4
  default_auto_field = "django.db.models.BigAutoField"
6
5
  name = "irie.apps"
irie/apps/events/apps.py CHANGED
@@ -5,8 +5,6 @@
5
5
  #===----------------------------------------------------------------------===#
6
6
  from django.apps import AppConfig
7
7
 
8
-
9
8
  class AppConfig(AppConfig):
10
9
  name = "irie.apps.events"
11
10
  label= "irie_apps_events"
12
-
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
- // 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
- // Close all bridge tabs
175
- initializedTabs.slice(1, initializedTabs.length).forEach(tab => {
176
- if (tab.startsWith('c')) {
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
- // Create a URLSearchParams object from the form data
183
- // and fetch the data for the selected tab
184
- loadContent(tab, new FormData(form));
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 = "BRACE2 Administration"
15
- admin.site.index_title = "BRACE2 Administration"
16
- admin.site.site_title = "BRACE2 Administration"
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),
@@ -116,7 +116,7 @@ def load_assets(NBI_DATA):
116
116
  config = find_bridge(BRIDGES, calid)
117
117
  cesmd = CESMD.get(calid, None)
118
118
  try:
119
- if skip(nbi, ROUTES):
119
+ if skip(nbi, ROUTES) or item == "33 0726L":
120
120
  continue
121
121
  except:
122
122
  print("Failed to skip ", calid)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: irie
3
- Version: 0.0.2
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
- <h2>irie</h2>
56
- <font size="28"><i><b>i</b>nfrastructure <b>r</b>el<b>i</b>ability <b>e</b>ngine</i></font>
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
- ### External Dependencies
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=QP2N1G6FkO36pv1R4cEcmY-Ix9VoViuk3BY4sZDvIYM,796
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=Cwb9-d4rqoPZ7uKHYzTxblo0CS7ee8cP0Aj4CXiZyHw,171
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=bhgXBdYftVhVY85TfVa6unob1aCFeQ-Yd_9Ax9tjES8,355
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=IbMn6ehpwTvXpeJxLQTNYhdYCAQKpr2bU-2h9ZCmJB8,115
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=Dn0d1RwoNQ4e1EIFRpD3PR6_mA2WTSXYIGGk8LwR-rw,6341
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=_61X4Z5TkXq554Fr1qGz9jcXRIaTPXSSCPW-y8D8Qb8,1115
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=24bM-y2541axWamzbiQRMicGzll5V6gPEEblRJt-yx0,6404
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.2.dist-info/METADATA,sha256=u4FZUJf8BJzrwFXPXRGCLTQUS98rOoPMzVYk1GBSYjQ,2420
472
- irie-0.0.2.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
473
- irie-0.0.2.dist-info/entry_points.txt,sha256=A_3h9wPBGfxGQ78_MGa-nO6Z0foxOYeAnIE47jxEztg,44
474
- irie-0.0.2.dist-info/top_level.txt,sha256=zVCxi5E2nkISZPzKq8VEhWe_dGuPcefLYV1tYqQdwlY,5
475
- irie-0.0.2.dist-info/RECORD,,
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