From b76458f9447965e19f5acc1fd23df1f6b11d603c Mon Sep 17 00:00:00 2001 From: Mikkel Pedersen Date: Fri, 17 Mar 2023 11:56:03 +0100 Subject: [PATCH] fix(octree): Add separate static octree --- pollination/honeybee_radiance/octree.py | 26 ++++++++++++++++++++++ tests/octree_test.py | 29 ++++++++++++++++++++++++- 2 files changed, 54 insertions(+), 1 deletion(-) diff --git a/pollination/honeybee_radiance/octree.py b/pollination/honeybee_radiance/octree.py index 7a3e15a..9ae02ad 100644 --- a/pollination/honeybee_radiance/octree.py +++ b/pollination/honeybee_radiance/octree.py @@ -143,3 +143,29 @@ def create_octree(self): scene_info = Outputs.list( description='Output octree files list.', path='octree/trans_info.json' ) + + +@dataclass +class CreateOctreeStatic(Function): + """Generate an octree from a Radiance folder.""" + + # inputs + model = Inputs.folder(description='Path to Radiance model folder.', path='model') + + @command + def create_octree(self): + return 'honeybee-radiance octree from-folder-static model ' \ + '--output scene.oct' + + +@dataclass +class CreateOctreeWithSkyStatic(CreateOctreeStatic): + """Generate an octree from a Radiance folder and a sky.""" + + # inputs + sky = Inputs.file(description='Path to sky file.', path='sky.sky') + + @command + def create_octree(self): + return 'honeybee-radiance octree from-folder-static model ' \ + '--output scene.oct --add-before sky.sky' diff --git a/tests/octree_test.py b/tests/octree_test.py index a5716f9..594d09c 100644 --- a/tests/octree_test.py +++ b/tests/octree_test.py @@ -1,4 +1,7 @@ -from pollination.honeybee_radiance.octree import CreateOctree, CreateOctreeWithSky +from pollination.honeybee_radiance.octree import CreateOctree, \ + CreateOctreeWithSky, CreateOctreeAbstractedGroups, \ + CreateOctreeShadeTransmittance, CreateOctreeStatic, \ + CreateOctreeWithSkyStatic from queenbee.plugin.function import Function @@ -12,3 +15,27 @@ def test_create_octree_with_sky(): function = CreateOctreeWithSky().queenbee assert function.name == 'create-octree-with-sky' assert isinstance(function, Function) + + +def test_create_octree_abstracted_groups(): + function = CreateOctreeAbstractedGroups().queenbee + assert function.name == 'create-octree-abstracted-groups' + assert isinstance(function, Function) + + +def test_create_octree_shade_transmittance(): + function = CreateOctreeShadeTransmittance().queenbee + assert function.name == 'create-octree-shade-transmittance' + assert isinstance(function, Function) + + +def test_create_octree_static(): + function = CreateOctreeStatic().queenbee + assert function.name == 'create-octree-static' + assert isinstance(function, Function) + + +def test_create_octree_with_sky_static(): + function = CreateOctreeWithSkyStatic().queenbee + assert function.name == 'create-octree-with-sky-static' + assert isinstance(function, Function)