honeybee-core 1.62.6__py3-none-any.whl → 1.62.7__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
@@ -2339,6 +2339,49 @@ class Room(_BaseWithShade):
2339
2339
  floor_heights.append(flrh)
2340
2340
  return grouped_rooms, floor_heights
2341
2341
 
2342
+ @staticmethod
2343
+ def group_by_story(rooms):
2344
+ """Group Rooms according to their story property.
2345
+
2346
+ The returned room groups will be sorted from the lowest average floor
2347
+ to the highest average floor height.
2348
+
2349
+ Args:
2350
+ rooms: A list of honeybee rooms to be grouped by story.
2351
+
2352
+ Returns:
2353
+ A tuple with three items.
2354
+
2355
+ - grouped_rooms - A list of lists of honeybee rooms with each sub-list
2356
+ representing a different story.
2357
+
2358
+ - story_names - A list of story names with one value for each
2359
+ sub-list of the output grouped_rooms.
2360
+
2361
+ - floor_heights - A list of floor heights with one floor height
2362
+ for each sub-list of the output grouped_rooms.
2363
+ """
2364
+ # group the rooms by story
2365
+ story_dict = {}
2366
+ for room in rooms:
2367
+ try:
2368
+ story_dict[room.story].append(room)
2369
+ except KeyError:
2370
+ story_dict[room.story] = [room]
2371
+ # sort the stories by average floor height
2372
+ grouped_rooms, story_names, floor_heights = [], [], []
2373
+ for s_name, g_rooms in story_dict.items():
2374
+ grouped_rooms.append(g_rooms)
2375
+ story_names.append(s_name)
2376
+ weighted_sum = sum(r.average_floor_height * r.floor_area for r in g_rooms)
2377
+ total_area = sum(r.floor_area for r in g_rooms)
2378
+ avg_flr = weighted_sum / total_area
2379
+ floor_heights.append(avg_flr)
2380
+ zip_obj = zip(floor_heights, grouped_rooms, story_names)
2381
+ floor_heights, grouped_rooms, story_names = \
2382
+ (list(t) for t in zip(*sorted(zip_obj, key=lambda x: x[0])))
2383
+ return grouped_rooms, story_names, floor_heights
2384
+
2342
2385
  @staticmethod
2343
2386
  def stories_by_floor_height(rooms, min_difference=2.0):
2344
2387
  """Assign story properties to a set of Rooms using their floor heights.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: honeybee-core
3
- Version: 1.62.6
3
+ Version: 1.62.7
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
@@ -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=7_oLBQ0JJEQz55N57pqwL9HdVjtST4rHtcCkbupgrgs,157054
22
+ honeybee/room.py,sha256=UYusFfJVHW5LBReuk1bSJDPAzjHqXaQRZdcGEjijb1k,158808
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.6.dist-info/licenses/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
44
- honeybee_core-1.62.6.dist-info/METADATA,sha256=UwPIpQX11k9oOLpyIcj3Cc3sw9O1IpjGSn1qEkRUS08,3729
45
- honeybee_core-1.62.6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
46
- honeybee_core-1.62.6.dist-info/entry_points.txt,sha256=r3YqOm40goBroH3ccUhpwQjvTwu10JWLd0HIRHI1J8E,47
47
- honeybee_core-1.62.6.dist-info/top_level.txt,sha256=8ve7puCRLUA9XDEGc1Mcs-UX9sFjpPV8MeTaIMwQ_Tg,9
48
- honeybee_core-1.62.6.dist-info/RECORD,,
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,,