honeybee-radiance-postprocess 0.4.337__py2.py3-none-any.whl → 0.4.340__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.
- honeybee_radiance_postprocess/cli/grid.py +44 -4
- honeybee_radiance_postprocess/cli/postprocess.py +4 -4
- {honeybee_radiance_postprocess-0.4.337.dist-info → honeybee_radiance_postprocess-0.4.340.dist-info}/METADATA +1 -1
- {honeybee_radiance_postprocess-0.4.337.dist-info → honeybee_radiance_postprocess-0.4.340.dist-info}/RECORD +8 -8
- {honeybee_radiance_postprocess-0.4.337.dist-info → honeybee_radiance_postprocess-0.4.340.dist-info}/LICENSE +0 -0
- {honeybee_radiance_postprocess-0.4.337.dist-info → honeybee_radiance_postprocess-0.4.340.dist-info}/WHEEL +0 -0
- {honeybee_radiance_postprocess-0.4.337.dist-info → honeybee_radiance_postprocess-0.4.340.dist-info}/entry_points.txt +0 -0
- {honeybee_radiance_postprocess-0.4.337.dist-info → honeybee_radiance_postprocess-0.4.340.dist-info}/top_level.txt +0 -0
@@ -31,7 +31,28 @@ def grid():
|
|
31
31
|
'. Alternatively, the command will look for a _redist_info.json file inside the '
|
32
32
|
'folder.', type=click.Path(file_okay=True, dir_okay=False, resolve_path=True)
|
33
33
|
)
|
34
|
-
|
34
|
+
@click.option(
|
35
|
+
'--output-extension', '-oe',
|
36
|
+
help='Output file extension. This is only used if as_text is set to True. '
|
37
|
+
'Otherwise the output extension will be npy.', default='ill', type=click.STRING
|
38
|
+
)
|
39
|
+
@click.option(
|
40
|
+
'--as-text', '-at',
|
41
|
+
help='Set to True if the output files should be saved as text instead of '
|
42
|
+
'NumPy files.', default=False, type=click.BOOL
|
43
|
+
)
|
44
|
+
@click.option(
|
45
|
+
'--fmt',
|
46
|
+
help='Format for the output files when saved as text.', default='%.2f',
|
47
|
+
type=click.STRING
|
48
|
+
)
|
49
|
+
@click.option(
|
50
|
+
'--delimiter',
|
51
|
+
help='Delimiter for the output files when saved as text.',
|
52
|
+
type=click.Choice(['space', 'tab']), default='tab'
|
53
|
+
)
|
54
|
+
def merge_grid_folder(input_folder, output_folder, extension, dist_info,
|
55
|
+
output_extension, as_text, fmt, delimiter):
|
35
56
|
"""Restructure files in a distributed folder.
|
36
57
|
|
37
58
|
\b
|
@@ -46,7 +67,9 @@ def merge_grid_folder(input_folder, output_folder, extension, dist_info):
|
|
46
67
|
# handle optional case for Functions input
|
47
68
|
if dist_info and not Path(dist_info).is_file():
|
48
69
|
dist_info = None
|
49
|
-
restore_original_distribution(
|
70
|
+
restore_original_distribution(
|
71
|
+
input_folder, output_folder, extension, dist_info, output_extension,
|
72
|
+
as_text, fmt, delimiter)
|
50
73
|
except Exception:
|
51
74
|
_logger.exception('Failed to restructure data from folder.')
|
52
75
|
sys.exit(1)
|
@@ -122,7 +145,8 @@ def merge_metrics_folder(input_folder, output_folder, dist_info, grids_info):
|
|
122
145
|
|
123
146
|
|
124
147
|
def restore_original_distribution(
|
125
|
-
input_folder, output_folder, extension='npy', dist_info=None
|
148
|
+
input_folder, output_folder, extension='npy', dist_info=None,
|
149
|
+
output_extension='ill', as_text=False, fmt='%.2f', delimiter='tab'):
|
126
150
|
"""Restructure files to the original distribution based on the distribution info.
|
127
151
|
|
128
152
|
It will assume that the files in the input folder are NumPy files. However,
|
@@ -137,6 +161,12 @@ def restore_original_distribution(
|
|
137
161
|
studies.
|
138
162
|
dist_info: Path to dist_info.json file. If None, the function will try to load
|
139
163
|
``_redist_info.json`` file from inside the input_folder. (Default: None).
|
164
|
+
output_extension: Output file extension. This is only used if as_text
|
165
|
+
is set to True. Otherwise the output extension will be ```npy``.
|
166
|
+
as_text: Set to True if the output files should be saved as text instead
|
167
|
+
of NumPy files.
|
168
|
+
fmt: Format for the output files when saved as text.
|
169
|
+
delimiter: Delimiter for the output files when saved as text.
|
140
170
|
"""
|
141
171
|
if not dist_info:
|
142
172
|
_redist_info_file = Path(input_folder, '_redist_info.json')
|
@@ -178,7 +208,17 @@ def restore_original_distribution(
|
|
178
208
|
|
179
209
|
out_array = np.concatenate(out_arrays)
|
180
210
|
# save numpy array, .npy extension is added automatically
|
181
|
-
|
211
|
+
if not as_text:
|
212
|
+
np.save(output_file, out_array)
|
213
|
+
else:
|
214
|
+
if output_extension.startswith('.'):
|
215
|
+
output_extension = output_extension[1:]
|
216
|
+
if delimiter == 'tab':
|
217
|
+
delimiter = '\t'
|
218
|
+
elif delimiter == 'space':
|
219
|
+
delimiter = ' '
|
220
|
+
np.savetxt(output_file.with_suffix(f'.{output_extension}'),
|
221
|
+
out_array, fmt=fmt, delimiter=delimiter)
|
182
222
|
|
183
223
|
|
184
224
|
def restore_original_distribution_metrics(
|
@@ -1042,7 +1042,7 @@ def convert_matrix_to_binary(
|
|
1042
1042
|
def direct_sun_hours(
|
1043
1043
|
input_matrix, divisor, output_folder
|
1044
1044
|
):
|
1045
|
-
"""
|
1045
|
+
"""Post-process a Radiance matrix to direct sun hours and cumulative direct
|
1046
1046
|
sun hours.
|
1047
1047
|
|
1048
1048
|
\b
|
@@ -1058,16 +1058,16 @@ def direct_sun_hours(
|
|
1058
1058
|
try:
|
1059
1059
|
boolean_array = (array > 0) & (array <= np.inf)
|
1060
1060
|
|
1061
|
-
direct_sun_hours_array = boolean_array.astype(
|
1061
|
+
direct_sun_hours_array = boolean_array.astype(np.uint8)
|
1062
1062
|
cumulative_array = direct_sun_hours_array.sum(axis=1) / divisor
|
1063
1063
|
|
1064
1064
|
direct_sun_hours_file = Path(output_folder, 'direct_sun_hours')
|
1065
1065
|
direct_sun_hours_file.parent.mkdir(parents=True, exist_ok=True)
|
1066
1066
|
np.save(direct_sun_hours_file, direct_sun_hours_array)
|
1067
1067
|
|
1068
|
-
cumulative_file = Path(output_folder, 'cumulative')
|
1068
|
+
cumulative_file = Path(output_folder, 'cumulative.res')
|
1069
1069
|
cumulative_file.parent.mkdir(parents=True, exist_ok=True)
|
1070
|
-
np.
|
1070
|
+
np.savetxt(cumulative_file, cumulative_array, fmt='%.2f')
|
1071
1071
|
except Exception:
|
1072
1072
|
_logger.exception('Failed to convert the input file to direct sun hours.')
|
1073
1073
|
sys.exit(1)
|
@@ -13,10 +13,10 @@ honeybee_radiance_postprocess/reader.py,sha256=6myKzfGC1pO8zPixg1kKrKjPihHabTKUh
|
|
13
13
|
honeybee_radiance_postprocess/type_hints.py,sha256=4R0kZgacQrqzoh8Tq7f8MVzUDzynV-C_jlh80UV6GPE,1122
|
14
14
|
honeybee_radiance_postprocess/util.py,sha256=-J5k1dhvyYJkb42jvTS_xxtokfGbmcucVPXdMWU1jUk,5098
|
15
15
|
honeybee_radiance_postprocess/cli/__init__.py,sha256=4RkpR91GPXWatDE4I_27ce-N4FwolQoO6WO7H24DMXE,777
|
16
|
-
honeybee_radiance_postprocess/cli/grid.py,sha256=
|
16
|
+
honeybee_radiance_postprocess/cli/grid.py,sha256=6peLEAPVe-iw05_wdRpFruZLqO8myvC-_QT5W1q5sk8,10677
|
17
17
|
honeybee_radiance_postprocess/cli/leed.py,sha256=QBR6AMJJWuZ0TevyMi2tXCWMLdS-ZSqtVTZDgqxwa7M,3112
|
18
18
|
honeybee_radiance_postprocess/cli/mtxop.py,sha256=UZJnjNpPjDmShy1-Mxos4H2vTUqk_yP3ZyaC1_LLFeI,5015
|
19
|
-
honeybee_radiance_postprocess/cli/postprocess.py,sha256=
|
19
|
+
honeybee_radiance_postprocess/cli/postprocess.py,sha256=y8O_GhiCqIk7czrwUs-4_-RD1TBE93pzOuoS4iakoww,38930
|
20
20
|
honeybee_radiance_postprocess/cli/schedule.py,sha256=6uIy98Co4zm-ZRcELo4Lfx_aN3lNiqPe-BSimXwt1F8,3877
|
21
21
|
honeybee_radiance_postprocess/cli/translate.py,sha256=18zkcGeRZALJ5Z82NEB3XZ-iEX2cHyneobGWV-IXWE0,6789
|
22
22
|
honeybee_radiance_postprocess/cli/two_phase.py,sha256=1nZF4jyZ_C7CAfiHCz1UUOEwDaB4yOXr9ga0HIrhOB0,7033
|
@@ -25,9 +25,9 @@ honeybee_radiance_postprocess/results/__init__.py,sha256=1agBQbfT4Tf8KqSZzlfKYX8
|
|
25
25
|
honeybee_radiance_postprocess/results/annual_daylight.py,sha256=o4Y5kbD3a4X4KRfsbOlWzgrnNKU365GcivM6qQGUGXU,31605
|
26
26
|
honeybee_radiance_postprocess/results/annual_irradiance.py,sha256=5zwrr4MNeHUebbSRpSBbscPOZUs2AHmYCQfIIbdYImY,8298
|
27
27
|
honeybee_radiance_postprocess/results/results.py,sha256=t9tr-WHt-XpALIwClLb-xOZcWUZthnvfGED5g3NGDu8,53589
|
28
|
-
honeybee_radiance_postprocess-0.4.
|
29
|
-
honeybee_radiance_postprocess-0.4.
|
30
|
-
honeybee_radiance_postprocess-0.4.
|
31
|
-
honeybee_radiance_postprocess-0.4.
|
32
|
-
honeybee_radiance_postprocess-0.4.
|
33
|
-
honeybee_radiance_postprocess-0.4.
|
28
|
+
honeybee_radiance_postprocess-0.4.340.dist-info/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
|
29
|
+
honeybee_radiance_postprocess-0.4.340.dist-info/METADATA,sha256=dHxlKhKMyE6CwEY9E75E51ko5ozeS7kPvPuVGaqAM7w,2228
|
30
|
+
honeybee_radiance_postprocess-0.4.340.dist-info/WHEEL,sha256=unfA4MOaH0icIyIA5oH6E2sn2Hq5zKtLlHsWapZGwes,110
|
31
|
+
honeybee_radiance_postprocess-0.4.340.dist-info/entry_points.txt,sha256=gFtVPx6UItXt27GfEZZO00eOZChJJEL6JwGSAB_O3rs,96
|
32
|
+
honeybee_radiance_postprocess-0.4.340.dist-info/top_level.txt,sha256=4-sFbzy7ewP2EDqJV3jeFlAFx7SuxtoBBELWaKAnLdA,30
|
33
|
+
honeybee_radiance_postprocess-0.4.340.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|