honeybee-radiance-postprocess 0.4.209__py2.py3-none-any.whl → 0.4.210__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,6 +7,7 @@ import numpy as np
7
7
  from pathlib import Path
8
8
 
9
9
  from honeybee_radiance_postprocess.reader import binary_to_array
10
+ from ..annualdaylight import _annual_daylight_vis_metadata
10
11
 
11
12
  _logger = logging.getLogger(__name__)
12
13
 
@@ -66,7 +67,13 @@ def merge_grid_folder(input_folder, output_folder, extension, dist_info):
66
67
  '. Alternatively, the command will look for a _redist_info.json file inside the '
67
68
  'folder.', type=click.Path(file_okay=True, dir_okay=False, resolve_path=True)
68
69
  )
69
- def merge_metrics_folder(input_folder, output_folder, dist_info):
70
+ @click.option(
71
+ '--grids-info', '-gi',
72
+ help='An optional input for grid information that will be copied to each '
73
+ 'metric folder. This file is usually called grids_info.json.',
74
+ type=click.Path(file_okay=True, dir_okay=False, resolve_path=True)
75
+ )
76
+ def merge_metrics_folder(input_folder, output_folder, dist_info, grids_info):
70
77
  """Restructure annual daylight metrics in a distributed folder.
71
78
 
72
79
  Since this command redistributes metrics it is expected that the input
@@ -81,6 +88,9 @@ def merge_metrics_folder(input_folder, output_folder, dist_info):
81
88
  # handle optional case for Functions input
82
89
  if dist_info and not Path(dist_info).is_file():
83
90
  dist_info = None
91
+ if grids_info:
92
+ with open(grids_info) as gi:
93
+ grids_info = json.load(gi)
84
94
  extension_mapper = {
85
95
  'da': 'da',
86
96
  'cda': 'cda',
@@ -88,12 +98,22 @@ def merge_metrics_folder(input_folder, output_folder, dist_info):
88
98
  'udi_lower': 'udi',
89
99
  'udi_upper': 'udi'
90
100
  }
101
+ metric_info_dict = _annual_daylight_vis_metadata()
91
102
  input_folder = Path(input_folder)
92
- for metric in ['da', 'cda', 'udi', 'udi_lower', 'udi_upper']:
93
- extension = extension_mapper[metric]
103
+ output_folder = Path(output_folder)
104
+ for metric, extension in extension_mapper.items():
94
105
  metric_folder = input_folder.joinpath(metric)
106
+ metric_out = output_folder.joinpath(metric)
95
107
  restore_original_distribution_metrics(
96
108
  metric_folder, output_folder, metric, extension, dist_info)
109
+
110
+ if grids_info:
111
+ info_file = metric_out.joinpath('grids_info.json')
112
+ info_file.write_text(json.dumps(grids_info))
113
+
114
+ vis_data = metric_info_dict[metric]
115
+ vis_metadata_file = metric_out.joinpath('vis_metadata.json')
116
+ vis_metadata_file.write_text(json.dumps(vis_data, indent=4))
97
117
  except Exception:
98
118
  _logger.exception('Failed to restructure data from folder.')
99
119
  sys.exit(1)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: honeybee-radiance-postprocess
3
- Version: 0.4.209
3
+ Version: 0.4.210
4
4
  Summary: Postprocessing of Radiance results and matrices
5
5
  Home-page: https://github.com/ladybug-tools/honeybee-radiance-postprocess
6
6
  Author: Ladybug Tools
@@ -12,7 +12,7 @@ honeybee_radiance_postprocess/results.py,sha256=oAOgorlzLrOlHKXR7T8D7jKvVQzwkN0r
12
12
  honeybee_radiance_postprocess/type_hints.py,sha256=hn1Mro_RCm_6tf3ZZWeLesLY7_3vKvXPtrGWedfqyZs,898
13
13
  honeybee_radiance_postprocess/util.py,sha256=ihUwSpMw-C2IkCgCOq5gVCOExa7idKZjWBWFKjfEv7I,5425
14
14
  honeybee_radiance_postprocess/cli/__init__.py,sha256=4RkpR91GPXWatDE4I_27ce-N4FwolQoO6WO7H24DMXE,777
15
- honeybee_radiance_postprocess/cli/grid.py,sha256=981xo_QMMZtTIyKZ-ZyXz1nVz0evOaQt2zrNoJNtUgI,7896
15
+ honeybee_radiance_postprocess/cli/grid.py,sha256=t0JJtRaGSzEJ6PtpzceNMDUo_e7Pv-JH1j-F0GacoNU,8785
16
16
  honeybee_radiance_postprocess/cli/leed.py,sha256=o10tYnp_eRLEX7QV6jHj6cVRQA_6zYg_v9bZGbHo3eo,3082
17
17
  honeybee_radiance_postprocess/cli/mtxop.py,sha256=UZJnjNpPjDmShy1-Mxos4H2vTUqk_yP3ZyaC1_LLFeI,5015
18
18
  honeybee_radiance_postprocess/cli/postprocess.py,sha256=m_eMuRPogN1rUNcIY2bzbBFX3BW2-G-Vb3n0TgR-ViQ,24521
@@ -20,9 +20,9 @@ honeybee_radiance_postprocess/cli/schedule.py,sha256=OokuuH9_pdgkt2zFgfjBvrV2Fj1
20
20
  honeybee_radiance_postprocess/cli/translate.py,sha256=tMyFcT80_NXhNIMH1Nn-10dRrk534NRl-_L-mK-0sHQ,4031
21
21
  honeybee_radiance_postprocess/cli/two_phase.py,sha256=O0ugIQh0MOAEl3Q8IsZU4IQ8jNPPOOfeqs5ccwlix6Q,4559
22
22
  honeybee_radiance_postprocess/cli/util.py,sha256=Be9cGmYhcV2W37ma6SgQPCWCpWLLLlroxRYN_l58kY0,4077
23
- honeybee_radiance_postprocess-0.4.209.dist-info/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
24
- honeybee_radiance_postprocess-0.4.209.dist-info/METADATA,sha256=oZpkacrkA1YkucQHpxm6W0R7ZE3Ih7BiyIjq5kPo0OA,2229
25
- honeybee_radiance_postprocess-0.4.209.dist-info/WHEEL,sha256=unfA4MOaH0icIyIA5oH6E2sn2Hq5zKtLlHsWapZGwes,110
26
- honeybee_radiance_postprocess-0.4.209.dist-info/entry_points.txt,sha256=gFtVPx6UItXt27GfEZZO00eOZChJJEL6JwGSAB_O3rs,96
27
- honeybee_radiance_postprocess-0.4.209.dist-info/top_level.txt,sha256=4-sFbzy7ewP2EDqJV3jeFlAFx7SuxtoBBELWaKAnLdA,30
28
- honeybee_radiance_postprocess-0.4.209.dist-info/RECORD,,
23
+ honeybee_radiance_postprocess-0.4.210.dist-info/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
24
+ honeybee_radiance_postprocess-0.4.210.dist-info/METADATA,sha256=0QJvSYGS7rBQyInDAISeXZcU4-i2iPBkxxpREHDTvDA,2229
25
+ honeybee_radiance_postprocess-0.4.210.dist-info/WHEEL,sha256=unfA4MOaH0icIyIA5oH6E2sn2Hq5zKtLlHsWapZGwes,110
26
+ honeybee_radiance_postprocess-0.4.210.dist-info/entry_points.txt,sha256=gFtVPx6UItXt27GfEZZO00eOZChJJEL6JwGSAB_O3rs,96
27
+ honeybee_radiance_postprocess-0.4.210.dist-info/top_level.txt,sha256=4-sFbzy7ewP2EDqJV3jeFlAFx7SuxtoBBELWaKAnLdA,30
28
+ honeybee_radiance_postprocess-0.4.210.dist-info/RECORD,,