Weather#
Weather file fetching and caching.
BaseWeather
#
Bases: BaseModel
A base class for fetching weather files.
Responsible for fetching weather files from a URL and extracting the .epw and .ddy files.
Also takes care of caching the weather files in a directory.
Source code in epinterface\weather.py
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 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 |
|
fetch_weather(cache_dir)
async
#
Fetch the weather file from the URL and extract the .epw and .ddy files.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
cache_dir
|
Path | str
|
The directory to cache the weather files. |
required |
Returns:
Name | Type | Description |
---|---|---|
epw_path |
Path
|
The path to the .epw file. |
ddy_path |
Path
|
The path to the .ddy file. |
Source code in epinterface\weather.py
62 63 64 65 66 67 68 69 70 71 72 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 |
|
NotAZipError
#
Bases: ValueError
Raised when a URL does not end with a .zip extension.
Source code in epinterface\weather.py
15 16 17 18 19 20 |
|
__init__()
#
Initialize the error.
Source code in epinterface\weather.py
18 19 20 |
|
check_path_ends_with_zip(url)
#
Check that the path of the URL ends with a .zip extension.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
url
|
AnyUrl
|
The URL to check. |
required |
Raises:
Type | Description |
---|---|
NotAZipError
|
If the URL does not end with a .zip extension. |
Returns:
Name | Type | Description |
---|---|---|
url |
AnyUrl
|
The URL. |
Source code in epinterface\weather.py
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
|