class CreateRadiantEnclosureInfo(Function):
    """Create JSONs with radiant enclosure information from a HBJSON input file.

    This enclosure info is intended to be consumed by thermal mapping functions.
    """

    model = Inputs.file(description='Path to input HBJSON file.',
                        path='model.hbjson')

    @command
    def hbjson_to_radiant_enclosure_info(self):
        return 'honeybee-radiance translate model-radiant-enclosure-info model.hbjson ' \
            '--folder output --log-file enclosure_list.json'

    enclosure_list = Outputs.dict(
        description=
        'A list of dictionaries that include information about generated '
        'radiant enclosure files.',
        path='enclosure_list.json')

    enclosure_list_file = Outputs.file(
        description=
        'A JSON file that includes information about generated radiant '
        'enclosure files.',
        path='enclosure_list.json')

    output_folder = Outputs.folder(
        description=
        'Output folder with the enclosure info JSONs for each grid.',
        path='output')
Beispiel #2
0
class BaselineOrientationSimPars(Function):
    """Get SimulationParameters with different north angles for a baseline building sim.
    """

    ddy = Inputs.file(
        description='A DDY file with design days to be included in the '
        'SimulationParameter',
        path='input.ddy',
        extensions=['ddy'])

    run_period = Inputs.str(
        description=
        'An AnalysisPeriod string or an IDF RunPeriod string to set the '
        'start and end dates of the simulation (eg. "6/21 to 9/21 between 0 and 23 @1").'
        ' If None, the simulation will be annual.',
        default='')

    north = Inputs.int(
        description=
        'A number from -360 to 360 for the counterclockwise difference '
        'between North and the positive Y-axis in degrees. 90 is west; 270 is east',
        default=0,
        spec={
            'type': 'integer',
            'maximum': 360,
            'minimum': -360
        })

    filter_des_days = Inputs.str(
        description=
        'A switch for whether the ddy-file should be filtered to only '
        'include 99.6 and 0.4 design days',
        default='filter-des-days',
        spec={
            'type': 'string',
            'enum': ['filter-des-days', 'all-des-days']
        })

    @command
    def baseline_orientation_sim_pars(self):
        return 'honeybee-energy settings orientation-sim-pars input.ddy ' \
            '0 90 180 270 --run-period "{{self.run_period}}" --start-north ' \
            '{{self.north}} --{{self.filter_des_days}} --folder output ' \
            '--log-file output/sim_par_info.json'

    sim_par_list = Outputs.dict(
        description=
        'A JSON array that includes information about generated simulation '
        'parameters.',
        path='output/sim_par_info.json')

    output_folder = Outputs.folder(
        description='Output folder with the simulation parameters.',
        path='output')
Beispiel #3
0
class ReadJSON(Function):
    """Read content of a JSON file as a dictionary."""

    src = Inputs.path(description='Path to a input JSON file.',
                      path='input_path')

    @command
    def list_dir(self):
        return 'echo parsing JSON information to a dictionary...'

    data = Outputs.dict(
        description='The content of JSON file as a dictionary.',
        path='input_path')
class ModelToHoneybee(Function):
    """Translate a Dragonfly Model JSON file into several Honeybee Models."""

    model = Inputs.file(description='Dragonfly model in JSON format.',
                        path='model.dfjson',
                        extensions=['dfjson', 'json'])

    obj_per_model = Inputs.str(
        description=
        'Text to describe how the input Model should be divided across the '
        'output Models. Choose from: District, Building, Story.',
        default='Story',
        spec={
            'type': 'string',
            'enum': ['District', 'Building', 'Story']
        })

    use_multiplier = Inputs.str(
        description=
        'A switch to note whether the multipliers on each Building story '
        'should be passed along to the generated Honeybee Room objects or if full '
        'geometry objects should be written for each story in the building.',
        default='full-geometry',
        spec={
            'type': 'string',
            'enum': ['full-geometry', 'multiplier']
        })

    include_plenum = Inputs.str(
        description=
        'A switch to indicate whether ceiling/floor plenums should be '
        'auto-generated for the Rooms.',
        default='no-plenum',
        spec={
            'type': 'string',
            'enum': ['no-plenum', 'plenum']
        })

    shade_dist = Inputs.str(
        description=
        'A number to note the distance beyond which other buildings shade '
        'should be excluded from a given Honeybee Model. This can include the units of '
        'the distance (eg. 100ft) or, if no units are provided, the value will be '
        'interpreted in the dragonfly model units. If 0, shade from all neighboring '
        'buildings will be excluded from the resulting models.',
        default='50m')

    @command
    def model_to_honeybee(self):
        return 'dragonfly translate model-to-honeybee model.dfjson ' \
            '--obj-per-model {{self.obj_per_model}} --{{self.use_multiplier}} ' \
            '--{{self.include_plenum}} --shade-dist {{self.shade_dist}} ' \
            '--folder output --log-file output/hbjson_info.json'

    hbjson_list = Outputs.dict(
        description=
        'A JSON array that includes information about generated honeybee '
        'models.',
        path='output/hbjson_info.json')

    output_folder = Outputs.folder(
        description='Output folder with the output HBJSON models.',
        path='output')