irie 0.0.47__py3-none-any.whl → 0.0.49__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.

@@ -583,6 +583,9 @@ class AssetMap:
583
583
  top_markers = []
584
584
  for b in assets:
585
585
  lat, lon = b.coordinates
586
+ if lat is None or lon is None:
587
+ print(b)
588
+ continue
586
589
  popup = folium.Popup(
587
590
  folium.Html(
588
591
  '<a style="display: inline;" target="_blank" href="/inventory/{calid}/">{label}</a>'.format(
@@ -8,7 +8,6 @@ import json
8
8
  import fnmatch
9
9
  import numpy as np
10
10
 
11
- from matplotlib import pyplot as plt
12
11
  from math import pi
13
12
  from collections import defaultdict
14
13
  import quakeio
@@ -239,6 +238,7 @@ def getPeak(file, other=None):
239
238
  return peakVals, timePeakVals, maxPeakCol
240
239
 
241
240
  def husid(accRH, plothusid, dt, lb=0.05, ub=0.95):
241
+ from matplotlib import pyplot as plt
242
242
  ai = np.tril(np.ones(len(accRH)))@accRH**2
243
243
  husid = ai/ai[-1]
244
244
  ilb = next(x for x, val in enumerate(husid) if val > lb)
irie/init/calid.py CHANGED
@@ -41,7 +41,7 @@ CESMD = {
41
41
 
42
42
  "35-0054": ("CE58677", None, "San Mateo Bridge"),
43
43
  # "35-0054": ("CE58799", None, "San Mateo Bridge Trestle"),
44
- "53-3032": ("CE14709", None, "Long Beach - Schuyler Heim Bridge"),
44
+ # "53-3032": ("CE14709", None, "Long Beach - Schuyler Heim Bridge"),
45
45
  "51-0104": ("CE25749", None, "Santa Barbara - San Roque Canyon Bridge"),
46
46
  "44-0298": ("CE47646", None, "Big Sur - New Hwy 1/Pfeiffer Cnyn Bridge"),
47
47
  "44-0060": ("CE47729", None, "Big Sur - Hwy 1/Pfeiffer Canyon Bridge [Demolished]"),
@@ -50,7 +50,7 @@ CESMD = {
50
50
  "27-0013": ("CE68778", None, "Novato - Hwy37/Petaluma River Bridge"),
51
51
  "17-0058L": ("CE76741", None, "Truckee - I80/Truckee River Bridge"),
52
52
  "06-0210": ("CE88638", None, "Shasta Lake - I5/Antlers Bridge"),
53
- "54-0474F": ("CE12666", None, "North Palm Springs - I10/Hwy 62 Bridge"),
53
+ # "54-0474F": ("CE12666", None, "North Palm Springs - I10/Hwy 62 Bridge"),
54
54
  "53-1185": ("CE14690", None, "Los Angeles - I405/San Gabriel River Br"),
55
55
  "50-0402R": ("CE34715", None, "Mojave - Hwy 14/Railroad Bridge"),
56
56
  "33-0347S": ("CE58656", None, "Oakland - Hwy 580/13 Interchange Bridge"),
@@ -1,10 +1,11 @@
1
1
  import irie
2
2
  import numpy as np
3
3
  from irie.apps.inventory.models import Asset
4
- from irie.init.calid import CALID, CESMD
4
+ from irie.init.calid import CESMD_LONG_LAT, CESMD
5
5
  from pathlib import Path
6
6
  from django.core.management.base import BaseCommand
7
7
  import json
8
+ from collections import defaultdict
8
9
 
9
10
  DATA = Path(irie.__file__).parents[0]/"init"/"data"
10
11
 
@@ -13,6 +14,15 @@ with open(DATA/"cgs_data.json") as f:
13
14
  with open(DATA/"nbi_data_cesmd.json") as f:
14
15
  NBI_DATA = json.loads(f.read())
15
16
 
17
+
18
+ def nbi_reshape(raw):
19
+ data = defaultdict(dict)
20
+ for row in raw["Results"]["NBIData"]["NBIDataList"]:
21
+ data[row["TABLE_NAME"]][row["EXPANDED_FIELD_ALIAS"]] = row["FIELD_VALUE"]
22
+
23
+ return dict(data)
24
+
25
+
16
26
  class Command(BaseCommand):
17
27
  def handle(self, *args, **kwargs):
18
28
  # with open(DATA/"cgs-stations.json") as f:
@@ -31,8 +41,9 @@ class Command(BaseCommand):
31
41
  asset.cesmd = cesmd
32
42
  asset.calid = calid
33
43
  asset.cgs_data = CGS_DATA.get(cesmd, {})
34
- asset.nbi_data = NBI_DATA.get(calid.replace("-", " "), {})
35
-
44
+ if calid.replace("-", " ") in NBI_DATA:
45
+ asset.nbi_data = nbi_reshape(NBI_DATA.get(calid.replace("-", " "), [{}])[-1])
46
+
36
47
  asset.save()
37
48
  print(asset)
38
49
  count += 1
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: irie
3
- Version: 0.0.47
3
+ Version: 0.0.49
4
4
  Summary: An infrastructure resilience engine
5
5
  Author-email: "Claudio M. Perez" <50180406+claudioperez@users.noreply.github.com>
6
6
  Project-URL: Repository, https://github.com/STAIRLab
@@ -32,6 +32,7 @@ Requires-Dist: opensees
32
32
  Requires-Dist: quakeio
33
33
  Requires-Dist: mdof
34
34
  Requires-Dist: veux
35
+ Requires-Dist: xara
35
36
  Requires-Dist: bottle
36
37
  Requires-Dist: openbim
37
38
  Requires-Dist: folium
@@ -65,7 +65,7 @@ irie/apps/inventory/models.py,sha256=ie7XhFDujpoyIinmX-YfScVx28SkkRhFadU0iNLC9HI
65
65
  irie/apps/inventory/sitemaps.py,sha256=Nha1MTsIH_ad7JyoxwonPytp7MNuEhDNszkEUOmlN0o,826
66
66
  irie/apps/inventory/tables.py,sha256=vZdPOcbN1ibuWXqLwbBUoQw9iavwa1GJ5fd83k8bu7Y,27874
67
67
  irie/apps/inventory/urls.py,sha256=u2LNLB4K4fDq3yPYtREKf3i7_yHRzrTP3cb22G8Brvk,1578
68
- irie/apps/inventory/views.py,sha256=cjL2v4_7q2S7OczeNdh_g7pVxXdkKgaqj60oQaOEED8,21422
68
+ irie/apps/inventory/views.py,sha256=H9H16E8HODOadg809QuzNPV-vzeW2ZfrE45jhISa46s,21518
69
69
  irie/apps/inventory/archive/CESMD.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
70
70
  irie/apps/inventory/archive/calid.py,sha256=3L8MbPIGOE3kzDnqeyY055pRBiF2O2l0cmpuDbTsdTg,3014
71
71
  irie/apps/inventory/migrations/0001_initial.py,sha256=PwTHv4Q3gqWFha--8Zp9kUOh-cYalB14jXj7RVJUVnw,1786
@@ -111,7 +111,7 @@ irie/apps/prediction/runners/hazus.py,sha256=sWQDDmwN82wKSHW9EGx46JOOPo_IN2CTK7R
111
111
  irie/apps/prediction/runners/ssid.py,sha256=Y36FMPVzjNMXknQO6LegTBFUF2X-l7TXyddY4Z8SDmA,18701
112
112
  irie/apps/prediction/runners/opensees/__init__.py,sha256=QlInYqEKc1oYBnw6TeF4dS3VnOxmQeLptF9EKr-blfM,21177
113
113
  irie/apps/prediction/runners/opensees/metrics.py,sha256=HU1V0RYQDXrhTcHqwpnU2KOSl4UPNo9S6QP3sz2VcUY,6428
114
- irie/apps/prediction/runners/opensees/utilities.py,sha256=aPBANs6NR-EPrYsekBLx-IWvx4GbNypMtkHy3PPM6aM,9028
114
+ irie/apps/prediction/runners/opensees/utilities.py,sha256=1cajnV6gWkJ5obYixfbHZKwxi1ECpR0sBWquAAGhseE,9032
115
115
  irie/apps/prediction/runners/opensees/xmlutils.py,sha256=Q3i5L0Dp_5nRsKRGMr-m_bS03Mxa36Ujb-RvwAmResc,7510
116
116
  irie/apps/prediction/runners/opensees/zipped.py,sha256=ou2BnxY4WzAzVp3cL9XJUeSJqdijRs-rbcagOsX_Ed0,942
117
117
  irie/apps/prediction/runners/opensees/schemas/__init__.py,sha256=AMX2Z5F_ltcB6ny1U41aDXIbAmS7wprjcA35j511XBU,1033
@@ -465,7 +465,7 @@ irie/fhwa/fields/nbi002.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
465
465
  irie/init/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
466
466
  irie/init/__main__.py,sha256=waUELqnhqZirROMIb5wMzD4mK5fgrUvWRsXoTXhjtxY,807
467
467
  irie/init/bridges.py,sha256=OBBKnLx2lmMKDfeR0C8CBSbnpnzO0lfokBypD2nEFcM,74198
468
- irie/init/calid.py,sha256=-861tihqB-u2ZfXWqAW6RzgSmR1UvcSX4Y_ZzfJVWMw,10883
468
+ irie/init/calid.py,sha256=JsZRnR_GBNgYkKotVPyju6EcCo9eTFyjQGNweHz1xq4,10883
469
469
  irie/init/getBridgeData.py,sha256=PU4OcdXCR0D-CCBX_T3PjyYL0QJKYyz2I4AMhaYKaZk,12650
470
470
  irie/init/getCGSData.py,sha256=iZG3Ab1Y_rhiliKCPNy0MZrKBsfEe6ShgSFz2ttvTUU,2916
471
471
  irie/init/getCGSevents.py,sha256=4dBkFFJQrUs6gfl1Nj-_R2UOZj0B_T017a6tC7fUHOw,421
@@ -482,15 +482,15 @@ irie/init/data/nbi_definitions.json,sha256=NS3yNP1i1E_JXfGW_I_xOoNRsfeljDA5BZ_1h
482
482
  irie/init/data/nbi/04.tar,sha256=ubRgxWBshe0cNKxftbEVyFeh1HcUmFarVL2BBHo9Tyk,1884160
483
483
  irie/init/data/networks/soga_corridors.json,sha256=AQOUaKGNWkQxQKLfqphE9Qb_-NRmjN9IwK59SGjutxE,45496
484
484
  irie/init/management/commands/init_assets.py,sha256=z-QczBwa7altFy8oLgKtF2_ogHwWOGGFiMJYLkol-zU,5709
485
- irie/init/management/commands/init_cesmd.py,sha256=CuttXboaYoIHAlWnsfE-h6cdCQqoO0iVGI11F91i-uo,1355
485
+ irie/init/management/commands/init_cesmd.py,sha256=vWRJDxNv4T4yVSU2ikC3GM-HL9O1TkQvUvWWGatbcyk,1679
486
486
  irie/init/management/commands/init_corridors.py,sha256=EzLk0HUiFxlco-2u0rypewOc9mAo_raqXC2_UCG8a_w,1241
487
487
  irie/init/management/commands/init_predictors.py,sha256=edCf7d36cwl4YitXLtvOfsPee-BiPF55_Gr73OvTPcU,2368
488
488
  irie/init/management/commands/make_asset.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
489
489
  irie/pull/nbi.py,sha256=KpBjJ9GEU72Qk1t4bGN9cg0QBeVJ8k9XcI3Y1oSgIR0,11478
490
490
  irie/rest/__main__.py,sha256=6Nf_-Rr9zGmMyp_wqCFDO7ls9QPnPd9UyUgN17rIGYw,3680
491
491
  irie/usgs/__main__.py,sha256=HiSvPn5IW5IqRiCk1qRRq5dCy3-7iISw7v1P_w2rLrk,5049
492
- irie-0.0.47.dist-info/METADATA,sha256=UY4aOzGLBIxZib3YMGJmtUSiMQbiZzMNoYlWIFaPPuY,3207
493
- irie-0.0.47.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
494
- irie-0.0.47.dist-info/entry_points.txt,sha256=A_3h9wPBGfxGQ78_MGa-nO6Z0foxOYeAnIE47jxEztg,44
495
- irie-0.0.47.dist-info/top_level.txt,sha256=zVCxi5E2nkISZPzKq8VEhWe_dGuPcefLYV1tYqQdwlY,5
496
- irie-0.0.47.dist-info/RECORD,,
492
+ irie-0.0.49.dist-info/METADATA,sha256=6ZscywZ1s8hwRpSf8tdLhXs358Lv2zjPd6e-ckLNfgk,3227
493
+ irie-0.0.49.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
494
+ irie-0.0.49.dist-info/entry_points.txt,sha256=A_3h9wPBGfxGQ78_MGa-nO6Z0foxOYeAnIE47jxEztg,44
495
+ irie-0.0.49.dist-info/top_level.txt,sha256=zVCxi5E2nkISZPzKq8VEhWe_dGuPcefLYV1tYqQdwlY,5
496
+ irie-0.0.49.dist-info/RECORD,,
File without changes