irie 0.0.16__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/init/getCGSData.py CHANGED
@@ -15,11 +15,15 @@ Example:
15
15
  $ pandoc ../el-centro/documentation/summary-table.md 2>/dev/null | python html2json.py
16
16
  """
17
17
  import sys
18
+ import json
18
19
  import requests
19
20
  from bs4 import BeautifulSoup # install package 'beautifulsoup4'
20
21
 
21
22
  # from elstir.contrib.pandoc import Pandoc
22
23
 
24
+ def cesmd_bridges():
25
+ url = "https://www.strongmotioncenter.org/wserv/stations/query?sttype=Br&format=json&nodata=404"
26
+ return requests.get(url).text
23
27
 
24
28
  def pull_csmip(csmip_id:str)->str:
25
29
  return requests.get(
@@ -90,12 +94,13 @@ def table2dict(html_table, output=None)->dict:
90
94
 
91
95
  if __name__=="__main__":
92
96
  import sys
93
- import json
94
- # from init.bridges import BRIDGES
95
- exec(open("init/bridges.py").read())
97
+
98
+ if len(sys.argv) == 1:
99
+ print(cesmd_bridges())
100
+
96
101
 
97
102
  dat = {}
98
- for cesmd in BRIDGES:
103
+ for cesmd in sys.argv[1:]:
99
104
  html = pull_csmip(cesmd)
100
105
  dat.update({cesmd: table2dict(BeautifulSoup(html, "html.parser"))})
101
106
 
@@ -161,7 +161,7 @@ def load_assets(NBI_DATA):
161
161
 
162
162
 
163
163
  class Command(BaseCommand):
164
- help = 'Description of what script_1 does'
164
+ help = "Populate the database with assets using NBI data"
165
165
 
166
166
  def handle(self, *args, **kwargs):
167
167
 
@@ -0,0 +1,25 @@
1
+ import irie
2
+ import numpy as np
3
+ from irie.apps.inventory.models import Asset
4
+ from pathlib import Path
5
+ from django.core.management.base import BaseCommand
6
+ import json
7
+
8
+ DATA = Path(irie.__file__).parents[0]/"init"/"data"
9
+
10
+ class Command(BaseCommand):
11
+ def handle(self, *args, **kwargs):
12
+ with open(DATA/"cgs-stations.json") as f:
13
+ stations = json.load(f)
14
+
15
+ for station in stations["features"]:
16
+ loc = station["geometry"]["coordinates"]
17
+ loc = [loc[1], loc[0]]
18
+ for asset in Asset.objects.all():
19
+ if np.allclose(loc, list(asset.coordinates), rtol=1e-8, atol=1e-03):
20
+ props = station["properties"]
21
+ cesmd = f"{props['network']}{props['code']}"
22
+
23
+ print(asset, cesmd)
24
+ continue
25
+
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: irie
3
- Version: 0.0.16
3
+ Version: 0.0.17
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
@@ -3,6 +3,7 @@ irie/__main__.py,sha256=JTbP1tFc8z2e_wXuurYT9MBe3pLt9UwY_HHnuEZvI2c,501
3
3
  irie/apps/__init__.py,sha256=wkkNngGxgYcCM745-rlvP6ynrI0b0QN3aWmLWDsR8zU,230
4
4
  irie/apps/config.py,sha256=jSCQprndMFQQIzgUWTe2Sa6MpU8iVqUoOy3cPkYOFP0,169
5
5
  irie/apps/context_processors.py,sha256=kdMNU9-yK7rd8QWH5KxiKyQufFEmMLfZMRl7G8p7XHk,114
6
+ irie/apps/sitemaps.py,sha256=dkSrQqjGr2Wv6BlNTKUA2V3hAIcIScXCgZ044LT1ccc,342
6
7
  irie/apps/authentication/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
7
8
  irie/apps/authentication/admin.py,sha256=2h43pTXd3NKV8-_fkUEkzkS4zqih0qBLE8q6Yj7fpEg,33
8
9
  irie/apps/authentication/config.py,sha256=kZPDGP1IwuN5r3uziuBcOw_HBO7dnBgMEpN-Z0yewpM,112
@@ -37,7 +38,7 @@ irie/apps/events/tests.py,sha256=PSZUTXteVS5Fim2upOndb1HW5Pu7DoC1r25-7_1i-so,33
37
38
  irie/apps/events/tests_events.py,sha256=iVNwnlZgqug1MtEIGS_E82wcQ7522m-0q47kreN_D90,8363
38
39
  irie/apps/events/urls.py,sha256=UrVmK0NpKvmDNH9Iad4CTbN9KdXaW4W3ZNWxPpiSgUY,1052
39
40
  irie/apps/events/views.py,sha256=lr3BFL_yEkppjuVigGucCwL0we0SrAqsNSyu0RBbCcU,3034
40
- irie/apps/events/views_events.py,sha256=oFqSWrPfmefNuZhcgctuNXPHpbwDq7brcYsiY_RCuQI,7263
41
+ irie/apps/events/views_events.py,sha256=ahQQy5z1T0NH69ybLmPWahboYmAsAmiaCI8g27Md_5A,7229
41
42
  irie/apps/events/migrations/0001_initial.py,sha256=sSCS0Kbyb73m_x3kw5Q4tRrTJcCqh3gRTLmkrcf6_ps,1065
42
43
  irie/apps/events/migrations/0002_rename_event_eventrecord.py,sha256=TNRUB9-EZmdURlkyAtz7KBdtuoSXwbwCQDRP4CKmdBw,431
43
44
  irie/apps/events/migrations/0003_hazardevent.py,sha256=TEaMSJz16BpDXeMXo4jwD6LAL88MvNT_uuOOmvLu1hA,608
@@ -48,13 +49,14 @@ irie/apps/inventory/admin.py,sha256=bwSoY9qzF8VYbVilaKqz8w90QGpDifNo55BVC4JQm8Q,
48
49
  irie/apps/inventory/apps.py,sha256=bZ6qYIwPMG4_4IeLfg9N4WuZAEgEVj84oOswV-7_MAI,424
49
50
  irie/apps/inventory/calid.py,sha256=3L8MbPIGOE3kzDnqeyY055pRBiF2O2l0cmpuDbTsdTg,3014
50
51
  irie/apps/inventory/fields.py,sha256=J3nTImPsuCeiOWBizSL4tnuKs36sPfXALNTKEZY-wVg,79
51
- irie/apps/inventory/filters.py,sha256=9P4KoDe4mhbjWish8NE7q19C53AgKm6rKo19GK-O1Hk,1092
52
+ irie/apps/inventory/filters.py,sha256=U7fYRyf-FicpwZ6L-U8IlRuRpCyKNFMAi0k5zAw7AGw,2184
52
53
  irie/apps/inventory/forms.py,sha256=8KaegZRIJlCEpHbdNLWEETfa4x3oGYSE_YTfwUEgyYs,400
53
- irie/apps/inventory/models.py,sha256=Fb9nTtGIHCC-SaLqBB26KYk1t-8fTFEyucDgFYA1KRg,3059
54
+ irie/apps/inventory/models.py,sha256=tDu25wiJ2Xj2fZ-m7r5ueK8xoRuLZI0AUgFw967uoLs,3480
55
+ irie/apps/inventory/sitemaps.py,sha256=yc3UMVuGWA8vC9zHseY1jfkeRw5_jTYjy-UUcGtGwpU,597
54
56
  irie/apps/inventory/tables.py,sha256=vZdPOcbN1ibuWXqLwbBUoQw9iavwa1GJ5fd83k8bu7Y,27874
55
57
  irie/apps/inventory/traffic.py,sha256=B3PHqn2Pm4AEdUZ_tuA16fuFruo2rm5waMBwLQyF-9g,4490337
56
58
  irie/apps/inventory/urls.py,sha256=mpmHjvDSHhC5xrEosbTH_h2bGWNJfslGcrt2mnUO40E,1019
57
- irie/apps/inventory/views.py,sha256=6eOmGo8_4smceZfwr36TJfOcBsMS58FFht1konleZKI,14528
59
+ irie/apps/inventory/views.py,sha256=QA0zw7uRYdChF3bW6GZzjiUmtO_u8T45onFz-w5m_1U,14439
58
60
  irie/apps/inventory/archive/arcGIS.py,sha256=vcfsy1be4edOXD1Z3rkUnq9QmCTol7dypdF816Q3B_w,34893
59
61
  irie/apps/inventory/migrations/0001_initial.py,sha256=PwTHv4Q3gqWFha--8Zp9kUOh-cYalB14jXj7RVJUVnw,1786
60
62
  irie/apps/inventory/migrations/0002_alter_asset_bridge_sensors_and_more.py,sha256=rPzWHkjg-ZCorVA_gv6MVb5F6LTLHcwlPwhBR1PxVr0,842
@@ -73,20 +75,20 @@ irie/apps/networks/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5N
73
75
  irie/apps/prediction/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
74
76
  irie/apps/prediction/admin.py,sha256=WEPTXvwBFzh8m62Y_xusBfzqn0DXAT_wvqhCNefBano,335
75
77
  irie/apps/prediction/apps.py,sha256=NJ32eKlTL0dmZggBXSBM_9m0JafMYPBRHhHG0YSmjMk,423
76
- irie/apps/prediction/forms.py,sha256=hsCDWUmapeVuvczWjAmmhCOpLYuuYKWXg5UK6eQanOs,584
78
+ irie/apps/prediction/forms.py,sha256=qzWepBLV9cFHiXSSqeltwaV6amTU6sD3A97zkLZYhtc,644
77
79
  irie/apps/prediction/metrics.py,sha256=Zh1utUZTGddQEVn4e1rLO74tbIz7bVvZli8sgmuB_X0,1410
78
80
  irie/apps/prediction/models.py,sha256=eapabvXuntbVxYtpBcZ74S2dHTspqJTQAtA-f5DgR_I,1444
79
- irie/apps/prediction/predictor.py,sha256=lRrl3mLOSimCpB4ctAFXQ1KJY_-qSiqlocZAmGXn3Nc,8970
80
- irie/apps/prediction/urls.py,sha256=IlMx4UEbX-A6I011wjQGfqiFZMRuR-Wq-IjszV1tCP0,892
81
- irie/apps/prediction/views.py,sha256=SPUUsLBLfMGuc3SOMJZT2m0ja6XCqTQJWENdOZazlOg,6622
81
+ irie/apps/prediction/predictor.py,sha256=ih22LqQ5ofJacACDtNpeR7UdLT8Hka7V1TiEk5sFj7E,833
82
+ irie/apps/prediction/urls.py,sha256=59im21mNf-tr6gUMBPiyVdVRNVe9x6JHdcpvjogjuD4,847
83
+ irie/apps/prediction/views.py,sha256=Iy2S4bi2U_IpHwY7C3-VFWgiwYztNxS5yDvh7Zr65dk,4046
82
84
  irie/apps/prediction/views_api.py,sha256=_1FrfiqRlM52G3wRuI6myD7Z1mAP2pbyhZFBo23-c-U,7123
83
85
  irie/apps/prediction/migrations/0001_initial.py,sha256=-0GWd2vUUAzSPfptccAJ3raI3UD4Xj9H0E5EJ7xN0Ek,1428
84
86
  irie/apps/prediction/migrations/0002_alter_predictormodel_protocol.py,sha256=nrQvuZ1eRR7fR17IjdS0Xyw14y9DpE6HkG2-h7HQ_zA,560
85
87
  irie/apps/prediction/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
86
- irie/apps/prediction/runners/__init__.py,sha256=RwaZaILIRQvu-HI5Q5IJv3959wJUrBfU1aYyE6DK3oI,1737
87
- irie/apps/prediction/runners/hazus.py,sha256=qZwut3CTlmMd9M51qW6rFX3hHqVFo6-kKZZZx54ae-I,28679
88
- irie/apps/prediction/runners/ssid.py,sha256=9gZaD0e_7lHp6VfKQB0ISJdz7uVetPyrMXdh0z7WoTQ,13777
89
- irie/apps/prediction/runners/opensees/__init__.py,sha256=mGMOPdzPZPQa1vfERsfEoGlXMDWjjIrP2acbZHgY7iM,18460
88
+ irie/apps/prediction/runners/__init__.py,sha256=lX8IvcW3iDTyrm__GtU05gdpqKsoxoTxSImcZCVPY9E,1803
89
+ irie/apps/prediction/runners/hazus.py,sha256=LXNb1NmkEDEx1Jc5Ojv0cGdFrI4C2V4yQ8wlQGN1Uy0,30881
90
+ irie/apps/prediction/runners/ssid.py,sha256=iJgY-7N3AT-RVbWL1K4C-tnJ1ZhCmeT6FHQTn1SmlCY,18499
91
+ irie/apps/prediction/runners/opensees/__init__.py,sha256=fHa5k_bCKbGS-DAHPx-Tzqm5Is76DeBc0d-w7vda2ao,21177
90
92
  irie/apps/prediction/runners/opensees/metrics.py,sha256=HU1V0RYQDXrhTcHqwpnU2KOSl4UPNo9S6QP3sz2VcUY,6428
91
93
  irie/apps/prediction/runners/opensees/utilities.py,sha256=aPBANs6NR-EPrYsekBLx-IWvx4GbNypMtkHy3PPM6aM,9028
92
94
  irie/apps/prediction/runners/opensees/xmlutils.py,sha256=Q3i5L0Dp_5nRsKRGMr-m_bS03Mxa36Ujb-RvwAmResc,7510
@@ -365,8 +367,8 @@ irie/apps/templates/includes/scripts.html,sha256=1Up6xJJSTpdLTJp0tDAa3JubevvSlic
365
367
  irie/apps/templates/includes/settings-box.html,sha256=wexsLS4SMRyKci-r4L_LQ6QM27h4U291091NcGiTT3o,2486
366
368
  irie/apps/templates/includes/sidebar.html,sha256=uJnzXtcV7UvXscvEHe5z0wpLsFZk8B9mj1_Ye08NRbY,10972
367
369
  irie/apps/templates/inventory/asset-event-summary.html,sha256=ZDhCIO6gV6XTeLDZt2l5X47hBv9jXsLL4p9yflbu-mk,50749
368
- irie/apps/templates/inventory/asset-profile.html,sha256=VzjnwG4qSq8vFeiI1zzUZzLoQM-aUSW134S1N4u2bOI,11760
369
- irie/apps/templates/inventory/asset-table.html,sha256=TP6V-IkPHzqsBBWBt8o3-GoCvk1CJUqJCjw5BYMzC0A,10483
370
+ irie/apps/templates/inventory/asset-profile.html,sha256=iHUT9In2zjiVBZ3NHnrQMLkUAIaELMMHZm2UHFXMiR8,11289
371
+ irie/apps/templates/inventory/asset-table.html,sha256=A-1hVxDxuahlZQ1CYFb2fKO9710wKk5NoZN-dNBjrNE,12208
370
372
  irie/apps/templates/inventory/bridge-dashboard.html,sha256=67zrDlih3LOi9xFVwPVZZkgRT3DO-lE_qRL7q8Uz9GY,45472
371
373
  irie/apps/templates/inventory/bridge.html,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
372
374
  irie/apps/templates/inventory/dashboard.html,sha256=yKEqsdSQpLIxv-E2sytN3yPNN9Li0q4488N3VVT9Jg8,7604
@@ -379,10 +381,10 @@ irie/apps/templates/networks/corridor_table.html,sha256=SW6WMmxGsw2li1BXqvCRj1CF
379
381
  irie/apps/templates/networks/networks.html,sha256=XMBwHhBqkG4ty2zgozlzeJNgyyXAzdbD95iyNJi4gJE,5745
380
382
  irie/apps/templates/networks/networks.js,sha256=5uEshaGOxzwEbDo4nOVK2lCrNrYL_MO2d4vgqAIOT3U,7444
381
383
  irie/apps/templates/networks/styled_inputs.html,sha256=4IqtA4oQw6zAc2oypEYspIn_dS0syvVtZvkshhj1Tco,118
382
- irie/apps/templates/prediction/asset-predictors.html,sha256=V-yzKrtrkmLp4q1POQabd7eZFLEf7uBxKWqM2vX7r6s,3799
384
+ irie/apps/templates/prediction/asset-predictors.html,sha256=L2iJvFvO1Far0Ba1yvrfytkCaaw9WlnYsv_H6CyNGxE,4848
383
385
  irie/apps/templates/prediction/form-submission.html,sha256=v4jRoM_DBQ2Xoe17_5ltZUn6Yw1shT6NRe69dufhXxc,5600
384
- irie/apps/templates/prediction/new-runner.html,sha256=XiV1BQqZoHw_uALnpCvKy_N3T-rYyvzNkiPOl7--Nvs,2675
385
- irie/apps/templates/prediction/predictor-profile.html,sha256=fcK_VmrzVYPPFUncW39rYRKUE1jr6jJx6iXWf81VYRk,3909
386
+ irie/apps/templates/prediction/new-runner.html,sha256=aY4ux91FhiWkLsabevjiPpzE9XIYdY_1_fRZ-J9iqZw,2682
387
+ irie/apps/templates/prediction/predictor-profile.html,sha256=v4eChMDAN4nHyIk570yvdeUf0FcptKRqzNQb2net4_Q,4290
386
388
  irie/apps/templates/prediction/predictor-upload.html,sha256=KSM7jiyi6xBkmYvhzyyU5arYj_ROVmkDZiwVAz8Y8LQ,1014
387
389
  irie/apps/templates/prediction/hazus/event.html,sha256=vcmQKfb-Gww5sd-kn6b2QL3llRrfQFv8mafVNNxTHrY,841
388
390
  irie/apps/templates/prediction/hazus/history.html,sha256=zvnwP0gxSV9JNBbYACnKlMLB9iD7hGUbdkZ6kfJtBik,136
@@ -411,25 +413,27 @@ irie/core/settings.py,sha256=9jqn02olEya6O2p3pABLFhmHRwl_U05sOAtluo6y1Rg,6342
411
413
  irie/core/urls.py,sha256=H_oIilxAeV6C5W3TY_-oYwkbHiOnHdrRGweBDnOe04k,1279
412
414
  irie/core/wsgi.py,sha256=8dxK789vOoRWm0IatEhNqMgZhov9TlspjM6hOUbjg24,395
413
415
  irie/init/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
414
- irie/init/__main__.py,sha256=ngBeyh1rRXYZYIeW5VKvHl8QggIV90A49QXbZbvePLI,556
416
+ irie/init/__main__.py,sha256=6-_8v1yigDWa6AE0c4xT5CBF--MVhQWnOmG-1ea8X6w,589
415
417
  irie/init/bridges.py,sha256=vWDhpQ42Ws9SHUMPw5N8sEQ_7PXbdXRK1SUlSMQQCeI,74681
416
418
  irie/init/calid.py,sha256=Q6ie1irxm9EiGdxuR2OD05Hffg0UsTWIxQJha-kWkVs,1331
417
- irie/init/getCGSData.py,sha256=sm7207BAHivyS3nG07BZuD1hQ_9F8UbEBalL41PdP8Q,2777
419
+ irie/init/getCGSData.py,sha256=iZG3Ab1Y_rhiliKCPNy0MZrKBsfEe6ShgSFz2ttvTUU,2916
418
420
  irie/init/getCGSevents.py,sha256=4dBkFFJQrUs6gfl1Nj-_R2UOZj0B_T017a6tC7fUHOw,421
419
421
  irie/init/getNBIData.py,sha256=xEzM4nCfaRo5QoB90QCezxbOdpKd54UbeFNaymvDhZU,7923
420
422
  irie/init/hayward.zip,sha256=WECOnYLP_3EeKHQzdxm17MHTncF2QdgXI28Vm6Iopt0,124675
423
+ irie/init/data/cgs-stations.json,sha256=h-KKF-u31j_OQnQZQlmFzDjqgi0AcsPNzohn7bCNq0Q,105563
421
424
  irie/init/data/cgs_data.json,sha256=l2lADALMXVLKY6jn-rvEZjYWcZjGHLk22ZudocdR81Q,27752
422
425
  irie/init/data/nbi_codes-california.json,sha256=UPFbBzxY2NshREecsP4evCA8vdvXFRvG4rYT4_KHmQs,2398694
423
426
  irie/init/data/nbi_data-california.json,sha256=nyslZbMf30WrtdyqCpMvxd-NNxNzFHtZX_TDWRZFob0,8534365
424
427
  irie/init/data/nbi/04.tar,sha256=ubRgxWBshe0cNKxftbEVyFeh1HcUmFarVL2BBHo9Tyk,1884160
425
428
  irie/init/data/networks/soga_corridors.json,sha256=AQOUaKGNWkQxQKLfqphE9Qb_-NRmjN9IwK59SGjutxE,45496
426
- irie/init/management/commands/init_assets.py,sha256=3-8WMzKwzyaSO-cigPKYBV61XzQf5_qmvvQdUD8ySWA,6040
429
+ irie/init/management/commands/init_assets.py,sha256=smkeNWE2YEbx_nMOBQdKpsbRbbRg7e8Cm0i575m39Zs,6055
430
+ irie/init/management/commands/init_cesmd.py,sha256=WCEoLNgcrWClLiunio-BAj7LQha8vm6FRXqYEnRthfc,824
427
431
  irie/init/management/commands/init_corridors.py,sha256=EzLk0HUiFxlco-2u0rypewOc9mAo_raqXC2_UCG8a_w,1241
428
432
  irie/init/management/commands/init_predictors.py,sha256=jdD7rd8l2qxuUuR5GOYuHXp-ZQkAK477TefksBMdlOw,2362
429
433
  irie/rest/__main__.py,sha256=6Nf_-Rr9zGmMyp_wqCFDO7ls9QPnPd9UyUgN17rIGYw,3680
430
434
  irie/usgs/__main__.py,sha256=HiSvPn5IW5IqRiCk1qRRq5dCy3-7iISw7v1P_w2rLrk,5049
431
- irie-0.0.16.dist-info/METADATA,sha256=4r4UvppZMwDpNtdvs6GrfPu1Kity-FvBwzZkNDRS9oM,2527
432
- irie-0.0.16.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
433
- irie-0.0.16.dist-info/entry_points.txt,sha256=A_3h9wPBGfxGQ78_MGa-nO6Z0foxOYeAnIE47jxEztg,44
434
- irie-0.0.16.dist-info/top_level.txt,sha256=zVCxi5E2nkISZPzKq8VEhWe_dGuPcefLYV1tYqQdwlY,5
435
- irie-0.0.16.dist-info/RECORD,,
435
+ irie-0.0.17.dist-info/METADATA,sha256=dZurGmbIh5_4nRe9EVAm7HNrQ8ORi_u1e0dmiL6akow,2527
436
+ irie-0.0.17.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
437
+ irie-0.0.17.dist-info/entry_points.txt,sha256=A_3h9wPBGfxGQ78_MGa-nO6Z0foxOYeAnIE47jxEztg,44
438
+ irie-0.0.17.dist-info/top_level.txt,sha256=zVCxi5E2nkISZPzKq8VEhWe_dGuPcefLYV1tYqQdwlY,5
439
+ irie-0.0.17.dist-info/RECORD,,
File without changes