honeybee-core 1.61.29__py2.py3-none-any.whl → 1.61.31__py2.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/cli/edit.py CHANGED
@@ -104,7 +104,8 @@ def solve_adjacency(model_file, no_merge, no_intersect, no_overwrite,
104
104
  air_boundary = not wall
105
105
  adiabatic = not surface
106
106
  parsed_model.solve_adjacency(
107
- merge_coplanar, intersect, overwrite, air_boundary, adiabatic)
107
+ merge_coplanar, intersect, overwrite,
108
+ air_boundary=air_boundary, adiabatic=adiabatic)
108
109
 
109
110
  # write the new model out to the file or stdout
110
111
  output_file.write(json.dumps(parsed_model.to_dict()))
honeybee/face.py CHANGED
@@ -740,6 +740,8 @@ class Face(_BaseWithShade):
740
740
  if len(joined_bounds) == 1: # can be represented with a single Face3D
741
741
  verts3d = tuple(ref_plane.xy_to_xyz(_v) for _v in joined_bounds[0])
742
742
  non_rect_geos = [Face3D(verts3d, plane=ref_plane)]
743
+ elif len(joined_bounds) == 0: # everything was invalid
744
+ non_rect_geos = []
743
745
  else: # need to separate holes from distinct Face3Ds
744
746
  bound_faces = []
745
747
  for poly in joined_bounds:
honeybee/model.py CHANGED
@@ -1449,7 +1449,7 @@ class Model(_Base):
1449
1449
 
1450
1450
  def solve_adjacency(
1451
1451
  self, merge_coplanar=False, intersect=False, overwrite=False,
1452
- air_boundary=False, adiabatic=False,
1452
+ remove_mismatched_sub_faces=True, air_boundary=False, adiabatic=False,
1453
1453
  tolerance=None, angle_tolerance=None):
1454
1454
  """Solve adjacency between Rooms of the Model.
1455
1455
 
@@ -1465,6 +1465,10 @@ class Model(_Base):
1465
1465
  solved. (Default: False).
1466
1466
  overwrite: Boolean to note whether existing Surface boundary
1467
1467
  conditions should be overwritten. (Default: False).
1468
+ remove_mismatched_sub_faces: Boolean to note whether any mis-matches
1469
+ in sub-faces between adjacent rooms should simply result in
1470
+ the sub-faces being removed rather than raising an
1471
+ exception. (Default: True).
1468
1472
  air_boundary: Boolean to note whether the wall adjacencies should be
1469
1473
  of the air boundary face type. (Default: False).
1470
1474
  adiabatic: Boolean to note whether the adjacencies should be
@@ -1491,11 +1495,20 @@ class Model(_Base):
1491
1495
 
1492
1496
  # solve adjacency
1493
1497
  if not overwrite: # only assign new adjacencies
1494
- adj_info = Room.solve_adjacency(self.rooms, tol)
1498
+ adj_info = Room.solve_adjacency(self.rooms, tol, remove_mismatched_sub_faces)
1495
1499
  else: # overwrite existing Surface BC
1496
1500
  adj_faces = Room.find_adjacency(self.rooms, tol)
1497
- for face_pair in adj_faces:
1498
- face_pair[0].set_adjacency(face_pair[1])
1501
+ if remove_mismatched_sub_faces:
1502
+ for face_pair in adj_faces:
1503
+ try:
1504
+ face_pair[0].set_adjacency(face_pair[1])
1505
+ except AssertionError:
1506
+ face_pair[0].remove_sub_faces()
1507
+ face_pair[1].remove_sub_faces()
1508
+ face_pair[0].set_adjacency(face_pair[1])
1509
+ else:
1510
+ for face_pair in adj_faces:
1511
+ face_pair[0].set_adjacency(face_pair[1])
1499
1512
  adj_info = {'adjacent_faces': adj_faces}
1500
1513
 
1501
1514
  # try to assign the air boundary face type
@@ -3484,11 +3497,6 @@ class Model(_Base):
3484
3497
  json_output: Boolean to note whether the output validation report
3485
3498
  should be formatted as a JSON object instead of plain text.
3486
3499
  """
3487
- # first get the function to call on this class
3488
- check_func = getattr(Model, check_function, None)
3489
- assert check_func is not None, \
3490
- 'Honeybee Model class has no method {}'.format(check_function)
3491
-
3492
3500
  # process the input model if it's not already serialized
3493
3501
  report = ''
3494
3502
  if isinstance(model, str):
@@ -3505,8 +3513,22 @@ class Model(_Base):
3505
3513
  elif not isinstance(model, Model):
3506
3514
  report = 'Input Model for validation is not a Model object, ' \
3507
3515
  'file path to a Model or a Model HBJSON string.'
3516
+
3517
+ # get the function to call to do checks
3518
+ if '.' in check_function: # nested attribute
3519
+ attributes = check_function.split('.') # get all the sub-attributes
3520
+ check_func = model
3521
+ for attribute in attributes:
3522
+ if check_func is None:
3523
+ continue
3524
+ check_func = getattr(check_func, attribute, None)
3525
+ else:
3526
+ check_func = getattr(model, check_function, None)
3527
+ assert check_func is not None, \
3528
+ 'Honeybee Model class has no method {}'.format(check_function)
3529
+
3508
3530
  # process the arguments and options
3509
- args = [model] if check_args is None else [model] + list(check_args)
3531
+ args = [] if check_args is None else [] + list(check_args)
3510
3532
  kwargs = {'raise_exception': False}
3511
3533
 
3512
3534
  # create the report
@@ -3517,9 +3539,8 @@ class Model(_Base):
3517
3539
  ver_msg = 'Validating Model using honeybee-core=={} and ' \
3518
3540
  'honeybee-schema=={}'.format(c_ver, s_ver)
3519
3541
  # run the check function
3520
- if isinstance(args[0], Model):
3521
- kwargs['detailed'] = False
3522
- report = check_func(*args, **kwargs)
3542
+ kwargs['detailed'] = False
3543
+ report = check_func(*args, **kwargs)
3523
3544
  # format the results of the check
3524
3545
  if report == '':
3525
3546
  full_msg = ver_msg + '\nCongratulations! Your Model is valid!'
honeybee/room.py CHANGED
@@ -1759,10 +1759,18 @@ class Room(_BaseWithShade):
1759
1759
  nf = Face(fid, new_geo, prop_f.type, fbc)
1760
1760
  for ap in apertures:
1761
1761
  if nf.geometry.is_sub_face(ap.geometry, tol, a_tol):
1762
- nf.add_aperture(ap)
1762
+ try:
1763
+ nf.add_aperture(ap)
1764
+ except AssertionError: # probably adiabatic
1765
+ nf.boundary_condition = boundary_conditions.outdoors
1766
+ nf.add_aperture(ap)
1763
1767
  for dr in doors:
1764
1768
  if nf.geometry.is_sub_face(dr.geometry, tol, a_tol):
1765
- nf.add_door(dr)
1769
+ try:
1770
+ nf.add_door(dr)
1771
+ except AssertionError: # probably adiabatic
1772
+ nf.boundary_condition = boundary_conditions.outdoors
1773
+ nf.add_door(dr)
1766
1774
  if i == 0: # add all assigned shades to this face
1767
1775
  nf.add_indoor_shades(in_shades)
1768
1776
  nf.add_outdoor_shades(out_shades)
@@ -1943,7 +1951,7 @@ class Room(_BaseWithShade):
1943
1951
  room.coplanar_split(other_rooms, tolerance, angle_tolerance)
1944
1952
 
1945
1953
  @staticmethod
1946
- def solve_adjacency(rooms, tolerance=0.01):
1954
+ def solve_adjacency(rooms, tolerance=0.01, remove_mismatched_sub_faces=False):
1947
1955
  """Solve for adjacencies between a list of rooms.
1948
1956
 
1949
1957
  Note that this method will mutate the input rooms by setting Surface
@@ -1956,6 +1964,10 @@ class Room(_BaseWithShade):
1956
1964
  tolerance: The minimum difference between the coordinate values of two
1957
1965
  faces at which they can be considered centered adjacent. Default: 0.01,
1958
1966
  suitable for objects in meters.
1967
+ remove_mismatched_sub_faces: Boolean to note whether any mis-matches
1968
+ in sub-faces between adjacent rooms should simply result in
1969
+ the sub-faces being removed rather than raising an
1970
+ exception. (Default: False).
1959
1971
 
1960
1972
  Returns:
1961
1973
  A dictionary of information about the objects that had their adjacency set.
@@ -1989,7 +2001,15 @@ class Room(_BaseWithShade):
1989
2001
  if not isinstance(face_2.boundary_condition, Surface):
1990
2002
  if face_1.geometry.is_centered_adjacent(
1991
2003
  face_2.geometry, tolerance):
1992
- face_info = face_1.set_adjacency(face_2)
2004
+ if not remove_mismatched_sub_faces:
2005
+ face_info = face_1.set_adjacency(face_2)
2006
+ else:
2007
+ try:
2008
+ face_info = face_1.set_adjacency(face_2)
2009
+ except AssertionError:
2010
+ face_1[0].remove_sub_faces()
2011
+ face_2.remove_sub_faces()
2012
+ face_info = face_1.set_adjacency(face_2)
1993
2013
  adj_info['adjacent_faces'].append((face_1, face_2))
1994
2014
  adj_info['adjacent_apertures'].extend(
1995
2015
  face_info['adjacent_apertures'])
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: honeybee-core
3
- Version: 1.61.29
3
+ Version: 1.61.31
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
@@ -14,8 +14,8 @@ Classifier: License :: OSI Approved :: GNU Affero General Public License v3
14
14
  Classifier: Operating System :: OS Independent
15
15
  Description-Content-Type: text/markdown
16
16
  License-File: LICENSE
17
- Requires-Dist: ladybug-core==0.44.19
18
- Requires-Dist: ladybug-geometry-polyskel==1.7.30
17
+ Requires-Dist: ladybug-core==0.44.20
18
+ Requires-Dist: ladybug-geometry-polyskel==1.7.31
19
19
  Requires-Dist: honeybee-schema==1.59.0; python_version >= "3.7"
20
20
 
21
21
  ![Honeybee](https://www.ladybug.tools/assets/img/honeybee.png)
@@ -13,13 +13,13 @@ honeybee/config.py,sha256=auH_ooOyqMKAeBZxUc2NGUehUcYg8SHya98b5hfNlvM,13836
13
13
  honeybee/dictutil.py,sha256=cOqkhgJSQ3MviIkqOPv8MRb-N-BeDv07cVcNg7w7nLY,1992
14
14
  honeybee/door.py,sha256=xbdefvnPPhwWzU66SpNL1C1A1YW5CNC8sLRabFZUf4E,28571
15
15
  honeybee/extensionutil.py,sha256=DDQYhM7tFD3avRSCOjwTzLqX9ldUxl5GzY79V3_sATE,9644
16
- honeybee/face.py,sha256=nHQ4WZnUTrbRgCxMWgz2Td71dGFGi1krxDpMyjdAHxE,107930
16
+ honeybee/face.py,sha256=RTd5NGqV-RXHqLEpKpANXp9Wi2HcDRp2AtEbPy2pqmc,108049
17
17
  honeybee/facetype.py,sha256=vCtWZKHp21RH-Yzs8zsHJHuFhJvczNh0yFl8wDe_RWY,4489
18
18
  honeybee/logutil.py,sha256=2gn-6RcWqFLvwdFzBHPqUwFqTj_R3iwHKALrl-2eL7M,2564
19
- honeybee/model.py,sha256=RZhj195_Nr5jlUauEOo7H5ZdNZDdKyBb2kwhDxRB1oI,175099
19
+ honeybee/model.py,sha256=ambWe1xR36gm5IE10l6At1K5OgVQGKht0xJb9MjeU_I,176146
20
20
  honeybee/orientation.py,sha256=GogGblASW9OU-fobfDaQ7w5yRbEAFdJJuHwg2fadhKI,5046
21
21
  honeybee/properties.py,sha256=fnlT71in22HpFQGD8ta5kXNnSZVXwXq5cNgvD-hrMRg,33462
22
- honeybee/room.py,sha256=lZZR_ZIpu3ZatnlRSZe4mjirkfJo8FCwRQmgsuR-6d8,150193
22
+ honeybee/room.py,sha256=FbBaaxoG-ZlHjtIoLng49_9NTEu5nJPdhspmP_Kz4wE,151558
23
23
  honeybee/search.py,sha256=OiXibGGVb1ff4gTn_768i-sehB-zAYG12c0o3B0RjKE,4718
24
24
  honeybee/shade.py,sha256=GSlceN2kpo8NOc_QkvvxEhKozRytOS8InZ1Ge0fPuko,19746
25
25
  honeybee/shademesh.py,sha256=oldugnwhu-ibX9f0hfxpO-DvgM8U7S-dYwUjBSVzo4g,13273
@@ -28,7 +28,7 @@ honeybee/units.py,sha256=_qG_G5b9hdqjpyVOpGdIYCB6k8VKYjcxSJn1St-7Xjc,3204
28
28
  honeybee/cli/__init__.py,sha256=nYyTV_HapGo-a1XZLZps9__Bqp50YJYzHZ1LzHp4TJU,3675
29
29
  honeybee/cli/compare.py,sha256=CxOtGnaDkc9ACt6MgkQBUcNuP0aBS4Kb7vsWDYnRnY8,6544
30
30
  honeybee/cli/create.py,sha256=6KmnetAzhwrCuAIDZnySbEKnEssPIxJ72JK-51fBCKU,13067
31
- honeybee/cli/edit.py,sha256=Iost_FqgUGbTWQL0jhn5aPWCQnsX8QxxUUrClUWMjao,27579
31
+ honeybee/cli/edit.py,sha256=h2aHMgeuDibjQzSmsF3WcN0op2j_xyt2sh2BuaDO0Fk,27614
32
32
  honeybee/cli/lib.py,sha256=8udazsVycqMHfk5ZQIOvy4tKM3FuSzjMPCeMuFC2rck,4436
33
33
  honeybee/cli/setconfig.py,sha256=S7DfatGyIPkHxImBDyT9JUhKGuflmd3h5nMfVbzcg9g,1428
34
34
  honeybee/cli/validate.py,sha256=aPOShUwjw8CLeqU52IgVzupEbwl8wKWJtn3RIn-UEB0,10389
@@ -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.61.29.dist-info/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
44
- honeybee_core-1.61.29.dist-info/METADATA,sha256=0l4YuUVBPOUDCe2YUVGKKqyuy2a7o-InbvwQOV0ntcM,3317
45
- honeybee_core-1.61.29.dist-info/WHEEL,sha256=AHX6tWk3qWuce7vKLrj7lnulVHEdWoltgauo8bgCXgU,109
46
- honeybee_core-1.61.29.dist-info/entry_points.txt,sha256=r3YqOm40goBroH3ccUhpwQjvTwu10JWLd0HIRHI1J8E,47
47
- honeybee_core-1.61.29.dist-info/top_level.txt,sha256=8ve7puCRLUA9XDEGc1Mcs-UX9sFjpPV8MeTaIMwQ_Tg,9
48
- honeybee_core-1.61.29.dist-info/RECORD,,
43
+ honeybee_core-1.61.31.dist-info/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
44
+ honeybee_core-1.61.31.dist-info/METADATA,sha256=r5jx4vCztJb9wlAMfSdxNlBcToYkUiLZiO6fftco_mY,3317
45
+ honeybee_core-1.61.31.dist-info/WHEEL,sha256=AHX6tWk3qWuce7vKLrj7lnulVHEdWoltgauo8bgCXgU,109
46
+ honeybee_core-1.61.31.dist-info/entry_points.txt,sha256=r3YqOm40goBroH3ccUhpwQjvTwu10JWLd0HIRHI1J8E,47
47
+ honeybee_core-1.61.31.dist-info/top_level.txt,sha256=8ve7puCRLUA9XDEGc1Mcs-UX9sFjpPV8MeTaIMwQ_Tg,9
48
+ honeybee_core-1.61.31.dist-info/RECORD,,