honeybee_vtk.config module¶
Data json schema and validation.
- class honeybee_vtk.config.Autocalculate(*, type: honeybee_vtk.config.ConstrainedStrValue = 'Autocalculate')[source]¶
Bases:
pydantic.main.BaseModel
- Config¶
alias of
pydantic.main.BaseConfig
- classmethod construct(_fields_set: Optional[SetStr] = None, **values: Any) Model ¶
Creates a new model setting __dict__ and __fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed. Behaves as if Config.extra = ‘allow’ was set since it adds all passed values
- copy(*, include: Union[AbstractSetIntStr, MappingIntStrAny] = None, exclude: Union[AbstractSetIntStr, MappingIntStrAny] = None, update: DictStrAny = None, deep: bool = False) Model ¶
Duplicate a model, optionally choose which fields to include, exclude and change.
- Parameters
include – fields to include in new model
exclude – fields to exclude from new model, as with values this takes precedence over include
update – values to change/add in the new model. Note: the data is not validated before creating the new model: you should trust this data
deep – set to True to make a deep copy of the model
- Returns
new model instance
- dict(*, include: Union[AbstractSetIntStr, MappingIntStrAny] = None, exclude: Union[AbstractSetIntStr, MappingIntStrAny] = None, by_alias: bool = False, skip_defaults: bool = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False) DictStrAny ¶
Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.
- classmethod from_orm(obj: Any) Model ¶
- json(*, include: Union[AbstractSetIntStr, MappingIntStrAny] = None, exclude: Union[AbstractSetIntStr, MappingIntStrAny] = None, by_alias: bool = False, skip_defaults: bool = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, encoder: Optional[Callable[[Any], Any]] = None, **dumps_kwargs: Any) unicode ¶
Generate a JSON representation of the model, include and exclude arguments as per dict().
encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().
- classmethod parse_file(path: Union[str, pathlib.Path], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: pydantic.parse.Protocol = None, allow_pickle: bool = False) Model ¶
- classmethod parse_obj(obj: Any) Model ¶
- classmethod parse_raw(b: Union[str, bytes], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: pydantic.parse.Protocol = None, allow_pickle: bool = False) Model ¶
- classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') DictStrAny ¶
- classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) unicode ¶
- classmethod update_forward_refs(**localns: Any) None ¶
Try to update ForwardRefs on fields based on this Model, globalns and localns.
- classmethod validate(value: Any) Model ¶
- type: honeybee_vtk.config.ConstrainedStrValue¶
- class honeybee_vtk.config.DataConfig(*, identifier: str, object_type: honeybee_vtk.types.DataSetNames, unit: str, path: str, hide: bool = False, legend_parameters: honeybee_vtk.config.LegendConfig = LegendConfig(color_set=<ColorSets.ecotect: 'ecotect'>, min=Autocalculate(type='Autocalculate'), max=Autocalculate(type='Autocalculate'), hide_legend=False, orientation=<Orientation.horizontal: 'horizontal'>, width=0.45, height=0.05, position=[0.5, 0.1], color_count=Autocalculate(type='Autocalculate'), label_count=Autocalculate(type='Autocalculate'), decimal_count=<DecimalCount.default: 'default'>, preceding_labels=False, label_parameters=TextConfig(color=[0, 0, 0], size=0, bold=False), title_parameters=TextConfig(color=[0, 0, 0], size=0, bold=True)))[source]¶
Bases:
pydantic.main.BaseModel
Config for simulation results you’d like to load on a honeybee-vtk model.
- Config¶
alias of
pydantic.main.BaseConfig
- classmethod check_pos_against_width_height(v: honeybee_vtk.config.LegendConfig, values) honeybee_vtk.config.LegendConfig [source]¶
- classmethod construct(_fields_set: Optional[SetStr] = None, **values: Any) Model ¶
Creates a new model setting __dict__ and __fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed. Behaves as if Config.extra = ‘allow’ was set since it adds all passed values
- copy(*, include: Union[AbstractSetIntStr, MappingIntStrAny] = None, exclude: Union[AbstractSetIntStr, MappingIntStrAny] = None, update: DictStrAny = None, deep: bool = False) Model ¶
Duplicate a model, optionally choose which fields to include, exclude and change.
- Parameters
include – fields to include in new model
exclude – fields to exclude from new model, as with values this takes precedence over include
update – values to change/add in the new model. Note: the data is not validated before creating the new model: you should trust this data
deep – set to True to make a deep copy of the model
- Returns
new model instance
- dict(*, include: Union[AbstractSetIntStr, MappingIntStrAny] = None, exclude: Union[AbstractSetIntStr, MappingIntStrAny] = None, by_alias: bool = False, skip_defaults: bool = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False) DictStrAny ¶
Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.
- classmethod from_orm(obj: Any) Model ¶
- json(*, include: Union[AbstractSetIntStr, MappingIntStrAny] = None, exclude: Union[AbstractSetIntStr, MappingIntStrAny] = None, by_alias: bool = False, skip_defaults: bool = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, encoder: Optional[Callable[[Any], Any]] = None, **dumps_kwargs: Any) unicode ¶
Generate a JSON representation of the model, include and exclude arguments as per dict().
encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().
- classmethod parse_file(path: Union[str, pathlib.Path], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: pydantic.parse.Protocol = None, allow_pickle: bool = False) Model ¶
- classmethod parse_obj(obj: Any) Model ¶
- classmethod parse_raw(b: Union[str, bytes], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: pydantic.parse.Protocol = None, allow_pickle: bool = False) Model ¶
- classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') DictStrAny ¶
- classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) unicode ¶
- classmethod update_forward_refs(**localns: Any) None ¶
Try to update ForwardRefs on fields based on this Model, globalns and localns.
- classmethod validate(value: Any) Model ¶
- hide: bool¶
- identifier: str¶
- legend_parameters: honeybee_vtk.config.LegendConfig¶
- object_type: honeybee_vtk.types.DataSetNames¶
- path: str¶
- unit: str¶
- class honeybee_vtk.config.LegendConfig(*, color_set: honeybee_vtk.legend_parameter.ColorSets = ColorSets.ecotect, min: Union[honeybee_vtk.config.Autocalculate, float] = Autocalculate(type='Autocalculate'), max: Union[honeybee_vtk.config.Autocalculate, float] = Autocalculate(type='Autocalculate'), hide_legend: bool = False, orientation: honeybee_vtk.legend_parameter.Orientation = Orientation.horizontal, width: honeybee_vtk.config.ConstrainedFloatValue = 0.45, height: honeybee_vtk.config.ConstrainedFloatValue = 0.05, position: types.ConstrainedListValue[honeybee_vtk.config.ConstrainedFloatValue] = [0.5, 0.1], color_count: Union[honeybee_vtk.config.Autocalculate, int] = Autocalculate(type='Autocalculate'), label_count: Union[honeybee_vtk.config.Autocalculate, int] = Autocalculate(type='Autocalculate'), decimal_count: honeybee_vtk.legend_parameter.DecimalCount = DecimalCount.default, preceding_labels: bool = False, label_parameters: honeybee_vtk.config.TextConfig = TextConfig(color=[0, 0, 0], size=0, bold=False), title_parameters: honeybee_vtk.config.TextConfig = TextConfig(color=[0, 0, 0], size=0, bold=True))[source]¶
Bases:
pydantic.main.BaseModel
Config for the legend to be created from a dataset.
- classmethod construct(_fields_set: Optional[SetStr] = None, **values: Any) Model ¶
Creates a new model setting __dict__ and __fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed. Behaves as if Config.extra = ‘allow’ was set since it adds all passed values
- copy(*, include: Union[AbstractSetIntStr, MappingIntStrAny] = None, exclude: Union[AbstractSetIntStr, MappingIntStrAny] = None, update: DictStrAny = None, deep: bool = False) Model ¶
Duplicate a model, optionally choose which fields to include, exclude and change.
- Parameters
include – fields to include in new model
exclude – fields to exclude from new model, as with values this takes precedence over include
update – values to change/add in the new model. Note: the data is not validated before creating the new model: you should trust this data
deep – set to True to make a deep copy of the model
- Returns
new model instance
- dict(*, include: Union[AbstractSetIntStr, MappingIntStrAny] = None, exclude: Union[AbstractSetIntStr, MappingIntStrAny] = None, by_alias: bool = False, skip_defaults: bool = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False) DictStrAny ¶
Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.
- classmethod from_orm(obj: Any) Model ¶
- json(*, include: Union[AbstractSetIntStr, MappingIntStrAny] = None, exclude: Union[AbstractSetIntStr, MappingIntStrAny] = None, by_alias: bool = False, skip_defaults: bool = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, encoder: Optional[Callable[[Any], Any]] = None, **dumps_kwargs: Any) unicode ¶
Generate a JSON representation of the model, include and exclude arguments as per dict().
encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().
- classmethod parse_file(path: Union[str, pathlib.Path], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: pydantic.parse.Protocol = None, allow_pickle: bool = False) Model ¶
- classmethod parse_obj(obj: Any) Model ¶
- classmethod parse_raw(b: Union[str, bytes], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: pydantic.parse.Protocol = None, allow_pickle: bool = False) Model ¶
- classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') DictStrAny ¶
- classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) unicode ¶
- classmethod update_forward_refs(**localns: Any) None ¶
Try to update ForwardRefs on fields based on this Model, globalns and localns.
- classmethod validate(value: Any) Model ¶
- color_count: Union[honeybee_vtk.config.Autocalculate, int]¶
- color_set: honeybee_vtk.legend_parameter.ColorSets¶
- decimal_count: honeybee_vtk.legend_parameter.DecimalCount¶
- height: honeybee_vtk.config.ConstrainedFloatValue¶
- hide_legend: bool¶
- label_count: Union[honeybee_vtk.config.Autocalculate, int]¶
- label_parameters: honeybee_vtk.config.TextConfig¶
- max: Union[honeybee_vtk.config.Autocalculate, float]¶
- min: Union[honeybee_vtk.config.Autocalculate, float]¶
- orientation: honeybee_vtk.legend_parameter.Orientation¶
- position: types.ConstrainedListValue[honeybee_vtk.config.ConstrainedFloatValue]¶
- preceding_labels: bool¶
- title_parameters: honeybee_vtk.config.TextConfig¶
- width: honeybee_vtk.config.ConstrainedFloatValue¶
- class honeybee_vtk.config.TextConfig(*, color: List[honeybee_vtk.config.ConstrainedIntValue] = [0, 0, 0], size: honeybee_vtk.config.ConstrainedIntValue = 0, bold: bool = False)[source]¶
Bases:
pydantic.main.BaseModel
Config for the text to be used in a legend.
This object applies to text for legend title and legend labels as well.
- classmethod construct(_fields_set: Optional[SetStr] = None, **values: Any) Model ¶
Creates a new model setting __dict__ and __fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed. Behaves as if Config.extra = ‘allow’ was set since it adds all passed values
- copy(*, include: Union[AbstractSetIntStr, MappingIntStrAny] = None, exclude: Union[AbstractSetIntStr, MappingIntStrAny] = None, update: DictStrAny = None, deep: bool = False) Model ¶
Duplicate a model, optionally choose which fields to include, exclude and change.
- Parameters
include – fields to include in new model
exclude – fields to exclude from new model, as with values this takes precedence over include
update – values to change/add in the new model. Note: the data is not validated before creating the new model: you should trust this data
deep – set to True to make a deep copy of the model
- Returns
new model instance
- dict(*, include: Union[AbstractSetIntStr, MappingIntStrAny] = None, exclude: Union[AbstractSetIntStr, MappingIntStrAny] = None, by_alias: bool = False, skip_defaults: bool = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False) DictStrAny ¶
Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.
- classmethod from_orm(obj: Any) Model ¶
- json(*, include: Union[AbstractSetIntStr, MappingIntStrAny] = None, exclude: Union[AbstractSetIntStr, MappingIntStrAny] = None, by_alias: bool = False, skip_defaults: bool = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, encoder: Optional[Callable[[Any], Any]] = None, **dumps_kwargs: Any) unicode ¶
Generate a JSON representation of the model, include and exclude arguments as per dict().
encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().
- classmethod parse_file(path: Union[str, pathlib.Path], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: pydantic.parse.Protocol = None, allow_pickle: bool = False) Model ¶
- classmethod parse_obj(obj: Any) Model ¶
- classmethod parse_raw(b: Union[str, bytes], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: pydantic.parse.Protocol = None, allow_pickle: bool = False) Model ¶
- classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') DictStrAny ¶
- classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) unicode ¶
- classmethod update_forward_refs(**localns: Any) None ¶
Try to update ForwardRefs on fields based on this Model, globalns and localns.
- classmethod validate(value: Any) Model ¶
- bold: bool¶
- color: List[honeybee_vtk.config.ConstrainedIntValue]¶
- size: honeybee_vtk.config.ConstrainedIntValue¶
- honeybee_vtk.config.load_config(json_path: str, model: honeybee_vtk.model.Model, scene: honeybee_vtk.scene.Scene, validation: bool = False, legend: bool = False) honeybee_vtk.model.Model [source]¶
Mount data on model from config json.
- Parameters
json_path – File path to the config json file.
model – A honeybee-vtk model object.
scene – A honeybee-vtk scene object.
validation – A boolean indicating whether to validate the data before loading.
legend – A boolean indicating whether to load legend parameters.
- Returns
A honeybee-vtk model with data loaded on it.