voxcity 0.5.11__py3-none-any.whl → 0.5.13__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 voxcity might be problematic. Click here for more details.

voxcity/simulator/view.py CHANGED
@@ -1499,7 +1499,8 @@ def compute_view_factor_for_all_faces(
1499
1499
  target_values,
1500
1500
  inclusion_mode,
1501
1501
  grid_bounds_real,
1502
- boundary_epsilon
1502
+ boundary_epsilon,
1503
+ ignore_downward=True
1503
1504
  ):
1504
1505
  """
1505
1506
  Compute a per-face "view factor" for a specified set of target voxel classes.
@@ -1527,6 +1528,7 @@ def compute_view_factor_for_all_faces(
1527
1528
  If False, hitting anything *not* in target_values (except -2 trees) blocks the ray.
1528
1529
  grid_bounds_real (np.ndarray): [[x_min,y_min,z_min],[x_max,y_max,z_max]] in real coords.
1529
1530
  boundary_epsilon (float): tolerance for marking boundary vertical faces.
1531
+ ignore_downward (bool): If True, only consider upward rays. If False, consider all outward rays.
1530
1532
 
1531
1533
  Returns:
1532
1534
  np.ndarray of shape (n_faces,):
@@ -1592,34 +1594,34 @@ def compute_view_factor_for_all_faces(
1592
1594
  angle
1593
1595
  )
1594
1596
 
1595
- # -- 3) Count how many directions are outward & upward
1597
+ # -- 3) Count valid directions based on ignore_downward setting
1596
1598
  total_outward = 0
1597
- num_upward = 0
1599
+ num_valid = 0
1598
1600
  for i in range(local_dirs.shape[0]):
1599
1601
  dvec = local_dirs[i]
1600
1602
  dp = dvec[0]*normal[0] + dvec[1]*normal[1] + dvec[2]*normal[2]
1601
1603
  if dp > 0.0:
1602
1604
  total_outward += 1
1603
- if dvec[2] > 0.0:
1604
- num_upward += 1
1605
+ if not ignore_downward or dvec[2] > 0.0:
1606
+ num_valid += 1
1605
1607
 
1606
1608
  # If no outward directions at all => view factor = 0
1607
1609
  if total_outward == 0:
1608
1610
  face_vf_values[fidx] = 0.0
1609
1611
  continue
1610
1612
 
1611
- # If no upward directions => view factor = 0
1612
- if num_upward == 0:
1613
+ # If no valid directions => view factor = 0
1614
+ if num_valid == 0:
1613
1615
  face_vf_values[fidx] = 0.0
1614
1616
  continue
1615
1617
 
1616
- # -- 4) Create an array for only the upward directions
1617
- valid_dirs_arr = np.empty((num_upward, 3), dtype=np.float64)
1618
+ # -- 4) Create an array for valid directions
1619
+ valid_dirs_arr = np.empty((num_valid, 3), dtype=np.float64)
1618
1620
  out_idx = 0
1619
1621
  for i in range(local_dirs.shape[0]):
1620
1622
  dvec = local_dirs[i]
1621
1623
  dp = dvec[0]*normal[0] + dvec[1]*normal[1] + dvec[2]*normal[2]
1622
- if dp > 0.0 and dvec[2] > 0.0:
1624
+ if dp > 0.0 and (not ignore_downward or dvec[2] > 0.0):
1623
1625
  valid_dirs_arr[out_idx, 0] = dvec[0]
1624
1626
  valid_dirs_arr[out_idx, 1] = dvec[1]
1625
1627
  valid_dirs_arr[out_idx, 2] = dvec[2]
@@ -1630,8 +1632,7 @@ def compute_view_factor_for_all_faces(
1630
1632
  ray_origin = (center / meshsize) + (normal / norm_n) * offset_vox
1631
1633
 
1632
1634
  # -- 6) Compute fraction of rays that "see" the target
1633
- # (in the old code, "seeing the sky" meant the ray was NOT blocked by non‐sky voxels)
1634
- upward_vf = compute_vi_generic(
1635
+ vf = compute_vi_generic(
1635
1636
  ray_origin,
1636
1637
  voxel_data,
1637
1638
  valid_dirs_arr,
@@ -1642,9 +1643,9 @@ def compute_view_factor_for_all_faces(
1642
1643
  inclusion_mode
1643
1644
  )
1644
1645
 
1645
- # Scale by fraction of directions that were outward
1646
- fraction_up = num_upward / total_outward
1647
- face_vf_values[fidx] = upward_vf * fraction_up
1646
+ # Scale by fraction of directions that were valid
1647
+ fraction_valid = num_valid / total_outward
1648
+ face_vf_values[fidx] = vf * fraction_valid
1648
1649
 
1649
1650
  return face_vf_values
1650
1651
 
@@ -1578,7 +1578,7 @@ def visualize_voxcity_multi_view(voxel_array, meshsize, **kwargs):
1578
1578
 
1579
1579
  # Display each view separately
1580
1580
  for view_name, img_file in image_files:
1581
- plt.figure(figsize=(12, 8))
1581
+ plt.figure(figsize=(24, 16))
1582
1582
  img = plt.imread(img_file)
1583
1583
  plt.imshow(img)
1584
1584
  plt.title(view_name.replace('_', ' ').title(), pad=20)
@@ -1699,7 +1699,7 @@ def visualize_voxcity_multi_view_with_multiple_sim_grids(voxel_array, meshsize,
1699
1699
 
1700
1700
  # Display each view separately
1701
1701
  for view_name, img_file in image_files:
1702
- plt.figure(figsize=(12, 8))
1702
+ plt.figure(figsize=(24, 16))
1703
1703
  img = plt.imread(img_file)
1704
1704
  plt.imshow(img)
1705
1705
  plt.title(view_name.replace('_', ' ').title(), pad=20)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: voxcity
3
- Version: 0.5.11
3
+ Version: 0.5.13
4
4
  Summary: voxcity is an easy and one-stop tool to output 3d city models for microclimate simulation by integrating multiple geospatial open-data
5
5
  Author-email: Kunihiko Fujiwara <kunihiko@nus.edu.sg>
6
6
  Maintainer-email: Kunihiko Fujiwara <kunihiko@nus.edu.sg>
@@ -42,7 +42,6 @@ Requires-Dist: mapbox_vector_tile
42
42
  Requires-Dist: numba
43
43
  Requires-Dist: reverse_geocoder
44
44
  Requires-Dist: pycountry
45
- Requires-Dist: osm2geojson
46
45
  Requires-Dist: seaborn
47
46
  Requires-Dist: overturemaps
48
47
  Requires-Dist: protobuf<6,>=4.21
@@ -73,7 +72,7 @@ Dynamic: license-file
73
72
  </p>
74
73
 
75
74
  <p align="center">
76
- <img src="https://raw.githubusercontent.com/kunifujiwara/VoxCity/main/images/logo.png" alt="Voxcity logo" width="800">
75
+ <img src="https://raw.githubusercontent.com/kunifujiwara/VoxCity/main/images/logo.png" alt="Voxcity logo" width="550">
77
76
  </p>
78
77
 
79
78
  # VoxCity
@@ -7,7 +7,7 @@ voxcity/downloader/gee.py,sha256=hEN5OvQAltORYnrlPbmYcDequ6lKLmwyTbNaCZ81Vj8,160
7
7
  voxcity/downloader/mbfp.py,sha256=pGJuXXLRuRedlORXfg8WlgAVwmKI30jxki9t-v5NejY,3972
8
8
  voxcity/downloader/oemj.py,sha256=YlCuWBQfi40gfmwQcGDeHiPOs4Pk_jLZq65d5R3IGMU,7886
9
9
  voxcity/downloader/omt.py,sha256=ByFvoQDnBOJF4qdVYNkDjn7cMvEhWwtD0mIV_T-zMEs,9017
10
- voxcity/downloader/osm.py,sha256=0VpYuPRiO3iru3nHM_or0nTDFb8ytUUDZieFX6zxB9Q,26338
10
+ voxcity/downloader/osm.py,sha256=6oMkB-G4j8lLIhSwJei66PNQ_8kZ-Yw90Qv8B9g1x6Q,37972
11
11
  voxcity/downloader/overture.py,sha256=2m7pHymE60iaqxa3H4gxAMtJioHd831R5kCS73dxzW8,7821
12
12
  voxcity/downloader/utils.py,sha256=z6MdPxM96FWQVqvZW2Eg5pMewVHVysUP7F6ueeCwMfI,1375
13
13
  voxcity/exporter/__init_.py,sha256=cVyNyE6axEpSd3CT5hGuMOAlOyU1p8lVP4jkF1-0Ad8,94
@@ -22,17 +22,17 @@ voxcity/geoprocessor/network.py,sha256=opb_kpUCAxDd1qtrWPStqR5reYZtVe96XxazNSen7
22
22
  voxcity/geoprocessor/polygon.py,sha256=8Vb2AbkpKYhq1kk2hQMc-gitmUo9pFIe910v4p1vP2g,37772
23
23
  voxcity/geoprocessor/utils.py,sha256=1BRHp-DDeOA8HG8jplY7Eo75G3oXkVGL6DGONL4BA8A,19815
24
24
  voxcity/simulator/__init_.py,sha256=APdkcdaovj0v_RPOaA4SBvFUKT2RM7Hxuuz3Sux4gCo,65
25
- voxcity/simulator/solar.py,sha256=amJ5GJtzdG9NE7oxrLj4EMRxGvDY9s2BQdDJ2paFfn0,56709
25
+ voxcity/simulator/solar.py,sha256=CRCTY1rneorxqrDFAShsGSRssvkAQ3FoqpAB8bPiK5Y,57215
26
26
  voxcity/simulator/utils.py,sha256=sEYBB2-hLJxTiXQps1_-Fi7t1HN3-1OPOvBCWtgIisA,130
27
- voxcity/simulator/view.py,sha256=YufbLuDXrLg1d1dedM6pVyiJ7uHsqY8F2sLLnIoJvB4,74910
27
+ voxcity/simulator/view.py,sha256=3ls8pew8fLIM8YRHpJNYCF8AiC6CofFPSsa2c2XWHpg,74974
28
28
  voxcity/utils/__init_.py,sha256=nLYrj2huBbDBNMqfchCwexGP8Tlt9O_XluVDG7MoFkw,98
29
29
  voxcity/utils/lc.py,sha256=RwPd-VY3POV3gTrBhM7TubgGb9MCd3nVah_G8iUEF7k,11562
30
30
  voxcity/utils/material.py,sha256=Vt3IID5Ft54HNJcEC4zi31BCPqi_687X3CSp7rXaRVY,5907
31
- voxcity/utils/visualization.py,sha256=jsKfUoRRW0yRCmJ03I7ESK1Tic_Xk1tcliw-8syr3Y0,87228
31
+ voxcity/utils/visualization.py,sha256=bxMfpSQMPghzqAGM2EpNmVMlrQu_aOHtFtNk5aOPHlU,87230
32
32
  voxcity/utils/weather.py,sha256=CFPtoqRTajwMRswswDChwQ3BW1cGsnA3orgWHgz7Ehg,26304
33
- voxcity-0.5.11.dist-info/licenses/AUTHORS.rst,sha256=m82vkI5QokEGdcHof2OxK39lf81w1P58kG9ZNNAKS9U,175
34
- voxcity-0.5.11.dist-info/licenses/LICENSE,sha256=s_jE1Df1nTPL4A_5GCGic5Zwex0CVaPKcAmSilxJPPE,1089
35
- voxcity-0.5.11.dist-info/METADATA,sha256=hK1HErMdMRO_166kD7r3ZeGGT9pZq6Ok54PbcwpCYJA,25885
36
- voxcity-0.5.11.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
37
- voxcity-0.5.11.dist-info/top_level.txt,sha256=00b2U-LKfDllt6RL1R33MXie5MvxzUFye0NGD96t_8I,8
38
- voxcity-0.5.11.dist-info/RECORD,,
33
+ voxcity-0.5.13.dist-info/licenses/AUTHORS.rst,sha256=m82vkI5QokEGdcHof2OxK39lf81w1P58kG9ZNNAKS9U,175
34
+ voxcity-0.5.13.dist-info/licenses/LICENSE,sha256=s_jE1Df1nTPL4A_5GCGic5Zwex0CVaPKcAmSilxJPPE,1089
35
+ voxcity-0.5.13.dist-info/METADATA,sha256=5_fl8lJg9DdFoagzJlrWah22DrR_xshvSTz5D6AoOBo,25857
36
+ voxcity-0.5.13.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
37
+ voxcity-0.5.13.dist-info/top_level.txt,sha256=00b2U-LKfDllt6RL1R33MXie5MvxzUFye0NGD96t_8I,8
38
+ voxcity-0.5.13.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (77.0.3)
2
+ Generator: setuptools (78.1.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5