@@ -602,8 +602,8 @@ def genShade(subs=None) -> bool:
602602 A list of sub surfaces.
603603
604604 Returns:
605- True: If successfully generated shade .
606- False: if invalid input (see logs).
605+ True: If shade successfully generated.
606+ False: If invalid input (see logs).
607607
608608 """
609609 # Filter OpenStudio warnings for ShadingControl:
@@ -612,10 +612,9 @@ def genShade(subs=None) -> bool:
612612 # openstudio.Logger().instance().standardOutLogger().setChannelRegex(str)
613613
614614 mth = "osut.genShade"
615- v = int ("" .join (openstudio .openStudioVersion ().split ("." )))
616- cl = openstudio .model .SubSurfaceVector
615+ cl = openstudio .model .SubSurfaceVector
617616
618- if v < 321 :
617+ if int ( "" . join ( openstudio . openStudioVersion (). split ( "." ))) < 321 :
619618 return False
620619 if not isinstance (subs , cl ):
621620 return oslg .mismatch ("subs" , subs , cl , mth , CN .DBG , False )
@@ -779,8 +778,7 @@ def genMass(sps=None, ratio=2.0) -> bool:
779778
780779
781780def holdsConstruction (set = None , base = None , gr = False , ex = False , type = "" ):
782- """Validates whether a default construction set holds an opaque base
783- construction.
781+ """Validates whether a default construction set holds a base construction.
784782
785783 Args:
786784 set (openstudio.model.DefaultConstructionSet):
@@ -802,11 +800,15 @@ def holdsConstruction(set=None, base=None, gr=False, ex=False, type=""):
802800 mth = "osut.holdsConstruction"
803801 cl1 = openstudio .model .DefaultConstructionSet
804802 cl2 = openstudio .model .ConstructionBase
803+ t1 = openstudio .model .Surface .validSurfaceTypeValues ()
804+ t2 = openstudio .model .SubSurface .validSubSurfaceTypeValues ()
805+ t1 = [t .lower () for t in t1 ]
806+ t2 = [t .lower () for t in t2 ]
805807
806808 if not isinstance (set , cl1 ):
807- return oslg .invalid ("set" , mth , 1 , CN .DBG , False )
809+ return oslg .mismatch ("set" , set , cl1 , mth , CN .DBG , False )
808810 if not isinstance (base , cl2 ):
809- return oslg .invalid ("base" , mth , 2 , CN .DBG , False )
811+ return oslg .mismatch ("base" , base , cl2 , mth , CN .DBG , False )
810812 if gr not in [True , False ]:
811813 return oslg .invalid ("ground" , mth , 3 , CN .DBG , False )
812814 if ex not in [True , False ]:
@@ -819,7 +821,7 @@ def holdsConstruction(set=None, base=None, gr=False, ex=False, type=""):
819821
820822 type = type .lower ()
821823
822- if type not in [ "floor" , "wall" , "roofceiling" ] :
824+ if type not in ( t1 + t2 ) :
823825 return oslg .invalid ("surface type" , mth , 5 , CN .DBG , False )
824826
825827 constructions = None
0 commit comments