voxcity.utils.weather

Weather utilities subpackage.

Public API: - safe_rename, safe_extract - process_epw, read_epw_for_solar_simulation - get_nearest_epw_from_climate_onebuilding

This package was introduced to split a previously monolithic module into cohesive submodules. Backwards-compatible imports are preserved: importing from voxcity.utils.weather continues to work.

Submodules

Functions

safe_rename(→ pathlib.Path)

Safely rename a file, handling existing files by adding a number suffix.

safe_extract(→ pathlib.Path)

Safely extract a file from zip, handling existing files.

process_epw(→ Tuple[pandas.DataFrame, dict])

Process an EPW file into a pandas DataFrame and header metadata.

read_epw_for_solar_simulation(epw_file_path)

Read EPW file specifically for solar simulation purposes.

get_nearest_epw_from_climate_onebuilding(...)

Download and process EPW weather file from Climate.OneBuilding.Org based on coordinates.

Package Contents

voxcity.utils.weather.safe_rename(src: pathlib.Path, dst: pathlib.Path) pathlib.Path[source]

Safely rename a file, handling existing files by adding a number suffix.

voxcity.utils.weather.safe_extract(zip_ref: zipfile.ZipFile, filename: str, extract_dir: pathlib.Path) pathlib.Path[source]

Safely extract a file from zip, handling existing files.

voxcity.utils.weather.process_epw(epw_path: str | pathlib.Path) Tuple[pandas.DataFrame, dict][source]

Process an EPW file into a pandas DataFrame and header metadata.

voxcity.utils.weather.read_epw_for_solar_simulation(epw_file_path)[source]

Read EPW file specifically for solar simulation purposes. Returns (df[DNI,DHI], lon, lat, tz, elevation_m).

voxcity.utils.weather.get_nearest_epw_from_climate_onebuilding(longitude: float, latitude: float, output_dir: str = './', max_distance: float | None = None, extract_zip: bool = True, load_data: bool = True, region: str | List[str] | None = None, allow_insecure_ssl: bool = False, allow_http_fallback: bool = False, ssl_verify: bool | str = True) Tuple[str | None, pandas.DataFrame | None, Dict | None][source]

Download and process EPW weather file from Climate.OneBuilding.Org based on coordinates.