honeybee-core 1.62.5__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
@@ -1866,14 +1866,22 @@ class Room(_BaseWithShade):
1866
1866
  try:
1867
1867
  nf.add_aperture(ap)
1868
1868
  except AssertionError: # probably adiabatic
1869
- nf.boundary_condition = boundary_conditions.outdoors
1869
+ if not isinstance(nf.boundary_condition, Outdoors):
1870
+ nf.boundary_condition = \
1871
+ boundary_conditions.outdoors
1872
+ if isinstance(nf.type, AirBoundary):
1873
+ nf.type = get_type_from_normal(nf.normal)
1870
1874
  nf.add_aperture(ap)
1871
1875
  for dr in doors:
1872
1876
  if nf.geometry.is_sub_face(dr.geometry, tol, a_tol):
1873
1877
  try:
1874
1878
  nf.add_door(dr)
1875
1879
  except AssertionError: # probably adiabatic
1876
- nf.boundary_condition = boundary_conditions.outdoors
1880
+ if not isinstance(nf.boundary_condition, Outdoors):
1881
+ nf.boundary_condition = \
1882
+ boundary_conditions.outdoors
1883
+ if isinstance(nf.type, AirBoundary):
1884
+ nf.type = get_type_from_normal(nf.normal)
1877
1885
  nf.add_door(dr)
1878
1886
  if i == 0: # add all assigned shades to this face
1879
1887
  nf.add_indoor_shades(in_shades)
@@ -2331,6 +2339,49 @@ class Room(_BaseWithShade):
2331
2339
  floor_heights.append(flrh)
2332
2340
  return grouped_rooms, floor_heights
2333
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
+
2334
2385
  @staticmethod
2335
2386
  def stories_by_floor_height(rooms, min_difference=2.0):
2336
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.5
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=WrQuXHoomD_vbxF6Io8SIlUCpkXqh6j59N4yIR26mhM,156468
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.5.dist-info/licenses/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
44
- honeybee_core-1.62.5.dist-info/METADATA,sha256=gT4MNGLV_NVt8wNm2EiyTN0K04d-qLAHXgAxgAxEJqU,3729
45
- honeybee_core-1.62.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
46
- honeybee_core-1.62.5.dist-info/entry_points.txt,sha256=r3YqOm40goBroH3ccUhpwQjvTwu10JWLd0HIRHI1J8E,47
47
- honeybee_core-1.62.5.dist-info/top_level.txt,sha256=8ve7puCRLUA9XDEGc1Mcs-UX9sFjpPV8MeTaIMwQ_Tg,9
48
- honeybee_core-1.62.5.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,,