voxcity 0.3.5__tar.gz → 0.3.7__tar.gz

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.

Files changed (52) hide show
  1. {voxcity-0.3.5 → voxcity-0.3.7}/PKG-INFO +35 -3
  2. {voxcity-0.3.5 → voxcity-0.3.7}/README.md +34 -2
  3. {voxcity-0.3.5 → voxcity-0.3.7}/pyproject.toml +1 -1
  4. {voxcity-0.3.5 → voxcity-0.3.7}/src/voxcity/geo/network.py +2 -1
  5. {voxcity-0.3.5 → voxcity-0.3.7}/src/voxcity/sim/solar.py +15 -6
  6. {voxcity-0.3.5 → voxcity-0.3.7}/src/voxcity/utils/weather.py +2 -2
  7. {voxcity-0.3.5 → voxcity-0.3.7}/src/voxcity.egg-info/PKG-INFO +35 -3
  8. {voxcity-0.3.5 → voxcity-0.3.7}/AUTHORS.rst +0 -0
  9. {voxcity-0.3.5 → voxcity-0.3.7}/CONTRIBUTING.rst +0 -0
  10. {voxcity-0.3.5 → voxcity-0.3.7}/HISTORY.rst +0 -0
  11. {voxcity-0.3.5 → voxcity-0.3.7}/LICENSE +0 -0
  12. {voxcity-0.3.5 → voxcity-0.3.7}/MANIFEST.in +0 -0
  13. {voxcity-0.3.5 → voxcity-0.3.7}/docs/Makefile +0 -0
  14. {voxcity-0.3.5 → voxcity-0.3.7}/docs/archive/README.rst +0 -0
  15. {voxcity-0.3.5 → voxcity-0.3.7}/docs/authors.rst +0 -0
  16. {voxcity-0.3.5 → voxcity-0.3.7}/docs/conf.py +0 -0
  17. {voxcity-0.3.5 → voxcity-0.3.7}/docs/index.rst +0 -0
  18. {voxcity-0.3.5 → voxcity-0.3.7}/docs/make.bat +0 -0
  19. {voxcity-0.3.5 → voxcity-0.3.7}/setup.cfg +0 -0
  20. {voxcity-0.3.5 → voxcity-0.3.7}/src/voxcity/__init__.py +0 -0
  21. {voxcity-0.3.5 → voxcity-0.3.7}/src/voxcity/download/__init__.py +0 -0
  22. {voxcity-0.3.5 → voxcity-0.3.7}/src/voxcity/download/eubucco.py +0 -0
  23. {voxcity-0.3.5 → voxcity-0.3.7}/src/voxcity/download/gee.py +0 -0
  24. {voxcity-0.3.5 → voxcity-0.3.7}/src/voxcity/download/mbfp.py +0 -0
  25. {voxcity-0.3.5 → voxcity-0.3.7}/src/voxcity/download/oemj.py +0 -0
  26. {voxcity-0.3.5 → voxcity-0.3.7}/src/voxcity/download/omt.py +0 -0
  27. {voxcity-0.3.5 → voxcity-0.3.7}/src/voxcity/download/osm.py +0 -0
  28. {voxcity-0.3.5 → voxcity-0.3.7}/src/voxcity/download/overture.py +0 -0
  29. {voxcity-0.3.5 → voxcity-0.3.7}/src/voxcity/download/utils.py +0 -0
  30. {voxcity-0.3.5 → voxcity-0.3.7}/src/voxcity/file/__init_.py +0 -0
  31. {voxcity-0.3.5 → voxcity-0.3.7}/src/voxcity/file/envimet.py +0 -0
  32. {voxcity-0.3.5 → voxcity-0.3.7}/src/voxcity/file/geojson.py +0 -0
  33. {voxcity-0.3.5 → voxcity-0.3.7}/src/voxcity/file/magicavoxel.py +0 -0
  34. {voxcity-0.3.5 → voxcity-0.3.7}/src/voxcity/file/obj.py +0 -0
  35. {voxcity-0.3.5 → voxcity-0.3.7}/src/voxcity/geo/__init_.py +0 -0
  36. {voxcity-0.3.5 → voxcity-0.3.7}/src/voxcity/geo/draw.py +0 -0
  37. {voxcity-0.3.5 → voxcity-0.3.7}/src/voxcity/geo/grid.py +0 -0
  38. {voxcity-0.3.5 → voxcity-0.3.7}/src/voxcity/geo/utils.py +0 -0
  39. {voxcity-0.3.5 → voxcity-0.3.7}/src/voxcity/sim/__init_.py +0 -0
  40. {voxcity-0.3.5 → voxcity-0.3.7}/src/voxcity/sim/utils.py +0 -0
  41. {voxcity-0.3.5 → voxcity-0.3.7}/src/voxcity/sim/view.py +0 -0
  42. {voxcity-0.3.5 → voxcity-0.3.7}/src/voxcity/utils/__init_.py +0 -0
  43. {voxcity-0.3.5 → voxcity-0.3.7}/src/voxcity/utils/lc.py +0 -0
  44. {voxcity-0.3.5 → voxcity-0.3.7}/src/voxcity/utils/material.py +0 -0
  45. {voxcity-0.3.5 → voxcity-0.3.7}/src/voxcity/utils/visualization.py +0 -0
  46. {voxcity-0.3.5 → voxcity-0.3.7}/src/voxcity/voxcity.py +0 -0
  47. {voxcity-0.3.5 → voxcity-0.3.7}/src/voxcity.egg-info/SOURCES.txt +0 -0
  48. {voxcity-0.3.5 → voxcity-0.3.7}/src/voxcity.egg-info/dependency_links.txt +0 -0
  49. {voxcity-0.3.5 → voxcity-0.3.7}/src/voxcity.egg-info/requires.txt +0 -0
  50. {voxcity-0.3.5 → voxcity-0.3.7}/src/voxcity.egg-info/top_level.txt +0 -0
  51. {voxcity-0.3.5 → voxcity-0.3.7}/tests/__init__.py +0 -0
  52. {voxcity-0.3.5 → voxcity-0.3.7}/tests/voxelcity.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: voxcity
3
- Version: 0.3.5
3
+ Version: 0.3.7
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>
@@ -330,7 +330,7 @@ solar_kwargs = {
330
330
  }
331
331
 
332
332
  # Compute global solar irradiance map (direct + diffuse radiation)
333
- global_map = get_global_solar_irradiance_using_epw(
333
+ solar_grid = get_global_solar_irradiance_using_epw(
334
334
  voxcity_grid, # 3D voxel grid representing the urban environment
335
335
  meshsize, # Size of each voxel in meters
336
336
  calc_type='instantaneous', # Calculate instantaneous irradiance at specified time
@@ -345,7 +345,7 @@ solar_kwargs["end_time"] = "01-31 23:00:00" # End time for cumulative calculatio
345
345
  solar_kwargs["output_file_name"] = 'cummulative_solar_irradiance', # Base filename for outputs (without extension)
346
346
 
347
347
  # Calculate cumulative solar irradiance over the specified time period
348
- global_map = get_global_solar_irradiance_using_epw(
348
+ cum_solar_grid = get_global_solar_irradiance_using_epw(
349
349
  voxcity_grid, # 3D voxel grid representing the urban environment
350
350
  meshsize, # Size of each voxel in meters
351
351
  calc_type='cumulative', # Calculate cumulative irradiance over time period instead of instantaneous
@@ -418,6 +418,38 @@ landmark_vis_map = get_landmark_visibility_map(voxcity_grid, building_id_grid, b
418
418
  <em>Example Result Saved as OBJ and Rendered in Rhino</em>
419
419
  </p>
420
420
 
421
+ #### Network Analysis:
422
+
423
+ ```python
424
+ from voxcity.geo.network import get_network_values
425
+
426
+ network_kwargs = {
427
+ "network_type": "walk", # Type of network to download from OSM (walk, drive, all, etc.)
428
+ "colormap": "magma", # Matplotlib colormap for visualization
429
+ "vis_graph": True, # Whether to display the network visualization
430
+ "vmin": 0.0, # Minimum value for color scaling
431
+ "vmax": 600000, # Maximum value for color scaling
432
+ "edge_width": 2, # Width of network edges in visualization
433
+ "alpha": 0.8, # Transparency of network edges
434
+ "zoom": 16 # Zoom level for basemap
435
+ }
436
+
437
+ G, edge_gdf = get_network_values(
438
+ cum_solar_grid, # Grid of cumulative solar irradiance values
439
+ rectangle_vertices, # Coordinates defining simulation domain boundary
440
+ meshsize, # Size of each grid cell in meters
441
+ value_name='Cumulative Global Solar Irradiance (W/m²·hour)', # Label for values in visualization
442
+ **network_kwargs # Additional visualization and network parameters
443
+ )
444
+ ```
445
+
446
+ <p align="center">
447
+ <img src="https://raw.githubusercontent.com/kunifujiwara/VoxCity/main/images/network.png" alt="Example of Graph Output" width="500">
448
+ </p>
449
+ <p align="center">
450
+ <em>Cumulative Global Solar Irradiance (kW/m²·hour) on Road Network</em>
451
+ </p>
452
+
421
453
  ## References of Data Sources
422
454
 
423
455
  ### Building
@@ -273,7 +273,7 @@ solar_kwargs = {
273
273
  }
274
274
 
275
275
  # Compute global solar irradiance map (direct + diffuse radiation)
276
- global_map = get_global_solar_irradiance_using_epw(
276
+ solar_grid = get_global_solar_irradiance_using_epw(
277
277
  voxcity_grid, # 3D voxel grid representing the urban environment
278
278
  meshsize, # Size of each voxel in meters
279
279
  calc_type='instantaneous', # Calculate instantaneous irradiance at specified time
@@ -288,7 +288,7 @@ solar_kwargs["end_time"] = "01-31 23:00:00" # End time for cumulative calculatio
288
288
  solar_kwargs["output_file_name"] = 'cummulative_solar_irradiance', # Base filename for outputs (without extension)
289
289
 
290
290
  # Calculate cumulative solar irradiance over the specified time period
291
- global_map = get_global_solar_irradiance_using_epw(
291
+ cum_solar_grid = get_global_solar_irradiance_using_epw(
292
292
  voxcity_grid, # 3D voxel grid representing the urban environment
293
293
  meshsize, # Size of each voxel in meters
294
294
  calc_type='cumulative', # Calculate cumulative irradiance over time period instead of instantaneous
@@ -361,6 +361,38 @@ landmark_vis_map = get_landmark_visibility_map(voxcity_grid, building_id_grid, b
361
361
  <em>Example Result Saved as OBJ and Rendered in Rhino</em>
362
362
  </p>
363
363
 
364
+ #### Network Analysis:
365
+
366
+ ```python
367
+ from voxcity.geo.network import get_network_values
368
+
369
+ network_kwargs = {
370
+ "network_type": "walk", # Type of network to download from OSM (walk, drive, all, etc.)
371
+ "colormap": "magma", # Matplotlib colormap for visualization
372
+ "vis_graph": True, # Whether to display the network visualization
373
+ "vmin": 0.0, # Minimum value for color scaling
374
+ "vmax": 600000, # Maximum value for color scaling
375
+ "edge_width": 2, # Width of network edges in visualization
376
+ "alpha": 0.8, # Transparency of network edges
377
+ "zoom": 16 # Zoom level for basemap
378
+ }
379
+
380
+ G, edge_gdf = get_network_values(
381
+ cum_solar_grid, # Grid of cumulative solar irradiance values
382
+ rectangle_vertices, # Coordinates defining simulation domain boundary
383
+ meshsize, # Size of each grid cell in meters
384
+ value_name='Cumulative Global Solar Irradiance (W/m²·hour)', # Label for values in visualization
385
+ **network_kwargs # Additional visualization and network parameters
386
+ )
387
+ ```
388
+
389
+ <p align="center">
390
+ <img src="https://raw.githubusercontent.com/kunifujiwara/VoxCity/main/images/network.png" alt="Example of Graph Output" width="500">
391
+ </p>
392
+ <p align="center">
393
+ <em>Cumulative Global Solar Irradiance (kW/m²·hour) on Road Network</em>
394
+ </p>
395
+
364
396
  ## References of Data Sources
365
397
 
366
398
  ### Building
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "voxcity"
3
- version = "0.3.5"
3
+ version = "0.3.7"
4
4
  requires-python = ">=3.10,<3.13"
5
5
  classifiers = [
6
6
  "Programming Language :: Python :: 3.10",
@@ -180,7 +180,8 @@ def get_network_values(grid, rectangle_vertices, meshsize, value_name='value', *
180
180
  vmin=settings['vmin'],
181
181
  vmax=settings['vmax'],
182
182
  linewidth=settings['edge_width'],
183
- legend_kwds={'label': value_name})
183
+ legend_kwds={'label': value_name,
184
+ 'shrink': 0.5}) # Make colorbar 50% smaller
184
185
 
185
186
  ctx.add_basemap(ax,
186
187
  source=settings['basemap_style'],
@@ -651,6 +651,8 @@ def get_global_solar_irradiance_using_epw(
651
651
  - calc_time (str): Time for instantaneous calculation ('MM-DD HH:MM:SS')
652
652
  - start_time (str): Start time for cumulative calculation
653
653
  - end_time (str): End time for cumulative calculation
654
+ - start_hour (int): Starting hour for daily time window (0-23)
655
+ - end_hour (int): Ending hour for daily time window (0-23)
654
656
  - view_point_height (float): Observer height in meters
655
657
  - tree_k (float): Tree extinction coefficient
656
658
  - tree_lad (float): Leaf area density in m^-1
@@ -675,11 +677,11 @@ def get_global_solar_irradiance_using_epw(
675
677
  return None
676
678
  else:
677
679
  # Calculate center point of rectangle
678
- lats = [coord[0] for coord in rectangle_vertices]
679
- lons = [coord[1] for coord in rectangle_vertices]
680
- center_lat = (min(lats) + max(lats)) / 2
680
+ lons = [coord[0] for coord in rectangle_vertices]
681
+ lats = [coord[1] for coord in rectangle_vertices]
681
682
  center_lon = (min(lons) + max(lons)) / 2
682
- target_point = (center_lat, center_lon)
683
+ center_lat = (min(lats) + max(lats)) / 2
684
+ target_point = (center_lon, center_lat)
683
685
 
684
686
  # Optional: specify maximum distance in kilometers
685
687
  max_distance = 100 # None for no limit
@@ -687,8 +689,8 @@ def get_global_solar_irradiance_using_epw(
687
689
  output_dir = kwargs.get("output_dir", "output")
688
690
 
689
691
  epw_file_path, weather_data, metadata = get_nearest_epw_from_climate_onebuilding(
690
- latitude=center_lat,
691
692
  longitude=center_lon,
693
+ latitude=center_lat,
692
694
  output_dir=output_dir,
693
695
  max_distance=max_distance,
694
696
  extract_zip=True,
@@ -743,10 +745,17 @@ def get_global_solar_irradiance_using_epw(
743
745
  **kwargs
744
746
  )
745
747
  if calc_type == 'cumulative':
748
+ # Get time window parameters
749
+ start_hour = kwargs.get("start_hour", 0) # Default to midnight
750
+ end_hour = kwargs.get("end_hour", 23) # Default to 11 PM
751
+
752
+ # Filter dataframe for specified hours
753
+ df_filtered = df[df.index.hour.between(start_hour, end_hour)]
754
+
746
755
  solar_map = get_cumulative_global_solar_irradiance(
747
756
  voxel_data,
748
757
  meshsize,
749
- df, lat, lon, tz,
758
+ df_filtered, lat, lon, tz,
750
759
  **kwargs
751
760
  )
752
761
 
@@ -512,8 +512,8 @@ def read_epw_for_solar_simulation(epw_file_path):
512
512
  month = int(vals[1])
513
513
  day = int(vals[2])
514
514
  hour = int(vals[3]) - 1
515
- dni = float(vals[13])
516
- dhi = float(vals[14])
515
+ dni = float(vals[14])
516
+ dhi = float(vals[15])
517
517
  timestamp = pd.Timestamp(year, month, day, hour)
518
518
  data.append([timestamp, dni, dhi])
519
519
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: voxcity
3
- Version: 0.3.5
3
+ Version: 0.3.7
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>
@@ -330,7 +330,7 @@ solar_kwargs = {
330
330
  }
331
331
 
332
332
  # Compute global solar irradiance map (direct + diffuse radiation)
333
- global_map = get_global_solar_irradiance_using_epw(
333
+ solar_grid = get_global_solar_irradiance_using_epw(
334
334
  voxcity_grid, # 3D voxel grid representing the urban environment
335
335
  meshsize, # Size of each voxel in meters
336
336
  calc_type='instantaneous', # Calculate instantaneous irradiance at specified time
@@ -345,7 +345,7 @@ solar_kwargs["end_time"] = "01-31 23:00:00" # End time for cumulative calculatio
345
345
  solar_kwargs["output_file_name"] = 'cummulative_solar_irradiance', # Base filename for outputs (without extension)
346
346
 
347
347
  # Calculate cumulative solar irradiance over the specified time period
348
- global_map = get_global_solar_irradiance_using_epw(
348
+ cum_solar_grid = get_global_solar_irradiance_using_epw(
349
349
  voxcity_grid, # 3D voxel grid representing the urban environment
350
350
  meshsize, # Size of each voxel in meters
351
351
  calc_type='cumulative', # Calculate cumulative irradiance over time period instead of instantaneous
@@ -418,6 +418,38 @@ landmark_vis_map = get_landmark_visibility_map(voxcity_grid, building_id_grid, b
418
418
  <em>Example Result Saved as OBJ and Rendered in Rhino</em>
419
419
  </p>
420
420
 
421
+ #### Network Analysis:
422
+
423
+ ```python
424
+ from voxcity.geo.network import get_network_values
425
+
426
+ network_kwargs = {
427
+ "network_type": "walk", # Type of network to download from OSM (walk, drive, all, etc.)
428
+ "colormap": "magma", # Matplotlib colormap for visualization
429
+ "vis_graph": True, # Whether to display the network visualization
430
+ "vmin": 0.0, # Minimum value for color scaling
431
+ "vmax": 600000, # Maximum value for color scaling
432
+ "edge_width": 2, # Width of network edges in visualization
433
+ "alpha": 0.8, # Transparency of network edges
434
+ "zoom": 16 # Zoom level for basemap
435
+ }
436
+
437
+ G, edge_gdf = get_network_values(
438
+ cum_solar_grid, # Grid of cumulative solar irradiance values
439
+ rectangle_vertices, # Coordinates defining simulation domain boundary
440
+ meshsize, # Size of each grid cell in meters
441
+ value_name='Cumulative Global Solar Irradiance (W/m²·hour)', # Label for values in visualization
442
+ **network_kwargs # Additional visualization and network parameters
443
+ )
444
+ ```
445
+
446
+ <p align="center">
447
+ <img src="https://raw.githubusercontent.com/kunifujiwara/VoxCity/main/images/network.png" alt="Example of Graph Output" width="500">
448
+ </p>
449
+ <p align="center">
450
+ <em>Cumulative Global Solar Irradiance (kW/m²·hour) on Road Network</em>
451
+ </p>
452
+
421
453
  ## References of Data Sources
422
454
 
423
455
  ### Building
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes