voxcity 0.7.0__py3-none-any.whl → 1.0.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.
- voxcity/__init__.py +14 -14
- voxcity/downloader/ocean.py +559 -0
- voxcity/exporter/__init__.py +12 -12
- voxcity/exporter/cityles.py +633 -633
- voxcity/exporter/envimet.py +733 -728
- voxcity/exporter/magicavoxel.py +333 -333
- voxcity/exporter/netcdf.py +238 -238
- voxcity/exporter/obj.py +1480 -1480
- voxcity/generator/__init__.py +47 -44
- voxcity/generator/api.py +727 -675
- voxcity/generator/grids.py +394 -379
- voxcity/generator/io.py +94 -94
- voxcity/generator/pipeline.py +582 -282
- voxcity/generator/update.py +429 -0
- voxcity/generator/voxelizer.py +18 -6
- voxcity/geoprocessor/__init__.py +75 -75
- voxcity/geoprocessor/draw.py +1494 -1219
- voxcity/geoprocessor/merge_utils.py +91 -91
- voxcity/geoprocessor/mesh.py +806 -806
- voxcity/geoprocessor/network.py +708 -708
- voxcity/geoprocessor/raster/__init__.py +2 -0
- voxcity/geoprocessor/raster/buildings.py +435 -428
- voxcity/geoprocessor/raster/core.py +31 -0
- voxcity/geoprocessor/raster/export.py +93 -93
- voxcity/geoprocessor/raster/landcover.py +178 -51
- voxcity/geoprocessor/raster/raster.py +1 -1
- voxcity/geoprocessor/utils.py +824 -824
- voxcity/models.py +115 -113
- voxcity/simulator/solar/__init__.py +66 -43
- voxcity/simulator/solar/integration.py +336 -336
- voxcity/simulator/solar/sky.py +668 -0
- voxcity/simulator/solar/temporal.py +792 -434
- voxcity/simulator_gpu/__init__.py +115 -0
- voxcity/simulator_gpu/common/__init__.py +9 -0
- voxcity/simulator_gpu/common/geometry.py +11 -0
- voxcity/simulator_gpu/core.py +322 -0
- voxcity/simulator_gpu/domain.py +262 -0
- voxcity/simulator_gpu/environment.yml +11 -0
- voxcity/simulator_gpu/init_taichi.py +154 -0
- voxcity/simulator_gpu/integration.py +15 -0
- voxcity/simulator_gpu/kernels.py +56 -0
- voxcity/simulator_gpu/radiation.py +28 -0
- voxcity/simulator_gpu/raytracing.py +623 -0
- voxcity/simulator_gpu/sky.py +9 -0
- voxcity/simulator_gpu/solar/__init__.py +178 -0
- voxcity/simulator_gpu/solar/core.py +66 -0
- voxcity/simulator_gpu/solar/csf.py +1249 -0
- voxcity/simulator_gpu/solar/domain.py +561 -0
- voxcity/simulator_gpu/solar/epw.py +421 -0
- voxcity/simulator_gpu/solar/integration.py +2953 -0
- voxcity/simulator_gpu/solar/radiation.py +3019 -0
- voxcity/simulator_gpu/solar/raytracing.py +686 -0
- voxcity/simulator_gpu/solar/reflection.py +533 -0
- voxcity/simulator_gpu/solar/sky.py +907 -0
- voxcity/simulator_gpu/solar/solar.py +337 -0
- voxcity/simulator_gpu/solar/svf.py +446 -0
- voxcity/simulator_gpu/solar/volumetric.py +1151 -0
- voxcity/simulator_gpu/solar/voxcity.py +2953 -0
- voxcity/simulator_gpu/temporal.py +13 -0
- voxcity/simulator_gpu/utils.py +25 -0
- voxcity/simulator_gpu/view.py +32 -0
- voxcity/simulator_gpu/visibility/__init__.py +109 -0
- voxcity/simulator_gpu/visibility/geometry.py +278 -0
- voxcity/simulator_gpu/visibility/integration.py +808 -0
- voxcity/simulator_gpu/visibility/landmark.py +753 -0
- voxcity/simulator_gpu/visibility/view.py +944 -0
- voxcity/utils/__init__.py +11 -0
- voxcity/utils/classes.py +194 -0
- voxcity/utils/lc.py +80 -39
- voxcity/utils/shape.py +230 -0
- voxcity/visualizer/__init__.py +24 -24
- voxcity/visualizer/builder.py +43 -43
- voxcity/visualizer/grids.py +141 -141
- voxcity/visualizer/maps.py +187 -187
- voxcity/visualizer/renderer.py +1146 -928
- {voxcity-0.7.0.dist-info → voxcity-1.0.13.dist-info}/METADATA +56 -52
- voxcity-1.0.13.dist-info/RECORD +116 -0
- voxcity-0.7.0.dist-info/RECORD +0 -77
- {voxcity-0.7.0.dist-info → voxcity-1.0.13.dist-info}/WHEEL +0 -0
- {voxcity-0.7.0.dist-info → voxcity-1.0.13.dist-info}/licenses/AUTHORS.rst +0 -0
- {voxcity-0.7.0.dist-info → voxcity-1.0.13.dist-info}/licenses/LICENSE +0 -0
voxcity/models.py
CHANGED
|
@@ -1,113 +1,115 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
from dataclasses import dataclass, field
|
|
4
|
-
from typing import Tuple, Optional, Dict, Any
|
|
5
|
-
|
|
6
|
-
import numpy as np
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
@dataclass
|
|
10
|
-
class GridMetadata:
|
|
11
|
-
crs: str
|
|
12
|
-
bounds: Tuple[float, float, float, float]
|
|
13
|
-
meshsize: float
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
@dataclass
|
|
17
|
-
class BuildingGrid:
|
|
18
|
-
heights: np.ndarray
|
|
19
|
-
min_heights: np.ndarray # object-dtype array of lists per cell
|
|
20
|
-
ids: np.ndarray
|
|
21
|
-
meta: GridMetadata
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
@dataclass
|
|
25
|
-
class LandCoverGrid:
|
|
26
|
-
classes: np.ndarray
|
|
27
|
-
meta: GridMetadata
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
@dataclass
|
|
31
|
-
class DemGrid:
|
|
32
|
-
elevation: np.ndarray
|
|
33
|
-
meta: GridMetadata
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
@dataclass
|
|
37
|
-
class VoxelGrid:
|
|
38
|
-
classes: np.ndarray
|
|
39
|
-
meta: GridMetadata
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
@dataclass
|
|
43
|
-
class CanopyGrid:
|
|
44
|
-
top: np.ndarray
|
|
45
|
-
meta: GridMetadata
|
|
46
|
-
bottom: Optional[np.ndarray] = None
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
@dataclass
|
|
50
|
-
class VoxCity:
|
|
51
|
-
voxels: VoxelGrid
|
|
52
|
-
buildings: BuildingGrid
|
|
53
|
-
land_cover: LandCoverGrid
|
|
54
|
-
dem: DemGrid
|
|
55
|
-
tree_canopy: CanopyGrid
|
|
56
|
-
extras: Dict[str, Any] = field(default_factory=dict)
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
@dataclass
|
|
60
|
-
class PipelineConfig:
|
|
61
|
-
rectangle_vertices: Any
|
|
62
|
-
meshsize: float
|
|
63
|
-
building_source: Optional[str] = None
|
|
64
|
-
land_cover_source: Optional[str] = None
|
|
65
|
-
canopy_height_source: Optional[str] = None
|
|
66
|
-
dem_source: Optional[str] = None
|
|
67
|
-
output_dir: str = "output"
|
|
68
|
-
trunk_height_ratio: Optional[float] = None
|
|
69
|
-
static_tree_height: Optional[float] = None
|
|
70
|
-
remove_perimeter_object: Optional[float] = None
|
|
71
|
-
mapvis: bool = False
|
|
72
|
-
gridvis: bool = True
|
|
73
|
-
#
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
# -----------------------------
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from dataclasses import dataclass, field
|
|
4
|
+
from typing import Tuple, Optional, Dict, Any
|
|
5
|
+
|
|
6
|
+
import numpy as np
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
@dataclass
|
|
10
|
+
class GridMetadata:
|
|
11
|
+
crs: str
|
|
12
|
+
bounds: Tuple[float, float, float, float]
|
|
13
|
+
meshsize: float
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
@dataclass
|
|
17
|
+
class BuildingGrid:
|
|
18
|
+
heights: np.ndarray
|
|
19
|
+
min_heights: np.ndarray # object-dtype array of lists per cell
|
|
20
|
+
ids: np.ndarray
|
|
21
|
+
meta: GridMetadata
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
@dataclass
|
|
25
|
+
class LandCoverGrid:
|
|
26
|
+
classes: np.ndarray
|
|
27
|
+
meta: GridMetadata
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
@dataclass
|
|
31
|
+
class DemGrid:
|
|
32
|
+
elevation: np.ndarray
|
|
33
|
+
meta: GridMetadata
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
@dataclass
|
|
37
|
+
class VoxelGrid:
|
|
38
|
+
classes: np.ndarray
|
|
39
|
+
meta: GridMetadata
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
@dataclass
|
|
43
|
+
class CanopyGrid:
|
|
44
|
+
top: np.ndarray
|
|
45
|
+
meta: GridMetadata
|
|
46
|
+
bottom: Optional[np.ndarray] = None
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
@dataclass
|
|
50
|
+
class VoxCity:
|
|
51
|
+
voxels: VoxelGrid
|
|
52
|
+
buildings: BuildingGrid
|
|
53
|
+
land_cover: LandCoverGrid
|
|
54
|
+
dem: DemGrid
|
|
55
|
+
tree_canopy: CanopyGrid
|
|
56
|
+
extras: Dict[str, Any] = field(default_factory=dict)
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
@dataclass
|
|
60
|
+
class PipelineConfig:
|
|
61
|
+
rectangle_vertices: Any
|
|
62
|
+
meshsize: float
|
|
63
|
+
building_source: Optional[str] = None
|
|
64
|
+
land_cover_source: Optional[str] = None
|
|
65
|
+
canopy_height_source: Optional[str] = None
|
|
66
|
+
dem_source: Optional[str] = None
|
|
67
|
+
output_dir: str = "output"
|
|
68
|
+
trunk_height_ratio: Optional[float] = None
|
|
69
|
+
static_tree_height: Optional[float] = None
|
|
70
|
+
remove_perimeter_object: Optional[float] = None
|
|
71
|
+
mapvis: bool = False
|
|
72
|
+
gridvis: bool = True
|
|
73
|
+
# Parallel download mode: if True, downloads run concurrently using ThreadPoolExecutor
|
|
74
|
+
parallel_download: bool = False
|
|
75
|
+
# Structured options for strategies and I/O/visualization
|
|
76
|
+
land_cover_options: Dict[str, Any] = field(default_factory=dict)
|
|
77
|
+
building_options: Dict[str, Any] = field(default_factory=dict)
|
|
78
|
+
canopy_options: Dict[str, Any] = field(default_factory=dict)
|
|
79
|
+
dem_options: Dict[str, Any] = field(default_factory=dict)
|
|
80
|
+
io_options: Dict[str, Any] = field(default_factory=dict)
|
|
81
|
+
visualize_options: Dict[str, Any] = field(default_factory=dict)
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
# -----------------------------
|
|
85
|
+
# Mesh data structures
|
|
86
|
+
# -----------------------------
|
|
87
|
+
|
|
88
|
+
@dataclass
|
|
89
|
+
class MeshModel:
|
|
90
|
+
vertices: np.ndarray # (N, 3) float
|
|
91
|
+
faces: np.ndarray # (M, 3|4) int
|
|
92
|
+
colors: Optional[np.ndarray] = None # (M, 4) uint8 or None
|
|
93
|
+
name: Optional[str] = None
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
@dataclass
|
|
97
|
+
class MeshCollection:
|
|
98
|
+
"""Container for named meshes with simple add/access helpers."""
|
|
99
|
+
meshes: Dict[str, MeshModel] = field(default_factory=dict)
|
|
100
|
+
|
|
101
|
+
def add(self, name: str, mesh: MeshModel) -> None:
|
|
102
|
+
self.meshes[name] = mesh
|
|
103
|
+
|
|
104
|
+
def get(self, name: str) -> Optional[MeshModel]:
|
|
105
|
+
return self.meshes.get(name)
|
|
106
|
+
|
|
107
|
+
def __iter__(self):
|
|
108
|
+
return iter(self.meshes.items())
|
|
109
|
+
|
|
110
|
+
# Compatibility: some renderers expect `collection.items.items()`
|
|
111
|
+
@property
|
|
112
|
+
def items(self) -> Dict[str, MeshModel]:
|
|
113
|
+
return self.meshes
|
|
114
|
+
|
|
115
|
+
|
|
@@ -1,43 +1,66 @@
|
|
|
1
|
-
"""
|
|
2
|
-
Solar Irradiance Simulation Package
|
|
3
|
-
|
|
4
|
-
Public API exports for the refactored solar simulator. The implementation
|
|
5
|
-
is decomposed into focused stages:
|
|
6
|
-
1) kernels.py - Low-level kernels for visibility/irradiance
|
|
7
|
-
2) radiation.py - Physics: convert geometry to irradiance
|
|
8
|
-
3) temporal.py - Time-series integration and solar position
|
|
9
|
-
4) integration.py- High-level workflows and I/O
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
#
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
1
|
+
"""
|
|
2
|
+
Solar Irradiance Simulation Package
|
|
3
|
+
|
|
4
|
+
Public API exports for the refactored solar simulator. The implementation
|
|
5
|
+
is decomposed into focused stages:
|
|
6
|
+
1) kernels.py - Low-level kernels for visibility/irradiance
|
|
7
|
+
2) radiation.py - Physics: convert geometry to irradiance
|
|
8
|
+
3) temporal.py - Time-series integration and solar position
|
|
9
|
+
4) integration.py- High-level workflows and I/O
|
|
10
|
+
5) sky.py - Sky hemisphere discretization methods
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
# Stage 1: Kernels / Solar position
|
|
14
|
+
from .kernels import ( # noqa: F401
|
|
15
|
+
compute_direct_solar_irradiance_map_binary,
|
|
16
|
+
)
|
|
17
|
+
from .temporal import ( # noqa: F401
|
|
18
|
+
get_solar_positions_astral,
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
# Sky discretization methods
|
|
22
|
+
from .sky import ( # noqa: F401
|
|
23
|
+
# Tregenza (145 patches)
|
|
24
|
+
generate_tregenza_patches,
|
|
25
|
+
get_tregenza_patch_index,
|
|
26
|
+
get_tregenza_patch_index_fast,
|
|
27
|
+
TREGENZA_BANDS,
|
|
28
|
+
TREGENZA_BAND_BOUNDARIES,
|
|
29
|
+
# Reinhart (subdivided Tregenza)
|
|
30
|
+
generate_reinhart_patches,
|
|
31
|
+
# Uniform grid
|
|
32
|
+
generate_uniform_grid_patches,
|
|
33
|
+
# Fibonacci spiral
|
|
34
|
+
generate_fibonacci_patches,
|
|
35
|
+
# Sun position binning
|
|
36
|
+
bin_sun_positions_to_patches,
|
|
37
|
+
bin_sun_positions_to_tregenza_fast,
|
|
38
|
+
# Utilities
|
|
39
|
+
get_patch_info,
|
|
40
|
+
visualize_sky_patches,
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
# Stage 2: Radiation
|
|
44
|
+
from .radiation import ( # noqa: F401
|
|
45
|
+
get_direct_solar_irradiance_map,
|
|
46
|
+
get_diffuse_solar_irradiance_map,
|
|
47
|
+
get_global_solar_irradiance_map,
|
|
48
|
+
compute_solar_irradiance_for_all_faces,
|
|
49
|
+
get_building_solar_irradiance,
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
# Stage 3: Temporal
|
|
53
|
+
from .temporal import ( # noqa: F401
|
|
54
|
+
get_cumulative_global_solar_irradiance,
|
|
55
|
+
get_cumulative_building_solar_irradiance,
|
|
56
|
+
_configure_num_threads,
|
|
57
|
+
_auto_time_batch_size,
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
# Stage 4: Integration
|
|
61
|
+
from .integration import ( # noqa: F401
|
|
62
|
+
get_global_solar_irradiance_using_epw,
|
|
63
|
+
get_building_global_solar_irradiance_using_epw,
|
|
64
|
+
save_irradiance_mesh,
|
|
65
|
+
load_irradiance_mesh,
|
|
66
|
+
)
|