honeybee_plus.dataoperation module

Collection of functions for data operation.

honeybee_plus.dataoperation.flatten(input_list)[source]

Return a flattened genertor from an input list.

Usage:

input_list = [[‘a’], [‘b’, ‘c’, ‘d’], [[‘e’]], [‘f’]] list(flatten(input_list)) >> [‘a’, ‘b’, ‘c’, ‘d’, ‘e’, ‘f’]

honeybee_plus.dataoperation.flatten_tuple_list(input_list)[source]

Return a flattened generator from an input list of (x, y, z) tuples.

Usage:

input_list = [[(0, 0, 0)], [(10, 0, 0), (10, 10, 0)]] print(list(flattenPointList(input_list)))

>> [(0, 0, 0), (10, 0, 0), (10, 10, 0)]

honeybee_plus.dataoperation.match_data(guide, follower, none_value=(0, 0, 1))[source]

Match data between two lists and reomove None values.

Parameters
  • guide – Long list.

  • follower – Short list.

  • noneValue – Place holder for alternative values for None values in shortlist.

honeybee_plus.dataoperation.match_points_and_vectors(pts_t, vec_t)[source]

Convert list fo data to list.

Parameters
  • pts_t – List of lists of test points.

  • vec_t – List of lists of vectors.

Returns

Nested list of points vectors: Nested list of vectors

Return type

pts

honeybee_plus.dataoperation.unflatten(guide, falttened_input)[source]

Unflatten a falttened generator.

Parameters
  • guide – A guide list to follow the structure

  • falttened_input – A flattened iterator object

Usage:

guide = iter([[“a”], [“b”,”c”,”d”], [[“e”]], [“f”]]) input_list = [0, 1, 2, 3, 4, 5, 6, 7] unflatten(guide, iter(input_list)) >> [[0], [1, 2, 3], [[4]], [5]]