Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(simulate): Ensure that Rhino tolerance is passed to annual loads #157

Merged
merged 2 commits into from Nov 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Binary file modified honeybee_grasshopper_energy/icon/HB Read Face Result.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified honeybee_grasshopper_energy/icon/HB Read Room Energy Result.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 16 additions & 2 deletions honeybee_grasshopper_energy/json/HB_Annual_Loads.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions honeybee_grasshopper_energy/json/HB_Read_Custom_Result.json
@@ -1,5 +1,5 @@
{
"version": "1.0.0",
"version": "1.0.1",
"nickname": "CustomResult",
"outputs": [
[
Expand Down Expand Up @@ -29,7 +29,7 @@
}
],
"subcategory": "6 :: Result",
"code": "\nimport os\nimport subprocess\nimport json\n\ntry:\n from ladybug.datacollection import HourlyContinuousCollection\nexcept ImportError as e:\n raise ImportError('\\nFailed to import ladybug:\\n\\t{}'.format(e))\n\ntry:\n from honeybee.config import folders\nexcept ImportError as e:\n raise ImportError('\\nFailed to import honeybee:\\n\\t{}'.format(e))\n\ntry:\n from honeybee_energy.result.sql import SQLiteResult\nexcept ImportError as e:\n raise ImportError('\\nFailed to import honeybee_energy:\\n\\t{}'.format(e))\n\ntry:\n from ladybug_{{cad}}.{{plugin}} import all_required_inputs\nexcept ImportError as e:\n raise ImportError('\\nFailed to import ladybug_{{cad}}:\\n\\t{}'.format(e))\n\n\nif all_required_inputs(ghenv.Component):\n if os.name == 'nt': # we are on windows; use IronPython like usual\n sql_obj = SQLiteResult(_sql) # create the SQL result parsing object\n results = sql_obj.data_collections_by_output_name(_output_names)\n\n else: # we are on Mac; sqlite3 module doesn't work in Mac IronPython\n # Execute the honybee CLI to obtain the results via CPython\n cmds = [folders.python_exe_path, '-m', 'honeybee_energy', 'result',\n 'data-by-outputs', _sql, _output_names]\n process = subprocess.Popen(cmds, stdout=subprocess.PIPE)\n stdout = process.communicate()\n data_dicts = json.loads(stdout[0])\n results = [HourlyContinuousCollection.from_dict(data) for data in data_dicts[0]]\n",
"code": "\nimport os\nimport subprocess\nimport json\n\ntry:\n from ladybug.datacollection import HourlyContinuousCollection, \\\n MonthlyCollection, DailyCollection\nexcept ImportError as e:\n raise ImportError('\\nFailed to import ladybug:\\n\\t{}'.format(e))\n\ntry:\n from honeybee.config import folders\nexcept ImportError as e:\n raise ImportError('\\nFailed to import honeybee:\\n\\t{}'.format(e))\n\ntry:\n from honeybee_energy.result.sql import SQLiteResult\nexcept ImportError as e:\n raise ImportError('\\nFailed to import honeybee_energy:\\n\\t{}'.format(e))\n\ntry:\n from ladybug_{{cad}}.{{plugin}} import all_required_inputs\nexcept ImportError as e:\n raise ImportError('\\nFailed to import ladybug_{{cad}}:\\n\\t{}'.format(e))\n\ndef serialize_data(data_dicts):\n \"\"\"Reserialize a list of collection dictionaries.\"\"\"\n if len(data_dicts) == 0:\n return []\n elif data_dicts[0]['type'] == 'HourlyContinuousCollection':\n return [HourlyContinuousCollection.from_dict(data) for data in data_dicts]\n elif data_dicts[0]['type'] == 'MonthlyCollection':\n return [MonthlyCollection.from_dict(data) for data in data_dicts]\n elif data_dicts[0]['type'] == 'DailyCollection':\n return [DailyCollection.from_dict(data) for data in data_dicts]\n\n\nif all_required_inputs(ghenv.Component):\n if os.name == 'nt': # we are on windows; use IronPython like usual\n sql_obj = SQLiteResult(_sql) # create the SQL result parsing object\n results = sql_obj.data_collections_by_output_name(_output_names)\n\n else: # we are on Mac; sqlite3 module doesn't work in Mac IronPython\n # Execute the honybee CLI to obtain the results via CPython\n cmds = [folders.python_exe_path, '-m', 'honeybee_energy', 'result',\n 'data-by-outputs', _sql, _output_names]\n process = subprocess.Popen(cmds, stdout=subprocess.PIPE)\n stdout = process.communicate()\n data_dicts = json.loads(stdout[0])\n results = serialize_data(data_dicts[0])\n",
"category": "HB-Energy",
"name": "HB Read Custom Result",
"description": "Parse any time series data from an energy simulation SQL result file.\n-"
Expand Down
4 changes: 2 additions & 2 deletions honeybee_grasshopper_energy/json/HB_Read_Face_Result.json
@@ -1,5 +1,5 @@
{
"version": "1.1.0",
"version": "1.1.1",
"nickname": "FaceResult",
"outputs": [
[
Expand Down Expand Up @@ -36,7 +36,7 @@
}
],
"subcategory": "6 :: Result",
"code": "\nimport os\nimport subprocess\nimport json\n\ntry:\n from ladybug.datacollection import HourlyContinuousCollection\nexcept ImportError as e:\n raise ImportError('\\nFailed to import ladybug:\\n\\t{}'.format(e))\n\ntry:\n from honeybee.config import folders\nexcept ImportError as e:\n raise ImportError('\\nFailed to import honeybee:\\n\\t{}'.format(e))\n\ntry:\n from honeybee_energy.result.sql import SQLiteResult\nexcept ImportError as e:\n raise ImportError('\\nFailed to import honeybee_energy:\\n\\t{}'.format(e))\n\ntry:\n from ladybug_{{cad}}.{{plugin}} import all_required_inputs\nexcept ImportError as e:\n raise ImportError('\\nFailed to import ladybug_{{cad}}:\\n\\t{}'.format(e))\n\n\ndef subtract_loss_from_gain(gain_load, loss_load):\n \"\"\"Create a single DataCollection from gains and losses.\"\"\"\n total_loads = []\n for gain, loss in zip(gain_load, loss_load):\n total_load = gain - loss\n total_load.header.metadata['type'] = \\\n total_load.header.metadata['type'].replace('Gain ', '')\n total_loads.append(total_load)\n return total_loads\n\n\ndef serialize_data(data_dicts):\n \"\"\"Reserialize a list of HourlyContinuousCollection dictionaries.\"\"\"\n return [HourlyContinuousCollection.from_dict(data) for data in data_dicts]\n\n\n# List of all the output strings that will be requested\nface_indoor_temp_output = 'Surface Inside Face Temperature'\nface_outdoor_temp_output = 'Surface Outside Face Temperature'\nopaque_energy_flow_output = 'Surface Average Face Conduction Heat Transfer Energy'\nwindow_loss_output = 'Surface Window Heat Loss Energy'\nwindow_gain_output = 'Surface Window Heat Gain Energy'\nall_output = [face_indoor_temp_output, face_outdoor_temp_output,\n opaque_energy_flow_output, window_loss_output, window_gain_output]\n\n\nif all_required_inputs(ghenv.Component):\n if os.name == 'nt': # we are on windows; use IronPython like usual\n sql_obj = SQLiteResult(_sql) # create the SQL result parsing object\n # get all of the results\n face_indoor_temp = sql_obj.data_collections_by_output_name(face_indoor_temp_output)\n face_outdoor_temp = sql_obj.data_collections_by_output_name(face_outdoor_temp_output)\n opaque_energy_flow = sql_obj.data_collections_by_output_name(opaque_energy_flow_output)\n window_loss = sql_obj.data_collections_by_output_name(window_loss_output)\n window_gain = sql_obj.data_collections_by_output_name(window_gain_output)\n\n else: # we are on Mac; sqlite3 module doesn't work in Mac IronPython\n # Execute the honybee CLI to obtain the results via CPython\n cmds = [folders.python_exe_path, '-m', 'honeybee_energy', 'result',\n 'data-by-outputs', _sql] + all_output\n process = subprocess.Popen(cmds, stdout=subprocess.PIPE)\n stdout = process.communicate()\n data_coll_dicts = json.loads(stdout[0])\n # get all of the results\n face_indoor_temp = serialize_data(data_coll_dicts[0])\n face_outdoor_temp = serialize_data(data_coll_dicts[1])\n opaque_energy_flow = serialize_data(data_coll_dicts[2])\n window_loss = serialize_data(data_coll_dicts[3])\n window_gain = serialize_data(data_coll_dicts[4])\n\n # do arithmetic with any of the gain/loss data collections\n window_energy_flow = []\n if len(window_gain) == len(window_loss):\n window_energy_flow = subtract_loss_from_gain(window_gain, window_loss)\n face_energy_flow = opaque_energy_flow + window_energy_flow\n",
"code": "\nimport os\nimport subprocess\nimport json\n\ntry:\n from ladybug.datacollection import HourlyContinuousCollection, \\\n MonthlyCollection, DailyCollection\nexcept ImportError as e:\n raise ImportError('\\nFailed to import ladybug:\\n\\t{}'.format(e))\n\ntry:\n from honeybee.config import folders\nexcept ImportError as e:\n raise ImportError('\\nFailed to import honeybee:\\n\\t{}'.format(e))\n\ntry:\n from honeybee_energy.result.sql import SQLiteResult\nexcept ImportError as e:\n raise ImportError('\\nFailed to import honeybee_energy:\\n\\t{}'.format(e))\n\ntry:\n from ladybug_{{cad}}.{{plugin}} import all_required_inputs\nexcept ImportError as e:\n raise ImportError('\\nFailed to import ladybug_{{cad}}:\\n\\t{}'.format(e))\n\n\ndef subtract_loss_from_gain(gain_load, loss_load):\n \"\"\"Create a single DataCollection from gains and losses.\"\"\"\n total_loads = []\n for gain, loss in zip(gain_load, loss_load):\n total_load = gain - loss\n total_load.header.metadata['type'] = \\\n total_load.header.metadata['type'].replace('Gain ', '')\n total_loads.append(total_load)\n return total_loads\n\n\ndef serialize_data(data_dicts):\n \"\"\"Reserialize a list of collection dictionaries.\"\"\"\n if len(data_dicts) == 0:\n return []\n elif data_dicts[0]['type'] == 'HourlyContinuousCollection':\n return [HourlyContinuousCollection.from_dict(data) for data in data_dicts]\n elif data_dicts[0]['type'] == 'MonthlyCollection':\n return [MonthlyCollection.from_dict(data) for data in data_dicts]\n elif data_dicts[0]['type'] == 'DailyCollection':\n return [DailyCollection.from_dict(data) for data in data_dicts]\n\n\n# List of all the output strings that will be requested\nface_indoor_temp_output = 'Surface Inside Face Temperature'\nface_outdoor_temp_output = 'Surface Outside Face Temperature'\nopaque_energy_flow_output = 'Surface Average Face Conduction Heat Transfer Energy'\nwindow_loss_output = 'Surface Window Heat Loss Energy'\nwindow_gain_output = 'Surface Window Heat Gain Energy'\nall_output = [face_indoor_temp_output, face_outdoor_temp_output,\n opaque_energy_flow_output, window_loss_output, window_gain_output]\n\n\nif all_required_inputs(ghenv.Component):\n if os.name == 'nt': # we are on windows; use IronPython like usual\n sql_obj = SQLiteResult(_sql) # create the SQL result parsing object\n # get all of the results\n face_indoor_temp = sql_obj.data_collections_by_output_name(face_indoor_temp_output)\n face_outdoor_temp = sql_obj.data_collections_by_output_name(face_outdoor_temp_output)\n opaque_energy_flow = sql_obj.data_collections_by_output_name(opaque_energy_flow_output)\n window_loss = sql_obj.data_collections_by_output_name(window_loss_output)\n window_gain = sql_obj.data_collections_by_output_name(window_gain_output)\n\n else: # we are on Mac; sqlite3 module doesn't work in Mac IronPython\n # Execute the honybee CLI to obtain the results via CPython\n cmds = [folders.python_exe_path, '-m', 'honeybee_energy', 'result',\n 'data-by-outputs', _sql] + all_output\n process = subprocess.Popen(cmds, stdout=subprocess.PIPE)\n stdout = process.communicate()\n data_coll_dicts = json.loads(stdout[0])\n # get all of the results\n face_indoor_temp = serialize_data(data_coll_dicts[0])\n face_outdoor_temp = serialize_data(data_coll_dicts[1])\n opaque_energy_flow = serialize_data(data_coll_dicts[2])\n window_loss = serialize_data(data_coll_dicts[3])\n window_gain = serialize_data(data_coll_dicts[4])\n\n # do arithmetic with any of the gain/loss data collections\n window_energy_flow = []\n if len(window_gain) == len(window_loss):\n window_energy_flow = subtract_loss_from_gain(window_gain, window_loss)\n face_energy_flow = opaque_energy_flow + window_energy_flow\n",
"category": "HB-Energy",
"name": "HB Read Face Result",
"description": "Parse all of the common Room-level comfort-related results from an SQL result\nfile that has been generated from an energy simulation.\n-"
Expand Down
@@ -1,5 +1,5 @@
{
"version": "1.0.0",
"version": "1.0.1",
"nickname": "RoomComfortResult",
"outputs": [
[
Expand Down Expand Up @@ -43,7 +43,7 @@
}
],
"subcategory": "6 :: Result",
"code": "\nimport os\nimport subprocess\nimport json\n\ntry:\n from ladybug.datacollection import HourlyContinuousCollection\nexcept ImportError as e:\n raise ImportError('\\nFailed to import ladybug:\\n\\t{}'.format(e))\n\ntry:\n from honeybee.config import folders\nexcept ImportError as e:\n raise ImportError('\\nFailed to import honeybee:\\n\\t{}'.format(e))\n\ntry:\n from honeybee_energy.result.sql import SQLiteResult\nexcept ImportError as e:\n raise ImportError('\\nFailed to import honeybee_energy:\\n\\t{}'.format(e))\n\ntry:\n from ladybug_{{cad}}.{{plugin}} import all_required_inputs\nexcept ImportError as e:\n raise ImportError('\\nFailed to import ladybug_{{cad}}:\\n\\t{}'.format(e))\n\n\ndef serialize_data(data_dicts):\n \"\"\"Reserialize a list of HourlyContinuousCollection dictionaries.\"\"\"\n return [HourlyContinuousCollection.from_dict(data) for data in data_dicts]\n\n\n# List of all the output strings that will be requested\noper_temp_output = 'Zone Operative Temperature'\nair_temp_output = 'Zone Mean Air Temperature'\nrad_temp_output = 'Zone Mean Radiant Temperature'\nrel_humidity_output = 'Zone Air Relative Humidity'\nall_output = [oper_temp_output, air_temp_output, rad_temp_output, rel_humidity_output]\n\n\nif all_required_inputs(ghenv.Component):\n if os.name == 'nt': # we are on windows; use IronPython like usual\n sql_obj = SQLiteResult(_sql) # create the SQL result parsing object\n # get all of the results\n oper_temp = sql_obj.data_collections_by_output_name(oper_temp_output)\n air_temp = sql_obj.data_collections_by_output_name(air_temp_output)\n rad_temp = sql_obj.data_collections_by_output_name(rad_temp_output)\n rel_humidity = sql_obj.data_collections_by_output_name(rel_humidity_output)\n\n else: # we are on Mac; sqlite3 module doesn't work in Mac IronPython\n # Execute the honybee CLI to obtain the results via CPython\n cmds = [folders.python_exe_path, '-m', 'honeybee_energy', 'result',\n 'data-by-outputs', _sql] + all_output\n process = subprocess.Popen(cmds, stdout=subprocess.PIPE)\n stdout = process.communicate()\n data_coll_dicts = json.loads(stdout[0])\n # get all of the results\n oper_temp = serialize_data(data_coll_dicts[0])\n air_temp = serialize_data(data_coll_dicts[1])\n rad_temp = serialize_data(data_coll_dicts[2])\n rel_humidity = serialize_data(data_coll_dicts[3])\n",
"code": "\nimport os\nimport subprocess\nimport json\n\ntry:\n from ladybug.datacollection import HourlyContinuousCollection, \\\n MonthlyCollection, DailyCollection\nexcept ImportError as e:\n raise ImportError('\\nFailed to import ladybug:\\n\\t{}'.format(e))\n\ntry:\n from honeybee.config import folders\nexcept ImportError as e:\n raise ImportError('\\nFailed to import honeybee:\\n\\t{}'.format(e))\n\ntry:\n from honeybee_energy.result.sql import SQLiteResult\nexcept ImportError as e:\n raise ImportError('\\nFailed to import honeybee_energy:\\n\\t{}'.format(e))\n\ntry:\n from ladybug_{{cad}}.{{plugin}} import all_required_inputs\nexcept ImportError as e:\n raise ImportError('\\nFailed to import ladybug_{{cad}}:\\n\\t{}'.format(e))\n\n\ndef serialize_data(data_dicts):\n \"\"\"Reserialize a list of collection dictionaries.\"\"\"\n if len(data_dicts) == 0:\n return []\n elif data_dicts[0]['type'] == 'HourlyContinuousCollection':\n return [HourlyContinuousCollection.from_dict(data) for data in data_dicts]\n elif data_dicts[0]['type'] == 'MonthlyCollection':\n return [MonthlyCollection.from_dict(data) for data in data_dicts]\n elif data_dicts[0]['type'] == 'DailyCollection':\n return [DailyCollection.from_dict(data) for data in data_dicts]\n\n\n# List of all the output strings that will be requested\noper_temp_output = 'Zone Operative Temperature'\nair_temp_output = 'Zone Mean Air Temperature'\nrad_temp_output = 'Zone Mean Radiant Temperature'\nrel_humidity_output = 'Zone Air Relative Humidity'\nall_output = [oper_temp_output, air_temp_output, rad_temp_output, rel_humidity_output]\n\n\nif all_required_inputs(ghenv.Component):\n if os.name == 'nt': # we are on windows; use IronPython like usual\n sql_obj = SQLiteResult(_sql) # create the SQL result parsing object\n # get all of the results\n oper_temp = sql_obj.data_collections_by_output_name(oper_temp_output)\n air_temp = sql_obj.data_collections_by_output_name(air_temp_output)\n rad_temp = sql_obj.data_collections_by_output_name(rad_temp_output)\n rel_humidity = sql_obj.data_collections_by_output_name(rel_humidity_output)\n\n else: # we are on Mac; sqlite3 module doesn't work in Mac IronPython\n # Execute the honybee CLI to obtain the results via CPython\n cmds = [folders.python_exe_path, '-m', 'honeybee_energy', 'result',\n 'data-by-outputs', _sql] + all_output\n process = subprocess.Popen(cmds, stdout=subprocess.PIPE)\n stdout = process.communicate()\n data_coll_dicts = json.loads(stdout[0])\n # get all of the results\n oper_temp = serialize_data(data_coll_dicts[0])\n air_temp = serialize_data(data_coll_dicts[1])\n rad_temp = serialize_data(data_coll_dicts[2])\n rel_humidity = serialize_data(data_coll_dicts[3])\n",
"category": "HB-Energy",
"name": "HB Read Room Comfort Result",
"description": "Parse all of the common Room-level comfort-related results from an SQL result\nfile that has been generated from an energy simulation.\n-"
Expand Down