-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(analyze): Expose UTCI comfort parameters
- Loading branch information
1 parent
82288e5
commit 176f1a3
Showing
8 changed files
with
105 additions
and
6 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{ | ||
"version": "1.6.0", | ||
"nickname": "UTCIPar", | ||
"outputs": [ | ||
[ | ||
{ | ||
"access": "None", | ||
"name": "utci_par", | ||
"description": "A UTCI comfort parameter object that can be plugged into\nany of the components that compute UTCI thermal comfort.", | ||
"type": null, | ||
"default": null | ||
} | ||
] | ||
], | ||
"inputs": [ | ||
{ | ||
"access": "item", | ||
"name": "_cold_thresh_", | ||
"description": "Temperature in Celsius below which the UTCI represents\ncold stress. (Default: 9C).", | ||
"type": "double", | ||
"default": null | ||
}, | ||
{ | ||
"access": "item", | ||
"name": "_heat_thresh_", | ||
"description": "A number between 0 and 1 indicating the upper limit of\nhumidity ratio that is considered acceptable.\nDefault is 1 for essentially no limit.", | ||
"type": "double", | ||
"default": null | ||
} | ||
], | ||
"subcategory": "4 :: Extra", | ||
"code": "\ntry:\n from ladybug_comfort.parameter.utci import UTCIParameter\nexcept ImportError as e:\n raise ImportError('\\nFailed to import ladybug_comfort:\\n\\t{}'.format(e))\n\nmoderate_cold, moderate_heat = None, None\nif _cold_thresh_ and _cold_thresh_ < 0:\n moderate_cold = _cold_thresh_\nif _heat_thresh_ and _heat_thresh_ > 28:\n moderate_heat = _heat_thresh_\n\nutci_par = UTCIParameter(\n cold_thresh=_cold_thresh_,\n heat_thresh=_heat_thresh_,\n moderate_cold_thresh=moderate_cold,\n moderate_heat_thresh=moderate_heat\n)\n", | ||
"category": "Ladybug", | ||
"name": "LB UTCI Comfort Parameters", | ||
"description": "Create a set of parameters that define the acceptable conditions of the\nUniversal Thermal Climate Index (UTCI) comfort model.\n-\nThese parameters can be plugged into any of the components that compute UTCI comfort.\n-" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Ladybug: A Plugin for Environmental Analysis (GPL) | ||
# This file is part of Ladybug. | ||
# | ||
# Copyright (c) 2023, Ladybug Tools. | ||
# You should have received a copy of the GNU Affero General Public License | ||
# along with Ladybug; If not, see <http://www.gnu.org/licenses/>. | ||
# | ||
# @license AGPL-3.0-or-later <https://spdx.org/licenses/AGPL-3.0-or-later> | ||
|
||
""" | ||
Create a set of parameters that define the acceptable conditions of the | ||
Universal Thermal Climate Index (UTCI) comfort model. | ||
- | ||
These parameters can be plugged into any of the components that compute UTCI comfort. | ||
- | ||
Args: | ||
_cold_thresh_: Temperature in Celsius below which the UTCI represents | ||
cold stress. (Default: 9C). | ||
heat_thresh: Temperature in Celsius above which the UTCI represents | ||
heat stress. (Default: 26C). | ||
Returns: | ||
utci_par: A UTCI comfort parameter object that can be plugged into | ||
any of the components that compute UTCI thermal comfort. | ||
""" | ||
|
||
ghenv.Component.Name = 'LB UTCI Comfort Parameters' | ||
ghenv.Component.NickName = 'UTCIPar' | ||
ghenv.Component.Message = '1.6.0' | ||
ghenv.Component.Category = 'Ladybug' | ||
ghenv.Component.SubCategory = '4 :: Extra' | ||
ghenv.Component.AdditionalHelpFromDocStrings = '0' | ||
|
||
try: | ||
from ladybug_comfort.parameter.utci import UTCIParameter | ||
except ImportError as e: | ||
raise ImportError('\nFailed to import ladybug_comfort:\n\t{}'.format(e)) | ||
|
||
moderate_cold, moderate_heat = None, None | ||
if _cold_thresh_ and _cold_thresh_ < 0: | ||
moderate_cold = _cold_thresh_ | ||
if _heat_thresh_ and _heat_thresh_ > 28: | ||
moderate_heat = _heat_thresh_ | ||
|
||
utci_par = UTCIParameter( | ||
cold_thresh=_cold_thresh_, | ||
heat_thresh=_heat_thresh_, | ||
moderate_cold_thresh=moderate_cold, | ||
moderate_heat_thresh=moderate_heat | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.