honeybee-core 1.62.7__py3-none-any.whl → 1.62.9__py3-none-any.whl

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.
honeybee/room.py CHANGED
@@ -2031,6 +2031,80 @@ class Room(_BaseWithShade):
2031
2031
  self._geometry = room_polyface
2032
2032
  return new_faces
2033
2033
 
2034
+ @staticmethod
2035
+ def join_adjacent_rooms(rooms, tolerance=0.01):
2036
+ """Get Rooms merged across their adjacent Surface boundary conditions.
2037
+
2038
+ When the input rooms form a continuous volume across their adjacencies,
2039
+ a list with only a single joined Room will be returned. Otherwise, there
2040
+ will be more than one Room in the result for each contiguous volume
2041
+ across the adjacencies.
2042
+
2043
+ In all cases, the Room with the highest volume in the contiguous group
2044
+ will set the properties of the joined Room, including multiplier, zone,
2045
+ story, exclude_floor_area, and all extension attributes
2046
+
2047
+ Args:
2048
+ rooms: A list of Rooms which will be merged into one (or more) Rooms
2049
+ across their adjacent Faces.
2050
+ tolerance: The minimum difference between the coordinate values of two
2051
+ faces at which they can be considered adjacent. (Default: 0.01,
2052
+ suitable for objects in meters).
2053
+ """
2054
+ # group the rooms according to their adjacency
2055
+ adj_groups = Room.group_by_adjacency(rooms)
2056
+ joined_rooms = []
2057
+
2058
+ # create the joined Rooms from each group
2059
+ for adj_group in adj_groups:
2060
+ # first check to see if the group has any adjacencies at all
2061
+ if len(adj_group) == 1:
2062
+ joined_rooms.append(adj_group[0])
2063
+ continue
2064
+ # determine the primary room that will set the properties of the new Room
2065
+ volumes = [r.volume for r in adj_group]
2066
+ sort_inds = [i for _, i in sorted(zip(volumes, range(len(volumes))))]
2067
+ primary_room = adj_group[sort_inds[-1]]
2068
+ # gather all of the adjacent faces to be eliminated in the new Room
2069
+ all_adjacencies, remove_faces = {}, set()
2070
+ for room in adj_group:
2071
+ for face in room.faces:
2072
+ if isinstance(face.boundary_condition, Surface):
2073
+ bc_obj = face.boundary_condition.boundary_condition_object
2074
+ all_adjacencies[bc_obj] = face.identifier
2075
+ if face.identifier in all_adjacencies:
2076
+ remove_faces.add(face.identifier)
2077
+ remove_faces.add(all_adjacencies[face.identifier])
2078
+ # gather the faces forming a contiguous volume and make the new room
2079
+ new_faces, new_indoor_shades, new_outdoor_shades = [], [], []
2080
+ for room in adj_group:
2081
+ new_indoor_shades.extend((s.duplicate() for s in room.indoor_shades))
2082
+ new_outdoor_shades.extend((s.duplicate() for s in room.outdoor_shades))
2083
+ for face in room.faces:
2084
+ if face.identifier not in remove_faces:
2085
+ new_faces.append(face.duplicate())
2086
+ # create the new room and assign any shades
2087
+ new_r = Room(primary_room.identifier, new_faces, tolerance)
2088
+ new_r._outdoor_shades = new_outdoor_shades
2089
+ new_r._indoor_shades = new_indoor_shades
2090
+ for oshd in new_outdoor_shades:
2091
+ oshd._parent = new_r
2092
+ for ishd in new_indoor_shades:
2093
+ ishd._parent = new_r
2094
+ ishd._is_indoor = True
2095
+ # transfer the primary room properties to the new room
2096
+ new_r._display_name = primary_room._display_name
2097
+ new_r._user_data = None if primary_room.user_data is None \
2098
+ else primary_room.user_data.copy()
2099
+ new_r._multiplier = primary_room.multiplier
2100
+ new_r._zone = primary_room._zone
2101
+ new_r._story = primary_room._story
2102
+ new_r._exclude_floor_area = primary_room.exclude_floor_area
2103
+ new_r._properties._duplicate_extension_attr(primary_room._properties)
2104
+ joined_rooms.append(new_r)
2105
+
2106
+ return joined_rooms
2107
+
2034
2108
  @staticmethod
2035
2109
  def intersect_adjacency(rooms, tolerance=0.01, angle_tolerance=1):
2036
2110
  """Intersect the Faces of an array of Rooms to ensure matching adjacencies.
@@ -3201,7 +3275,7 @@ class Room(_BaseWithShade):
3201
3275
  # loop through the rooms and find air boundary adjacencies
3202
3276
  for room in all_rooms:
3203
3277
  adj_ids = adj_finding_function(room)
3204
- if len(adj_ids) == 0: # a room that is its own solar enclosure
3278
+ if len(adj_ids) == 0: # a room with no adjacencies
3205
3279
  adj_network.append([room])
3206
3280
  else: # there are other adjacent rooms to find
3207
3281
  local_network = [room]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: honeybee-core
3
- Version: 1.62.7
3
+ Version: 1.62.9
4
4
  Summary: A library to create 3D building geometry for various types of environmental simulation.
5
5
  Home-page: https://github.com/ladybug-tools/honeybee-core
6
6
  Author: Ladybug Tools
@@ -18,8 +18,8 @@ Classifier: Programming Language :: Python :: Implementation :: IronPython
18
18
  Classifier: Operating System :: OS Independent
19
19
  Description-Content-Type: text/markdown
20
20
  License-File: LICENSE
21
- Requires-Dist: ladybug-core==0.44.24
22
- Requires-Dist: ladybug-geometry-polyskel==1.7.33
21
+ Requires-Dist: ladybug-core==0.44.25
22
+ Requires-Dist: ladybug-geometry-polyskel==1.7.34
23
23
  Requires-Dist: honeybee-schema==1.59.1; python_version >= "3.7"
24
24
  Dynamic: author
25
25
  Dynamic: author-email
@@ -19,7 +19,7 @@ honeybee/logutil.py,sha256=2gn-6RcWqFLvwdFzBHPqUwFqTj_R3iwHKALrl-2eL7M,2564
19
19
  honeybee/model.py,sha256=YbTZJddBiLzeoivdR4QY7SqeZ_kIMVfWtuR_YwDG-j8,181203
20
20
  honeybee/orientation.py,sha256=GogGblASW9OU-fobfDaQ7w5yRbEAFdJJuHwg2fadhKI,5046
21
21
  honeybee/properties.py,sha256=ok976fbUdXzLDR2XiPNf8Q5ejfOM-PArqm5CVUbFiCc,34316
22
- honeybee/room.py,sha256=UYusFfJVHW5LBReuk1bSJDPAzjHqXaQRZdcGEjijb1k,158808
22
+ honeybee/room.py,sha256=qgn8Ur6aE864sBpPb-thHqO0kXbOmhgBCAwj5FtPAdw,162693
23
23
  honeybee/search.py,sha256=KOIeQjYdj0yhRWPmF5kiFiH8Ei0WbzuiU-capnwYVeM,5060
24
24
  honeybee/shade.py,sha256=HwLkOqvPpluLMXzicWXmKl4fMVJHmkqqehntT69e00Q,21026
25
25
  honeybee/shademesh.py,sha256=oldugnwhu-ibX9f0hfxpO-DvgM8U7S-dYwUjBSVzo4g,13273
@@ -40,9 +40,9 @@ honeybee/writer/model.py,sha256=N7F_jksf-5TrdVecuxTaFWxnPVFLmQs7k8g27TsdB7Q,177
40
40
  honeybee/writer/room.py,sha256=kFghgStTU1SEJSLigXB0VjOWhZtgs4uXuAqdwd4yRQo,174
41
41
  honeybee/writer/shade.py,sha256=EpgX-vMc-s21TnMvNWvWTKyT8iAnxu1nFVXzjY1oyF8,177
42
42
  honeybee/writer/shademesh.py,sha256=Y41bLogJ7dwpvMe5cAWVRDRVqJEwo9e5hFJQjlt6UX8,189
43
- honeybee_core-1.62.7.dist-info/licenses/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
44
- honeybee_core-1.62.7.dist-info/METADATA,sha256=e0rzDj1uNs1-Dzzdw6y9l7Wd8VOXXEVAwDB9a4tc7wo,3729
45
- honeybee_core-1.62.7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
46
- honeybee_core-1.62.7.dist-info/entry_points.txt,sha256=r3YqOm40goBroH3ccUhpwQjvTwu10JWLd0HIRHI1J8E,47
47
- honeybee_core-1.62.7.dist-info/top_level.txt,sha256=8ve7puCRLUA9XDEGc1Mcs-UX9sFjpPV8MeTaIMwQ_Tg,9
48
- honeybee_core-1.62.7.dist-info/RECORD,,
43
+ honeybee_core-1.62.9.dist-info/licenses/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
44
+ honeybee_core-1.62.9.dist-info/METADATA,sha256=wVtamXoPjP6t1ExUkw3VV9MROACE7Czsa4zuybrpISU,3729
45
+ honeybee_core-1.62.9.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
46
+ honeybee_core-1.62.9.dist-info/entry_points.txt,sha256=r3YqOm40goBroH3ccUhpwQjvTwu10JWLd0HIRHI1J8E,47
47
+ honeybee_core-1.62.9.dist-info/top_level.txt,sha256=8ve7puCRLUA9XDEGc1Mcs-UX9sFjpPV8MeTaIMwQ_Tg,9
48
+ honeybee_core-1.62.9.dist-info/RECORD,,