solweig-gpu 1.2.20__tar.gz → 1.2.22__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.
Files changed (43) hide show
  1. {solweig_gpu-1.2.20/solweig_gpu.egg-info → solweig_gpu-1.2.22}/PKG-INFO +52 -11
  2. {solweig_gpu-1.2.20 → solweig_gpu-1.2.22}/README.md +47 -9
  3. {solweig_gpu-1.2.20 → solweig_gpu-1.2.22}/setup.py +7 -2
  4. {solweig_gpu-1.2.20 → solweig_gpu-1.2.22}/solweig_gpu/__init__.py +1 -1
  5. {solweig_gpu-1.2.20 → solweig_gpu-1.2.22}/solweig_gpu/shadow.py +6 -2
  6. {solweig_gpu-1.2.20 → solweig_gpu-1.2.22}/solweig_gpu/solweig.py +9 -4
  7. {solweig_gpu-1.2.20 → solweig_gpu-1.2.22}/solweig_gpu/solweig_gpu.py +15 -15
  8. {solweig_gpu-1.2.20 → solweig_gpu-1.2.22/solweig_gpu.egg-info}/PKG-INFO +52 -11
  9. {solweig_gpu-1.2.20 → solweig_gpu-1.2.22}/solweig_gpu.egg-info/requires.txt +4 -1
  10. {solweig_gpu-1.2.20 → solweig_gpu-1.2.22}/LICENSE +0 -0
  11. {solweig_gpu-1.2.20 → solweig_gpu-1.2.22}/Logo.png +0 -0
  12. {solweig_gpu-1.2.20 → solweig_gpu-1.2.22}/MANIFEST.in +0 -0
  13. {solweig_gpu-1.2.20 → solweig_gpu-1.2.22}/UTCI_New_Delhi.jpeg +0 -0
  14. {solweig_gpu-1.2.20 → solweig_gpu-1.2.22}/pyproject.toml +0 -0
  15. {solweig_gpu-1.2.20 → solweig_gpu-1.2.22}/requirements.txt +0 -0
  16. {solweig_gpu-1.2.20 → solweig_gpu-1.2.22}/setup.cfg +0 -0
  17. {solweig_gpu-1.2.20 → solweig_gpu-1.2.22}/solweig_diagram.png +0 -0
  18. {solweig_gpu-1.2.20 → solweig_gpu-1.2.22}/solweig_gpu/Tgmaps_v1.py +0 -0
  19. {solweig_gpu-1.2.20 → solweig_gpu-1.2.22}/solweig_gpu/calculate_utci.py +0 -0
  20. {solweig_gpu-1.2.20 → solweig_gpu-1.2.22}/solweig_gpu/cli.py +0 -0
  21. {solweig_gpu-1.2.20 → solweig_gpu-1.2.22}/solweig_gpu/landcoverclasses_2016a.txt +0 -0
  22. {solweig_gpu-1.2.20 → solweig_gpu-1.2.22}/solweig_gpu/preprocessor.py +0 -0
  23. {solweig_gpu-1.2.20 → solweig_gpu-1.2.22}/solweig_gpu/solweig_gpu_gui.py +0 -0
  24. {solweig_gpu-1.2.20 → solweig_gpu-1.2.22}/solweig_gpu/sun_position.py +0 -0
  25. {solweig_gpu-1.2.20 → solweig_gpu-1.2.22}/solweig_gpu/utci_process.py +0 -0
  26. {solweig_gpu-1.2.20 → solweig_gpu-1.2.22}/solweig_gpu/walls_aspect.py +0 -0
  27. {solweig_gpu-1.2.20 → solweig_gpu-1.2.22}/solweig_gpu.egg-info/SOURCES.txt +0 -0
  28. {solweig_gpu-1.2.20 → solweig_gpu-1.2.22}/solweig_gpu.egg-info/dependency_links.txt +0 -0
  29. {solweig_gpu-1.2.20 → solweig_gpu-1.2.22}/solweig_gpu.egg-info/entry_points.txt +0 -0
  30. {solweig_gpu-1.2.20 → solweig_gpu-1.2.22}/solweig_gpu.egg-info/top_level.txt +0 -0
  31. {solweig_gpu-1.2.20 → solweig_gpu-1.2.22}/tests/__init__.py +0 -0
  32. {solweig_gpu-1.2.20 → solweig_gpu-1.2.22}/tests/conftest.py +0 -0
  33. {solweig_gpu-1.2.20 → solweig_gpu-1.2.22}/tests/test_calculate_utci.py +0 -0
  34. {solweig_gpu-1.2.20 → solweig_gpu-1.2.22}/tests/test_cli.py +0 -0
  35. {solweig_gpu-1.2.20 → solweig_gpu-1.2.22}/tests/test_era5_processing.py +0 -0
  36. {solweig_gpu-1.2.20 → solweig_gpu-1.2.22}/tests/test_gpu_smoke.py +0 -0
  37. {solweig_gpu-1.2.20 → solweig_gpu-1.2.22}/tests/test_integration.py +0 -0
  38. {solweig_gpu-1.2.20 → solweig_gpu-1.2.22}/tests/test_integration_end_to_end.py +0 -0
  39. {solweig_gpu-1.2.20 → solweig_gpu-1.2.22}/tests/test_preprocessor.py +0 -0
  40. {solweig_gpu-1.2.20 → solweig_gpu-1.2.22}/tests/test_sun_position.py +0 -0
  41. {solweig_gpu-1.2.20 → solweig_gpu-1.2.22}/tests/test_tiling_and_metfiles.py +0 -0
  42. {solweig_gpu-1.2.20 → solweig_gpu-1.2.22}/tests/test_walls_aspect.py +0 -0
  43. {solweig_gpu-1.2.20 → solweig_gpu-1.2.22}/tests/test_wrf_and_gui.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: solweig-gpu
3
- Version: 1.2.20
3
+ Version: 1.2.22
4
4
  Summary: GPU-accelerated SOLWEIG model for urban thermal comfort simulation
5
5
  Home-page: https://github.com/nvnsudharsan/SOLWEIG-GPU
6
6
  Author: Harsh Kamath, Naveen Sudharsan
@@ -22,11 +22,13 @@ Requires-Dist: netCDF4
22
22
  Requires-Dist: pytz
23
23
  Requires-Dist: shapely
24
24
  Requires-Dist: timezonefinder
25
- Requires-Dist: gdal
26
25
  Requires-Dist: xarray
27
26
  Requires-Dist: tqdm
28
27
  Requires-Dist: PyQt5
29
28
  Requires-Dist: matplotlib
29
+ Provides-Extra: test
30
+ Requires-Dist: pytest; extra == "test"
31
+ Requires-Dist: pytest-cov; extra == "test"
30
32
  Dynamic: author
31
33
  Dynamic: author-email
32
34
  Dynamic: classifier
@@ -35,6 +37,7 @@ Dynamic: description-content-type
35
37
  Dynamic: home-page
36
38
  Dynamic: license
37
39
  Dynamic: license-file
40
+ Dynamic: provides-extra
38
41
  Dynamic: requires-dist
39
42
  Dynamic: requires-python
40
43
  Dynamic: summary
@@ -50,7 +53,7 @@ Dynamic: summary
50
53
  <a href="https://www.repostatus.org/#active"><img src="https://img.shields.io/badge/Status-Active-%232ecc71.svg" alt="Project Status: Active"></a>
51
54
  <a href="https://pypi.org/project/solweig-gpu/"><img src="https://img.shields.io/pypi/v/solweig-gpu.svg?color=%230d6efd" alt="PyPI version"></a>
52
55
  <a href="https://solweig-gpu.readthedocs.io/en/latest/?badge=latest"><img src="https://img.shields.io/badge/docs-latest-%235bc0ff.svg" alt="Documentation Status"></a>
53
- <a href="https://doi.org/10.5281/zenodo.18283037"><img src="https://img.shields.io/badge/DOI-10.5281%2Fzenodo.18283037-%23ff6b6b.svg" alt="DOI"></a>
56
+ <a href="https://doi.org/10.5281/zenodo.18561860"><img src="https://img.shields.io/badge/DOI-10.5281%2Fzenodo.18561860-%23ff6b6b.svg" alt="DOI"></a>
54
57
  <a href="https://www.gnu.org/licenses/gpl-3.0"><img src="https://img.shields.io/badge/License-GPLv3-%230ab5b3.svg" alt="License: GPL v3"></a>
55
58
  <a href="https://pepy.tech/projects/solweig-gpu"><img src="https://static.pepy.tech/personalized-badge/solweig-gpu?period=total&units=INTERNATIONAL_SYSTEM&left_color=GRAY&right_color=GREEN&left_text=downloads" alt="PyPI Downloads"></a>
56
59
  <a href="https://joss.theoj.org/papers/27faa2bf5f6058d981df8b565f8e9a34"><img src="https://joss.theoj.org/papers/27faa2bf5f6058d981df8b565f8e9a34/status.svg"></a>
@@ -60,6 +63,8 @@ Dynamic: summary
60
63
 
61
64
  **SOLWEIG-GPU** is a Python package and command-line interface for running the standalone SOLWEIG (Solar and LongWave Environmental Irradiance Geometry) model on CPU or GPU (if available). It enables high-resolution urban microclimate modeling by computing key variables such as Sky View Factor (SVF), Mean Radiant Temperature (Tmrt), and the Universal Thermal Climate Index (UTCI).
62
65
 
66
+ **Cite this work as** Kamath, H. G., Sudharsan, N., Singh, M., Wallenberg, N., Lindberg, F., & Niyogi, D. (2026). SOLWEIG-GPU: GPU-Accelerated Thermal Comfort Modeling Framework for Urban Digital Twins. Journal of Open Source Software, 11(118), 9535. https://doi.org/10.21105/joss.09535
67
+
63
68
  **SOLWEIG** was originally developed by Dr. Fredrik Lindberg's group. Journal reference: Lindberg, F., Holmer, B. & Thorsson, S. SOLWEIG 1.0 – Modelling spatial variations of 3D radiant fluxes and mean radiant temperature in complex urban settings. *Int J Biometeorol* 52, 697–713 (2008). https://doi.org/10.1007/s00484-008-0162-7
64
69
 
65
70
  **SOLWEIG GPU** code is an extension of the original **SOLWEIG** Python model that is part of the Urban Multi-scale Environmental Predictor (UMEP). GitHub code: https://github.com/UMEP-dev/UMEP
@@ -107,11 +112,13 @@ For detailed documentation, see [Solweig-GPU Documentation](https://solweig-gpu.
107
112
 
108
113
  ## Output Details
109
114
 
110
- - Output directory: `Outputs/`
111
- - Structure: One folder per tile (e.g., `tile_0_0/`, `tile_0_600/`)
115
+ - Output directory: `output_folder/` (under the directory you pass as `base_path`)
116
+ - Structure: One folder per tile (e.g., `0_0/`, `1000_0/`)
112
117
  - SVF: Single-band raster
113
118
  - Other outputs: Multi-band raster (e.g., 24 bands for hourly results)
114
119
 
120
+ If you need outputs in a different folder, set `base_path` to that directory and pass **complete paths** for the rasters: `building_dsm_filename`, `dem_filename`, `trees_filename`, and `landcover_filename` (optional).
121
+
115
122
  ![UTCI for New Delhi](https://raw.githubusercontent.com/nvnsudharsan/solweig-gpu/main/UTCI_New_Delhi.jpeg)
116
123
  *UTCI for New Delhi, India, generated using SOLWEIG-GPU and visualized with ArcGIS Online.*
117
124
 
@@ -152,7 +159,7 @@ CI runs tests on Linux and macOS across Python 3.10–3.12.
152
159
 
153
160
  ## Sample Data
154
161
 
155
- Please refer to the sample dataset to familiarize yourself with the expected inputs. Sample data can be found at: <a href="https://doi.org/10.5281/zenodo.18283037"><img src="https://zenodo.org/badge/DOI/10.5281/zenodo.18283037.svg" alt="DOI"></a>
162
+ Please refer to the sample dataset to familiarize yourself with the expected inputs. Sample data can be found at: <a href="https://doi.org/10.5281/zenodo.18561860"><img src="https://zenodo.org/badge/DOI/10.5281/zenodo.18561860.svg" alt="DOI"></a>
156
163
 
157
164
  ---
158
165
 
@@ -210,9 +217,9 @@ thermal_comfort(
210
217
  )
211
218
  ```
212
219
  - The model simulation date is `2020-08-13`
213
- - The start and end dates provided to the model are `2020-08-13 06:00:00 UTC` and `2020-08-14 05:00:00 UTC`, respectively. These are start and end time of wrfout in UTC. In local time it is `2020-08-13 01:00:00` to `2020-08-13 23:00:00` (Austin, TX). UTC to local time conversion will be done internally.
214
- - The tile_size depends on the RAM of the GPU but can be set to 1000 in the example.
215
- - overlap is set to 100 pixels meaning the raster size will be 1100*1100 pixels. The additional 100 pixels are for shadow transfer between the tiles.
220
+ - The start and end dates provided to the model are `2020-08-13 06:00:00 UTC` and `2020-08-14 05:00:00 UTC`, respectively. These are the start and end times of wrfout in UTC. In local time, it is `2020-08-13 01:00:00` to `2020-08-13 23:00:00` (Austin, TX). UTC to local time conversion will be done internally.
221
+ - The tile_size depends on the RAM of the GPU, but can be set to 1000 in the example.
222
+ - overlap is set to 100 pixels, meaning the raster size will be 1100*1100 pixels. The additional 100 pixels are for shadow transfer between the tiles.
216
223
 
217
224
  #### Example 2: ERA5
218
225
 
@@ -275,7 +282,41 @@ thermal_comfort(
275
282
    save_shadow=False
276
283
  )
277
284
  ```
278
-
285
+ ### Note for Windows Users
286
+ On Windows, Python uses the *spawn* start method for new processes: each worker re-imports your script. Without guarding the entry point, a top-level call to `thermal_comfort()` would run again in every child process, causing repeated execution and failures (e.g. `BrokenProcessPool`). Always call `thermal_comfort()` inside a `main()` function and use `if __name__ == "__main__":` (see example below).
287
+ ```python
288
+ from solweig_gpu import thermal_comfort
289
+ import multiprocessing as mp
290
+
291
+ def main():
292
+ thermal_comfort(
293
+ base_path='/path/to/input',
294
+ selected_date_str="2020-08-13",
295
+ building_dsm_filename="Building_DSM.tif",
296
+ dem_filename="DEM.tif",
297
+ trees_filename="Trees.tif",
298
+ landcover_filename="Landcover.tif",
299
+ tile_size=1000,
300
+ overlap=100,
301
+ use_own_met=False,
302
+ own_met_file='/path/to/met.txt', # placeholder; ignored when use_own_met=False
303
+ start_time="2020-08-13 06:00:00",
304
+ end_time="2020-08-14 05:00:00",
305
+ data_source_type="era5",
306
+ data_folder='/path/to/era5_or_wrfout',
307
+ save_tmrt=False,
308
+ save_svf=False,
309
+ save_kup=False,
310
+ save_kdown=False,
311
+ save_lup=False,
312
+ save_ldown=False,
313
+ save_shadow=False,
314
+ )
315
+
316
+ if __name__ == "__main__":
317
+ mp.freeze_support()
318
+ main()
319
+ ```
279
320
  ---
280
321
 
281
322
  ## Command-Line Interface (CLI)
@@ -330,7 +371,7 @@ solweig_gpu_gui
330
371
  - If `wrfout`: Provide a folder with WRF output NetCDF files.
331
372
  5. Set the **start** and **end times** in UTC (`YYYY-MM-DD HH:MM:SS`).
332
373
  6. Choose which outputs to generate (e.g., Tmrt, UTCI, radiation fluxes).
333
- 7. Output will be saved in `Outputs/`, with subfolders for each tile.
374
+ 7. Output will be saved in `output_folder/`, with subfolders for each tile.
334
375
 
335
376
  ---
336
377
 
@@ -9,7 +9,7 @@
9
9
  <a href="https://www.repostatus.org/#active"><img src="https://img.shields.io/badge/Status-Active-%232ecc71.svg" alt="Project Status: Active"></a>
10
10
  <a href="https://pypi.org/project/solweig-gpu/"><img src="https://img.shields.io/pypi/v/solweig-gpu.svg?color=%230d6efd" alt="PyPI version"></a>
11
11
  <a href="https://solweig-gpu.readthedocs.io/en/latest/?badge=latest"><img src="https://img.shields.io/badge/docs-latest-%235bc0ff.svg" alt="Documentation Status"></a>
12
- <a href="https://doi.org/10.5281/zenodo.18283037"><img src="https://img.shields.io/badge/DOI-10.5281%2Fzenodo.18283037-%23ff6b6b.svg" alt="DOI"></a>
12
+ <a href="https://doi.org/10.5281/zenodo.18561860"><img src="https://img.shields.io/badge/DOI-10.5281%2Fzenodo.18561860-%23ff6b6b.svg" alt="DOI"></a>
13
13
  <a href="https://www.gnu.org/licenses/gpl-3.0"><img src="https://img.shields.io/badge/License-GPLv3-%230ab5b3.svg" alt="License: GPL v3"></a>
14
14
  <a href="https://pepy.tech/projects/solweig-gpu"><img src="https://static.pepy.tech/personalized-badge/solweig-gpu?period=total&units=INTERNATIONAL_SYSTEM&left_color=GRAY&right_color=GREEN&left_text=downloads" alt="PyPI Downloads"></a>
15
15
  <a href="https://joss.theoj.org/papers/27faa2bf5f6058d981df8b565f8e9a34"><img src="https://joss.theoj.org/papers/27faa2bf5f6058d981df8b565f8e9a34/status.svg"></a>
@@ -19,6 +19,8 @@
19
19
 
20
20
  **SOLWEIG-GPU** is a Python package and command-line interface for running the standalone SOLWEIG (Solar and LongWave Environmental Irradiance Geometry) model on CPU or GPU (if available). It enables high-resolution urban microclimate modeling by computing key variables such as Sky View Factor (SVF), Mean Radiant Temperature (Tmrt), and the Universal Thermal Climate Index (UTCI).
21
21
 
22
+ **Cite this work as** Kamath, H. G., Sudharsan, N., Singh, M., Wallenberg, N., Lindberg, F., & Niyogi, D. (2026). SOLWEIG-GPU: GPU-Accelerated Thermal Comfort Modeling Framework for Urban Digital Twins. Journal of Open Source Software, 11(118), 9535. https://doi.org/10.21105/joss.09535
23
+
22
24
  **SOLWEIG** was originally developed by Dr. Fredrik Lindberg's group. Journal reference: Lindberg, F., Holmer, B. & Thorsson, S. SOLWEIG 1.0 – Modelling spatial variations of 3D radiant fluxes and mean radiant temperature in complex urban settings. *Int J Biometeorol* 52, 697–713 (2008). https://doi.org/10.1007/s00484-008-0162-7
23
25
 
24
26
  **SOLWEIG GPU** code is an extension of the original **SOLWEIG** Python model that is part of the Urban Multi-scale Environmental Predictor (UMEP). GitHub code: https://github.com/UMEP-dev/UMEP
@@ -66,11 +68,13 @@ For detailed documentation, see [Solweig-GPU Documentation](https://solweig-gpu.
66
68
 
67
69
  ## Output Details
68
70
 
69
- - Output directory: `Outputs/`
70
- - Structure: One folder per tile (e.g., `tile_0_0/`, `tile_0_600/`)
71
+ - Output directory: `output_folder/` (under the directory you pass as `base_path`)
72
+ - Structure: One folder per tile (e.g., `0_0/`, `1000_0/`)
71
73
  - SVF: Single-band raster
72
74
  - Other outputs: Multi-band raster (e.g., 24 bands for hourly results)
73
75
 
76
+ If you need outputs in a different folder, set `base_path` to that directory and pass **complete paths** for the rasters: `building_dsm_filename`, `dem_filename`, `trees_filename`, and `landcover_filename` (optional).
77
+
74
78
  ![UTCI for New Delhi](https://raw.githubusercontent.com/nvnsudharsan/solweig-gpu/main/UTCI_New_Delhi.jpeg)
75
79
  *UTCI for New Delhi, India, generated using SOLWEIG-GPU and visualized with ArcGIS Online.*
76
80
 
@@ -111,7 +115,7 @@ CI runs tests on Linux and macOS across Python 3.10–3.12.
111
115
 
112
116
  ## Sample Data
113
117
 
114
- Please refer to the sample dataset to familiarize yourself with the expected inputs. Sample data can be found at: <a href="https://doi.org/10.5281/zenodo.18283037"><img src="https://zenodo.org/badge/DOI/10.5281/zenodo.18283037.svg" alt="DOI"></a>
118
+ Please refer to the sample dataset to familiarize yourself with the expected inputs. Sample data can be found at: <a href="https://doi.org/10.5281/zenodo.18561860"><img src="https://zenodo.org/badge/DOI/10.5281/zenodo.18561860.svg" alt="DOI"></a>
115
119
 
116
120
  ---
117
121
 
@@ -169,9 +173,9 @@ thermal_comfort(
169
173
  )
170
174
  ```
171
175
  - The model simulation date is `2020-08-13`
172
- - The start and end dates provided to the model are `2020-08-13 06:00:00 UTC` and `2020-08-14 05:00:00 UTC`, respectively. These are start and end time of wrfout in UTC. In local time it is `2020-08-13 01:00:00` to `2020-08-13 23:00:00` (Austin, TX). UTC to local time conversion will be done internally.
173
- - The tile_size depends on the RAM of the GPU but can be set to 1000 in the example.
174
- - overlap is set to 100 pixels meaning the raster size will be 1100*1100 pixels. The additional 100 pixels are for shadow transfer between the tiles.
176
+ - The start and end dates provided to the model are `2020-08-13 06:00:00 UTC` and `2020-08-14 05:00:00 UTC`, respectively. These are the start and end times of wrfout in UTC. In local time, it is `2020-08-13 01:00:00` to `2020-08-13 23:00:00` (Austin, TX). UTC to local time conversion will be done internally.
177
+ - The tile_size depends on the RAM of the GPU, but can be set to 1000 in the example.
178
+ - overlap is set to 100 pixels, meaning the raster size will be 1100*1100 pixels. The additional 100 pixels are for shadow transfer between the tiles.
175
179
 
176
180
  #### Example 2: ERA5
177
181
 
@@ -234,7 +238,41 @@ thermal_comfort(
234
238
    save_shadow=False
235
239
  )
236
240
  ```
237
-
241
+ ### Note for Windows Users
242
+ On Windows, Python uses the *spawn* start method for new processes: each worker re-imports your script. Without guarding the entry point, a top-level call to `thermal_comfort()` would run again in every child process, causing repeated execution and failures (e.g. `BrokenProcessPool`). Always call `thermal_comfort()` inside a `main()` function and use `if __name__ == "__main__":` (see example below).
243
+ ```python
244
+ from solweig_gpu import thermal_comfort
245
+ import multiprocessing as mp
246
+
247
+ def main():
248
+ thermal_comfort(
249
+ base_path='/path/to/input',
250
+ selected_date_str="2020-08-13",
251
+ building_dsm_filename="Building_DSM.tif",
252
+ dem_filename="DEM.tif",
253
+ trees_filename="Trees.tif",
254
+ landcover_filename="Landcover.tif",
255
+ tile_size=1000,
256
+ overlap=100,
257
+ use_own_met=False,
258
+ own_met_file='/path/to/met.txt', # placeholder; ignored when use_own_met=False
259
+ start_time="2020-08-13 06:00:00",
260
+ end_time="2020-08-14 05:00:00",
261
+ data_source_type="era5",
262
+ data_folder='/path/to/era5_or_wrfout',
263
+ save_tmrt=False,
264
+ save_svf=False,
265
+ save_kup=False,
266
+ save_kdown=False,
267
+ save_lup=False,
268
+ save_ldown=False,
269
+ save_shadow=False,
270
+ )
271
+
272
+ if __name__ == "__main__":
273
+ mp.freeze_support()
274
+ main()
275
+ ```
238
276
  ---
239
277
 
240
278
  ## Command-Line Interface (CLI)
@@ -289,7 +327,7 @@ solweig_gpu_gui
289
327
  - If `wrfout`: Provide a folder with WRF output NetCDF files.
290
328
  5. Set the **start** and **end times** in UTC (`YYYY-MM-DD HH:MM:SS`).
291
329
  6. Choose which outputs to generate (e.g., Tmrt, UTCI, radiation fluxes).
292
- 7. Output will be saved in `Outputs/`, with subfolders for each tile.
330
+ 7. Output will be saved in `output_folder/`, with subfolders for each tile.
293
331
 
294
332
  ---
295
333
 
@@ -18,7 +18,7 @@ long_description = (this_directory / "README.md").read_text(encoding="utf-8")
18
18
 
19
19
  setup(
20
20
  name="solweig-gpu",
21
- version="1.2.20",
21
+ version="1.2.22",
22
22
  description="GPU-accelerated SOLWEIG model for urban thermal comfort simulation",
23
23
  long_description=long_description,
24
24
  long_description_content_type='text/markdown',
@@ -39,12 +39,17 @@ setup(
39
39
  "pytz",
40
40
  "shapely",
41
41
  "timezonefinder",
42
- "gdal",
43
42
  "xarray",
44
43
  "tqdm",
45
44
  "PyQt5",
46
45
  "matplotlib"
47
46
  ],
47
+ extras_require={
48
+ "test": [
49
+ "pytest",
50
+ "pytest-cov",
51
+ ],
52
+ },
48
53
  license="GPL-3.0-only",
49
54
  classifiers=[
50
55
  "License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
@@ -11,5 +11,5 @@
11
11
  #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
12
  #GNU General Public License for more details.
13
13
 
14
- __version__ = "1.2.20"
14
+ __version__ = "1.2.22"
15
15
  from .solweig_gpu import thermal_comfort
@@ -102,8 +102,8 @@ def shadow(amaxvalue, a, vegdem, vegdem2, bush, azimuth, altitude, scale):
102
102
 
103
103
  f = a.clone()
104
104
  g = torch.zeros((sizex, sizey), device=device)
105
- bushplant = bush > 1.
106
- vegsh = torch.zeros((sizex, sizey), device=device) + bushplant.float()
105
+ bushplant = (bush > 1.).float()
106
+ vegsh = torch.zeros((sizex, sizey), device=device) + bushplant
107
107
 
108
108
  pibyfour = torch.pi / 4.
109
109
  threetimespibyfour = 3. * pibyfour
@@ -119,6 +119,10 @@ def shadow(amaxvalue, a, vegdem, vegdem2, bush, azimuth, altitude, scale):
119
119
  tanaltitudebyscale = torch.tan(altitude) / scale
120
120
 
121
121
  index = 1
122
+ fabovea = None
123
+ gabovea = None
124
+ vegsh2 = None
125
+
122
126
  while (amaxvalue >= dz and torch.abs(dx) < sizex and torch.abs(dy) < sizey):
123
127
  if (pibyfour <= azimuth < threetimespibyfour or fivetimespibyfour <= azimuth < seventimespibyfour):
124
128
  dy = signsinazimuth * index
@@ -1082,10 +1082,10 @@ def shadowingfunction_wallheight_23(a, vegdem, vegdem2, azimuth, altitude, scale
1082
1082
  tempvegdem2 = torch.zeros((sizex, sizey), device=device)
1083
1083
  templastfabovea = torch.zeros((sizex, sizey), device=device)
1084
1084
  templastgabovea = torch.zeros((sizex, sizey), device=device)
1085
- bushplant = bush > 1
1086
- sh = torch.zeros((sizex, sizey), device=device)
1087
- vbshvegsh = torch.zeros((sizex, sizey), device=device)
1088
- vegsh = torch.zeros((sizex, sizey), device=device) + bushplant.float()
1085
+ bushplant = (bush > 1).float()
1086
+ sh = torch.zeros((sizex, sizey), device=device)
1087
+ vbshvegsh = torch.zeros((sizex, sizey), device=device)
1088
+ vegsh = torch.zeros((sizex, sizey), device=device) + bushplant
1089
1089
  f = a
1090
1090
  shvoveg = vegdem
1091
1091
  wallbol = (walls > 0).float()
@@ -1105,6 +1105,11 @@ def shadowingfunction_wallheight_23(a, vegdem, vegdem2, azimuth, altitude, scale
1105
1105
 
1106
1106
  index = 0
1107
1107
  dzprev = torch.tensor(0.0, device=device)
1108
+ fabovea = None
1109
+ gabovea = None
1110
+ lastfabovea = None
1111
+ lastgabovea = None
1112
+ vegsh2 = None
1108
1113
 
1109
1114
  while (amaxvalue >= dz) and (torch.abs(dx) < sizex) and (torch.abs(dy) < sizey):
1110
1115
  if ((pibyfour <= azimuth) and (azimuth < threetimespibyfour)) or ((fivetimespibyfour <= azimuth) and (azimuth < seventimespibyfour)):
@@ -47,12 +47,12 @@ def thermal_comfort(
47
47
  6. Saves outputs as georeferenced rasters
48
48
 
49
49
  Args:
50
- base_path (str): Base directory containing input rasters
50
+ base_path (str): Base directory for output_folder/ and processed_inputs/; also used to resolve relative raster paths. For outputs elsewhere, set this to the desired output directory and pass complete paths for the raster arguments.
51
51
  selected_date_str (str): Simulation date in format 'YYYY-MM-DD'
52
- building_dsm_filename (str): Building+terrain DSM filename. Default: 'Building_DSM.tif'
53
- dem_filename (str): Digital Elevation Model filename. Default: 'DEM.tif'
54
- trees_filename (str): Vegetation DSM filename. Default: 'Trees.tif'
55
- landcover_filename (str, optional): Land cover raster filename. Default: None
52
+ building_dsm_filename (str): Building+terrain DSM path or filename (relative to base_path). Default: 'Building_DSM.tif'. Can be a complete path if rasters live elsewhere.
53
+ dem_filename (str): DEM path or filename (relative to base_path). Default: 'DEM.tif'
54
+ trees_filename (str): Vegetation DSM path or filename (relative to base_path). Default: 'Trees.tif'
55
+ landcover_filename (str, optional): Land cover raster path or filename. Default: None
56
56
  tile_size (int): Tile size in pixels. Default: 3600. Adjust based on GPU RAM.
57
57
  overlap (int): Overlap between tiles in pixels. Default: 20. Used for shadow transfer.
58
58
  use_own_met (bool): Use custom meteorological file. Default: True
@@ -70,7 +70,7 @@ def thermal_comfort(
70
70
  save_shadow (bool): Save shadow maps. Default: False
71
71
 
72
72
  Returns:
73
- None: Outputs are saved to `{base_path}/Outputs/` directory
73
+ None: Outputs are saved to `{base_path}/output_folder/` directory
74
74
 
75
75
  Output Structure:
76
76
  - {base_path}/processed_inputs/ - All preprocessing files
@@ -81,15 +81,15 @@ def thermal_comfort(
81
81
  - walls/ - Wall height rasters
82
82
  - aspect/ - Wall aspect rasters
83
83
  - Outfile.nc - Processed NetCDF (if using ERA5/WRF)
84
- - Outputs/{tile_key}/ - One folder per tile
85
- - UTCI_{date}.tif - Universal Thermal Climate Index (always saved)
86
- - Tmrt_{date}.tif - Mean radiant temperature (if save_tmrt=True)
87
- - SVF.tif - Sky view factor (if save_svf=True)
88
- - Kup_{date}.tif - Upward shortwave (if save_kup=True)
89
- - Kdown_{date}.tif - Downward shortwave (if save_kdown=True)
90
- - Lup_{date}.tif - Upward longwave (if save_lup=True)
91
- - Ldown_{date}.tif - Downward longwave (if save_ldown=True)
92
- - Shadow_{date}.tif - Shadow maps (if save_shadow=True)
84
+ - output_folder/{tile_key}/ - One folder per tile (tile_key e.g. "0_0", "1000_0")
85
+ - UTCI_{tile_key}.tif - Universal Thermal Climate Index (always saved)
86
+ - TMRT_{tile_key}.tif - Mean radiant temperature (if save_tmrt=True)
87
+ - SVF_{tile_key}.tif - Sky view factor (if save_svf=True)
88
+ - Kup_{tile_key}.tif - Upward shortwave (if save_kup=True)
89
+ - Kdown_{tile_key}.tif - Downward shortwave (if save_kdown=True)
90
+ - Lup_{tile_key}.tif - Upward longwave (if save_lup=True)
91
+ - Ldown_{tile_key}.tif - Downward longwave (if save_ldown=True)
92
+ - Shadow_{tile_key}.tif - Shadow maps (if save_shadow=True)
93
93
 
94
94
  Notes:
95
95
  - Automatically uses GPU if available, falls back to CPU
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: solweig-gpu
3
- Version: 1.2.20
3
+ Version: 1.2.22
4
4
  Summary: GPU-accelerated SOLWEIG model for urban thermal comfort simulation
5
5
  Home-page: https://github.com/nvnsudharsan/SOLWEIG-GPU
6
6
  Author: Harsh Kamath, Naveen Sudharsan
@@ -22,11 +22,13 @@ Requires-Dist: netCDF4
22
22
  Requires-Dist: pytz
23
23
  Requires-Dist: shapely
24
24
  Requires-Dist: timezonefinder
25
- Requires-Dist: gdal
26
25
  Requires-Dist: xarray
27
26
  Requires-Dist: tqdm
28
27
  Requires-Dist: PyQt5
29
28
  Requires-Dist: matplotlib
29
+ Provides-Extra: test
30
+ Requires-Dist: pytest; extra == "test"
31
+ Requires-Dist: pytest-cov; extra == "test"
30
32
  Dynamic: author
31
33
  Dynamic: author-email
32
34
  Dynamic: classifier
@@ -35,6 +37,7 @@ Dynamic: description-content-type
35
37
  Dynamic: home-page
36
38
  Dynamic: license
37
39
  Dynamic: license-file
40
+ Dynamic: provides-extra
38
41
  Dynamic: requires-dist
39
42
  Dynamic: requires-python
40
43
  Dynamic: summary
@@ -50,7 +53,7 @@ Dynamic: summary
50
53
  <a href="https://www.repostatus.org/#active"><img src="https://img.shields.io/badge/Status-Active-%232ecc71.svg" alt="Project Status: Active"></a>
51
54
  <a href="https://pypi.org/project/solweig-gpu/"><img src="https://img.shields.io/pypi/v/solweig-gpu.svg?color=%230d6efd" alt="PyPI version"></a>
52
55
  <a href="https://solweig-gpu.readthedocs.io/en/latest/?badge=latest"><img src="https://img.shields.io/badge/docs-latest-%235bc0ff.svg" alt="Documentation Status"></a>
53
- <a href="https://doi.org/10.5281/zenodo.18283037"><img src="https://img.shields.io/badge/DOI-10.5281%2Fzenodo.18283037-%23ff6b6b.svg" alt="DOI"></a>
56
+ <a href="https://doi.org/10.5281/zenodo.18561860"><img src="https://img.shields.io/badge/DOI-10.5281%2Fzenodo.18561860-%23ff6b6b.svg" alt="DOI"></a>
54
57
  <a href="https://www.gnu.org/licenses/gpl-3.0"><img src="https://img.shields.io/badge/License-GPLv3-%230ab5b3.svg" alt="License: GPL v3"></a>
55
58
  <a href="https://pepy.tech/projects/solweig-gpu"><img src="https://static.pepy.tech/personalized-badge/solweig-gpu?period=total&units=INTERNATIONAL_SYSTEM&left_color=GRAY&right_color=GREEN&left_text=downloads" alt="PyPI Downloads"></a>
56
59
  <a href="https://joss.theoj.org/papers/27faa2bf5f6058d981df8b565f8e9a34"><img src="https://joss.theoj.org/papers/27faa2bf5f6058d981df8b565f8e9a34/status.svg"></a>
@@ -60,6 +63,8 @@ Dynamic: summary
60
63
 
61
64
  **SOLWEIG-GPU** is a Python package and command-line interface for running the standalone SOLWEIG (Solar and LongWave Environmental Irradiance Geometry) model on CPU or GPU (if available). It enables high-resolution urban microclimate modeling by computing key variables such as Sky View Factor (SVF), Mean Radiant Temperature (Tmrt), and the Universal Thermal Climate Index (UTCI).
62
65
 
66
+ **Cite this work as** Kamath, H. G., Sudharsan, N., Singh, M., Wallenberg, N., Lindberg, F., & Niyogi, D. (2026). SOLWEIG-GPU: GPU-Accelerated Thermal Comfort Modeling Framework for Urban Digital Twins. Journal of Open Source Software, 11(118), 9535. https://doi.org/10.21105/joss.09535
67
+
63
68
  **SOLWEIG** was originally developed by Dr. Fredrik Lindberg's group. Journal reference: Lindberg, F., Holmer, B. & Thorsson, S. SOLWEIG 1.0 – Modelling spatial variations of 3D radiant fluxes and mean radiant temperature in complex urban settings. *Int J Biometeorol* 52, 697–713 (2008). https://doi.org/10.1007/s00484-008-0162-7
64
69
 
65
70
  **SOLWEIG GPU** code is an extension of the original **SOLWEIG** Python model that is part of the Urban Multi-scale Environmental Predictor (UMEP). GitHub code: https://github.com/UMEP-dev/UMEP
@@ -107,11 +112,13 @@ For detailed documentation, see [Solweig-GPU Documentation](https://solweig-gpu.
107
112
 
108
113
  ## Output Details
109
114
 
110
- - Output directory: `Outputs/`
111
- - Structure: One folder per tile (e.g., `tile_0_0/`, `tile_0_600/`)
115
+ - Output directory: `output_folder/` (under the directory you pass as `base_path`)
116
+ - Structure: One folder per tile (e.g., `0_0/`, `1000_0/`)
112
117
  - SVF: Single-band raster
113
118
  - Other outputs: Multi-band raster (e.g., 24 bands for hourly results)
114
119
 
120
+ If you need outputs in a different folder, set `base_path` to that directory and pass **complete paths** for the rasters: `building_dsm_filename`, `dem_filename`, `trees_filename`, and `landcover_filename` (optional).
121
+
115
122
  ![UTCI for New Delhi](https://raw.githubusercontent.com/nvnsudharsan/solweig-gpu/main/UTCI_New_Delhi.jpeg)
116
123
  *UTCI for New Delhi, India, generated using SOLWEIG-GPU and visualized with ArcGIS Online.*
117
124
 
@@ -152,7 +159,7 @@ CI runs tests on Linux and macOS across Python 3.10–3.12.
152
159
 
153
160
  ## Sample Data
154
161
 
155
- Please refer to the sample dataset to familiarize yourself with the expected inputs. Sample data can be found at: <a href="https://doi.org/10.5281/zenodo.18283037"><img src="https://zenodo.org/badge/DOI/10.5281/zenodo.18283037.svg" alt="DOI"></a>
162
+ Please refer to the sample dataset to familiarize yourself with the expected inputs. Sample data can be found at: <a href="https://doi.org/10.5281/zenodo.18561860"><img src="https://zenodo.org/badge/DOI/10.5281/zenodo.18561860.svg" alt="DOI"></a>
156
163
 
157
164
  ---
158
165
 
@@ -210,9 +217,9 @@ thermal_comfort(
210
217
  )
211
218
  ```
212
219
  - The model simulation date is `2020-08-13`
213
- - The start and end dates provided to the model are `2020-08-13 06:00:00 UTC` and `2020-08-14 05:00:00 UTC`, respectively. These are start and end time of wrfout in UTC. In local time it is `2020-08-13 01:00:00` to `2020-08-13 23:00:00` (Austin, TX). UTC to local time conversion will be done internally.
214
- - The tile_size depends on the RAM of the GPU but can be set to 1000 in the example.
215
- - overlap is set to 100 pixels meaning the raster size will be 1100*1100 pixels. The additional 100 pixels are for shadow transfer between the tiles.
220
+ - The start and end dates provided to the model are `2020-08-13 06:00:00 UTC` and `2020-08-14 05:00:00 UTC`, respectively. These are the start and end times of wrfout in UTC. In local time, it is `2020-08-13 01:00:00` to `2020-08-13 23:00:00` (Austin, TX). UTC to local time conversion will be done internally.
221
+ - The tile_size depends on the RAM of the GPU, but can be set to 1000 in the example.
222
+ - overlap is set to 100 pixels, meaning the raster size will be 1100*1100 pixels. The additional 100 pixels are for shadow transfer between the tiles.
216
223
 
217
224
  #### Example 2: ERA5
218
225
 
@@ -275,7 +282,41 @@ thermal_comfort(
275
282
    save_shadow=False
276
283
  )
277
284
  ```
278
-
285
+ ### Note for Windows Users
286
+ On Windows, Python uses the *spawn* start method for new processes: each worker re-imports your script. Without guarding the entry point, a top-level call to `thermal_comfort()` would run again in every child process, causing repeated execution and failures (e.g. `BrokenProcessPool`). Always call `thermal_comfort()` inside a `main()` function and use `if __name__ == "__main__":` (see example below).
287
+ ```python
288
+ from solweig_gpu import thermal_comfort
289
+ import multiprocessing as mp
290
+
291
+ def main():
292
+ thermal_comfort(
293
+ base_path='/path/to/input',
294
+ selected_date_str="2020-08-13",
295
+ building_dsm_filename="Building_DSM.tif",
296
+ dem_filename="DEM.tif",
297
+ trees_filename="Trees.tif",
298
+ landcover_filename="Landcover.tif",
299
+ tile_size=1000,
300
+ overlap=100,
301
+ use_own_met=False,
302
+ own_met_file='/path/to/met.txt', # placeholder; ignored when use_own_met=False
303
+ start_time="2020-08-13 06:00:00",
304
+ end_time="2020-08-14 05:00:00",
305
+ data_source_type="era5",
306
+ data_folder='/path/to/era5_or_wrfout',
307
+ save_tmrt=False,
308
+ save_svf=False,
309
+ save_kup=False,
310
+ save_kdown=False,
311
+ save_lup=False,
312
+ save_ldown=False,
313
+ save_shadow=False,
314
+ )
315
+
316
+ if __name__ == "__main__":
317
+ mp.freeze_support()
318
+ main()
319
+ ```
279
320
  ---
280
321
 
281
322
  ## Command-Line Interface (CLI)
@@ -330,7 +371,7 @@ solweig_gpu_gui
330
371
  - If `wrfout`: Provide a folder with WRF output NetCDF files.
331
372
  5. Set the **start** and **end times** in UTC (`YYYY-MM-DD HH:MM:SS`).
332
373
  6. Choose which outputs to generate (e.g., Tmrt, UTCI, radiation fluxes).
333
- 7. Output will be saved in `Outputs/`, with subfolders for each tile.
374
+ 7. Output will be saved in `output_folder/`, with subfolders for each tile.
334
375
 
335
376
  ---
336
377
 
@@ -6,8 +6,11 @@ netCDF4
6
6
  pytz
7
7
  shapely
8
8
  timezonefinder
9
- gdal
10
9
  xarray
11
10
  tqdm
12
11
  PyQt5
13
12
  matplotlib
13
+
14
+ [test]
15
+ pytest
16
+ pytest-cov
File without changes
File without changes
File without changes
File without changes