honeybee-radiance-postprocess 0.4.388__tar.gz → 0.4.390__tar.gz
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-0.4.388 → honeybee-radiance-postprocess-0.4.390}/PKG-INFO +1 -1
- {honeybee-radiance-postprocess-0.4.388 → honeybee-radiance-postprocess-0.4.390}/honeybee_radiance_postprocess/cli/abnt.py +77 -20
- {honeybee-radiance-postprocess-0.4.388 → honeybee-radiance-postprocess-0.4.390}/honeybee_radiance_postprocess/vis_metadata.py +5 -5
- {honeybee-radiance-postprocess-0.4.388 → honeybee-radiance-postprocess-0.4.390}/honeybee_radiance_postprocess.egg-info/PKG-INFO +1 -1
- honeybee-radiance-postprocess-0.4.390/honeybee_radiance_postprocess.egg-info/requires.txt +2 -0
- honeybee-radiance-postprocess-0.4.390/requirements.txt +2 -0
- honeybee-radiance-postprocess-0.4.388/honeybee_radiance_postprocess.egg-info/requires.txt +0 -2
- honeybee-radiance-postprocess-0.4.388/requirements.txt +0 -2
- {honeybee-radiance-postprocess-0.4.388 → honeybee-radiance-postprocess-0.4.390}/CODE_OF_CONDUCT.md +0 -0
- {honeybee-radiance-postprocess-0.4.388 → honeybee-radiance-postprocess-0.4.390}/CONTRIBUTING.md +0 -0
- {honeybee-radiance-postprocess-0.4.388 → honeybee-radiance-postprocess-0.4.390}/LICENSE +0 -0
- {honeybee-radiance-postprocess-0.4.388 → honeybee-radiance-postprocess-0.4.390}/MANIFEST.in +0 -0
- {honeybee-radiance-postprocess-0.4.388 → honeybee-radiance-postprocess-0.4.390}/README.md +0 -0
- {honeybee-radiance-postprocess-0.4.388 → honeybee-radiance-postprocess-0.4.390}/dev-requirements.txt +0 -0
- {honeybee-radiance-postprocess-0.4.388 → honeybee-radiance-postprocess-0.4.390}/honeybee_radiance_postprocess/__init__.py +0 -0
- {honeybee-radiance-postprocess-0.4.388 → honeybee-radiance-postprocess-0.4.390}/honeybee_radiance_postprocess/__main__.py +0 -0
- {honeybee-radiance-postprocess-0.4.388 → honeybee-radiance-postprocess-0.4.390}/honeybee_radiance_postprocess/annual.py +0 -0
- {honeybee-radiance-postprocess-0.4.388 → honeybee-radiance-postprocess-0.4.390}/honeybee_radiance_postprocess/annualdaylight.py +0 -0
- {honeybee-radiance-postprocess-0.4.388 → honeybee-radiance-postprocess-0.4.390}/honeybee_radiance_postprocess/annualirradiance.py +0 -0
- {honeybee-radiance-postprocess-0.4.388 → honeybee-radiance-postprocess-0.4.390}/honeybee_radiance_postprocess/cli/__init__.py +0 -0
- {honeybee-radiance-postprocess-0.4.388 → honeybee-radiance-postprocess-0.4.390}/honeybee_radiance_postprocess/cli/grid.py +0 -0
- {honeybee-radiance-postprocess-0.4.388 → honeybee-radiance-postprocess-0.4.390}/honeybee_radiance_postprocess/cli/leed.py +0 -0
- {honeybee-radiance-postprocess-0.4.388 → honeybee-radiance-postprocess-0.4.390}/honeybee_radiance_postprocess/cli/mtxop.py +0 -0
- {honeybee-radiance-postprocess-0.4.388 → honeybee-radiance-postprocess-0.4.390}/honeybee_radiance_postprocess/cli/postprocess.py +0 -0
- {honeybee-radiance-postprocess-0.4.388 → honeybee-radiance-postprocess-0.4.390}/honeybee_radiance_postprocess/cli/schedule.py +0 -0
- {honeybee-radiance-postprocess-0.4.388 → honeybee-radiance-postprocess-0.4.390}/honeybee_radiance_postprocess/cli/translate.py +0 -0
- {honeybee-radiance-postprocess-0.4.388 → honeybee-radiance-postprocess-0.4.390}/honeybee_radiance_postprocess/cli/two_phase.py +0 -0
- {honeybee-radiance-postprocess-0.4.388 → honeybee-radiance-postprocess-0.4.390}/honeybee_radiance_postprocess/cli/util.py +0 -0
- {honeybee-radiance-postprocess-0.4.388 → honeybee-radiance-postprocess-0.4.390}/honeybee_radiance_postprocess/dynamic.py +0 -0
- {honeybee-radiance-postprocess-0.4.388 → honeybee-radiance-postprocess-0.4.390}/honeybee_radiance_postprocess/electriclight.py +0 -0
- {honeybee-radiance-postprocess-0.4.388 → honeybee-radiance-postprocess-0.4.390}/honeybee_radiance_postprocess/en17037.py +0 -0
- {honeybee-radiance-postprocess-0.4.388 → honeybee-radiance-postprocess-0.4.390}/honeybee_radiance_postprocess/helper.py +0 -0
- {honeybee-radiance-postprocess-0.4.388 → honeybee-radiance-postprocess-0.4.390}/honeybee_radiance_postprocess/leed.py +0 -0
- {honeybee-radiance-postprocess-0.4.388 → honeybee-radiance-postprocess-0.4.390}/honeybee_radiance_postprocess/metrics.py +0 -0
- {honeybee-radiance-postprocess-0.4.388 → honeybee-radiance-postprocess-0.4.390}/honeybee_radiance_postprocess/reader.py +0 -0
- {honeybee-radiance-postprocess-0.4.388 → honeybee-radiance-postprocess-0.4.390}/honeybee_radiance_postprocess/results/__init__.py +0 -0
- {honeybee-radiance-postprocess-0.4.388 → honeybee-radiance-postprocess-0.4.390}/honeybee_radiance_postprocess/results/annual_daylight.py +0 -0
- {honeybee-radiance-postprocess-0.4.388 → honeybee-radiance-postprocess-0.4.390}/honeybee_radiance_postprocess/results/annual_irradiance.py +0 -0
- {honeybee-radiance-postprocess-0.4.388 → honeybee-radiance-postprocess-0.4.390}/honeybee_radiance_postprocess/results/results.py +0 -0
- {honeybee-radiance-postprocess-0.4.388 → honeybee-radiance-postprocess-0.4.390}/honeybee_radiance_postprocess/type_hints.py +0 -0
- {honeybee-radiance-postprocess-0.4.388 → honeybee-radiance-postprocess-0.4.390}/honeybee_radiance_postprocess/util.py +0 -0
- {honeybee-radiance-postprocess-0.4.388 → honeybee-radiance-postprocess-0.4.390}/honeybee_radiance_postprocess.egg-info/SOURCES.txt +0 -0
- {honeybee-radiance-postprocess-0.4.388 → honeybee-radiance-postprocess-0.4.390}/honeybee_radiance_postprocess.egg-info/dependency_links.txt +0 -0
- {honeybee-radiance-postprocess-0.4.388 → honeybee-radiance-postprocess-0.4.390}/honeybee_radiance_postprocess.egg-info/entry_points.txt +0 -0
- {honeybee-radiance-postprocess-0.4.388 → honeybee-radiance-postprocess-0.4.390}/honeybee_radiance_postprocess.egg-info/top_level.txt +0 -0
- {honeybee-radiance-postprocess-0.4.388 → honeybee-radiance-postprocess-0.4.390}/setup.cfg +0 -0
- {honeybee-radiance-postprocess-0.4.388 → honeybee-radiance-postprocess-0.4.390}/setup.py +0 -0
@@ -8,6 +8,7 @@ import numpy as np
|
|
8
8
|
|
9
9
|
from honeybee.model import Model
|
10
10
|
from ladybug_geometry.geometry3d.face import Face3D
|
11
|
+
from ladybug_geometry.geometry3d.pointvector import Vector3D
|
11
12
|
|
12
13
|
from ..vis_metadata import _abnt_nbr_15575_daylight_levels_vis_metadata
|
13
14
|
|
@@ -27,13 +28,17 @@ def abnt():
|
|
27
28
|
)
|
28
29
|
@click.argument('model-file', type=click.Path(
|
29
30
|
exists=True, file_okay=True, dir_okay=False, resolve_path=True))
|
31
|
+
@click.option(
|
32
|
+
'--room-center/--grid-center', '-rc/-gc', help='Flag to note whether the '
|
33
|
+
'evaluation of the center is at the room center or the grid center.',
|
34
|
+
default=True, show_default=True)
|
30
35
|
@click.option(
|
31
36
|
'--sub-folder', '-sf', help='Relative path for subfolder to write output '
|
32
37
|
'files.', default='abnt_nbr_15575', type=click.Path(
|
33
38
|
exists=False, file_okay=False, dir_okay=True, resolve_path=True, path_type=Path)
|
34
39
|
)
|
35
40
|
def abnt_nbr_15575(
|
36
|
-
folder, model_file, sub_folder
|
41
|
+
folder, model_file, room_center, sub_folder
|
37
42
|
):
|
38
43
|
"""Calculate metrics for ABNT NBR 15575.
|
39
44
|
|
@@ -96,7 +101,7 @@ def abnt_nbr_15575(
|
|
96
101
|
|
97
102
|
try:
|
98
103
|
folder = Path(folder)
|
99
|
-
hb_model = Model.from_file(model_file)
|
104
|
+
hb_model: Model = Model.from_file(model_file)
|
100
105
|
sensor_grids = hb_model.properties.radiance.sensor_grids
|
101
106
|
sg_full_identifier = {sg.full_identifier: sg for sg in sensor_grids}
|
102
107
|
|
@@ -106,9 +111,14 @@ def abnt_nbr_15575(
|
|
106
111
|
if not illuminance_levels_folder.exists():
|
107
112
|
illuminance_levels_folder.mkdir(parents=True, exist_ok=True)
|
108
113
|
|
109
|
-
|
110
|
-
summary_rooms_file = sub_folder.joinpath('abnt_nbr_15575_rooms.json')
|
114
|
+
summary_rooms_csv = sub_folder.joinpath('abnt_nbr_15575_rooms.csv')
|
111
115
|
folder_names = ['4_930AM', '4_330PM', '10_930AM', '10_330PM']
|
116
|
+
pit_mapper = {
|
117
|
+
'4_930AM': 'Abril 09:30',
|
118
|
+
'4_330PM': 'Abril 15:30',
|
119
|
+
'10_930AM': 'Outubro 09:30',
|
120
|
+
'10_330PM': 'Outubro 15:30'
|
121
|
+
}
|
112
122
|
|
113
123
|
metric_info_dict = _abnt_nbr_15575_daylight_levels_vis_metadata()
|
114
124
|
summary_output = {}
|
@@ -133,17 +143,25 @@ def abnt_nbr_15575(
|
|
133
143
|
pof_sensor_grids.get(grid_info['full_id'], None)
|
134
144
|
# if pof is not calculated for this grid
|
135
145
|
if pof_sensor_grid is None:
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
146
|
+
if room_center:
|
147
|
+
room = hb_model.rooms_by_identifier(
|
148
|
+
[sensor_grid.room_identifier]
|
149
|
+
)[0]
|
150
|
+
pof_sensor_grids[grid_info['full_id']] = \
|
151
|
+
room.center + Vector3D(0, 0, 0.75)
|
142
152
|
else:
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
153
|
+
faces_3d = [Face3D(face_vertices) for face_vertices in sensor_grid.mesh.face_vertices]
|
154
|
+
face_3d_union = Face3D.join_coplanar_faces(faces_3d, 0.05)
|
155
|
+
assert len(face_3d_union) == 1
|
156
|
+
if face_3d_union[0].is_convex:
|
157
|
+
centroid = face_3d_union[0].centroid
|
158
|
+
pof_sensor_grids[grid_info['full_id']] = centroid
|
159
|
+
else:
|
160
|
+
pof = face_3d_union[0].pole_of_inaccessibility(0.01)
|
161
|
+
pof_sensor_grids[grid_info['full_id']] = pof
|
162
|
+
|
163
|
+
x = pof_sensor_grids[grid_info['full_id']].x
|
164
|
+
y = pof_sensor_grids[grid_info['full_id']].y
|
147
165
|
f_xy = perform_interpolation(x, y, x_coords, y_coords, pit_values)
|
148
166
|
|
149
167
|
if f_xy >= 120:
|
@@ -161,12 +179,14 @@ def abnt_nbr_15575(
|
|
161
179
|
summary_rooms_output[grid_info['full_id']] = {
|
162
180
|
'nível': level,
|
163
181
|
'iluminância': f_xy,
|
164
|
-
'grids_info': grid_info
|
182
|
+
'grids_info': grid_info,
|
183
|
+
pit_mapper[_subfolder]: f_xy,
|
165
184
|
}
|
166
185
|
else:
|
167
186
|
if f_xy < room_summary['iluminância']:
|
168
187
|
room_summary['nível'] = level
|
169
188
|
room_summary['iluminância'] = f_xy
|
189
|
+
room_summary[pit_mapper[_subfolder]] = f_xy
|
170
190
|
|
171
191
|
sub_output.append(
|
172
192
|
{
|
@@ -196,11 +216,48 @@ def abnt_nbr_15575(
|
|
196
216
|
grids_info_file = folder.joinpath(_subfolder, 'grids_info.json')
|
197
217
|
grids_info_file.write_text(json.dumps(grids_info, indent=2))
|
198
218
|
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
219
|
+
# set up the default data types
|
220
|
+
dtype = [
|
221
|
+
('Sensor Grid', 'O'),
|
222
|
+
('Sensor Grid ID', 'O'),
|
223
|
+
('Abril 09:30', np.float32),
|
224
|
+
('Abril 15:30', np.float32),
|
225
|
+
('Outubro 09:30', np.float32),
|
226
|
+
('Outubro 15:30', np.float32),
|
227
|
+
('Atendimento', 'O')
|
228
|
+
]
|
229
|
+
|
230
|
+
# set up format
|
231
|
+
fmt = ['%s', '%s', '%.2f', '%.2f', '%.2f', '%.2f', '%s']
|
232
|
+
|
233
|
+
arrays = []
|
234
|
+
for room_summary in summary_rooms_output.values():
|
235
|
+
data = []
|
236
|
+
data.append(room_summary['grids_info']['name'])
|
237
|
+
data.append(room_summary['grids_info']['full_id'])
|
238
|
+
data.append(room_summary['Abril 09:30'])
|
239
|
+
data.append(room_summary['Abril 15:30'])
|
240
|
+
data.append(room_summary['Outubro 09:30'])
|
241
|
+
data.append(room_summary['Outubro 15:30'])
|
242
|
+
data.append(room_summary['nível'])
|
243
|
+
arrays.append(tuple(data))
|
244
|
+
|
245
|
+
# create structured array
|
246
|
+
struct_array = np.array(arrays, dtype=dtype)
|
247
|
+
|
248
|
+
header = [dt[0] for dt in dtype]
|
249
|
+
# write header to summary_rooms_csv
|
250
|
+
with summary_rooms_csv.open(mode='w', encoding='utf-8') as output_file:
|
251
|
+
output_file.write(','.join(header))
|
252
|
+
output_file.write('\n') # add newline after header
|
253
|
+
|
254
|
+
# write structured array to summary_rooms_csv
|
255
|
+
with summary_rooms_csv.open(mode='a', encoding='utf-8') as output_file:
|
256
|
+
np.savetxt(output_file, struct_array, delimiter=',', fmt=fmt)
|
257
|
+
|
258
|
+
center_points_file = sub_folder.joinpath('center_points.json')
|
259
|
+
data = [pof.to_dict() for pof in pof_sensor_grids.values()]
|
260
|
+
center_points_file.write_text(json.dumps(data, indent=4))
|
204
261
|
|
205
262
|
except Exception:
|
206
263
|
_logger.exception('Failed to calculate ABNT NBR 15575 metrics.')
|
@@ -16,31 +16,31 @@ def _abnt_nbr_15575_daylight_levels_vis_metadata():
|
|
16
16
|
colors = [Color(255, 198, 143), Color(255, 255, 209), Color(192, 231, 189), Color(83, 169, 206)]
|
17
17
|
illuminance_levels_lpar = \
|
18
18
|
LegendParameters(min=0, max=3, colors=colors, segment_count=4,
|
19
|
-
title='
|
19
|
+
title='Níveis de iluminamento')
|
20
20
|
illuminance_levels_lpar.ordinal_dictionary = level_value
|
21
21
|
|
22
22
|
metric_info_dict = {
|
23
23
|
'4_930AM': {
|
24
24
|
'type': 'VisualizationMetaData',
|
25
|
-
'data_type': GenericType('
|
25
|
+
'data_type': GenericType('23 de abril 9:30h', '').to_dict(),
|
26
26
|
'unit': '',
|
27
27
|
'legend_parameters': illuminance_levels_lpar.to_dict()
|
28
28
|
},
|
29
29
|
'4_330PM': {
|
30
30
|
'type': 'VisualizationMetaData',
|
31
|
-
'data_type': GenericType('
|
31
|
+
'data_type': GenericType('23 de abril 15:30h', '').to_dict(),
|
32
32
|
'unit': '',
|
33
33
|
'legend_parameters': illuminance_levels_lpar.to_dict()
|
34
34
|
},
|
35
35
|
'10_930AM': {
|
36
36
|
'type': 'VisualizationMetaData',
|
37
|
-
'data_type': GenericType('
|
37
|
+
'data_type': GenericType('23 de outubro 9:30h', '').to_dict(),
|
38
38
|
'unit': '',
|
39
39
|
'legend_parameters': illuminance_levels_lpar.to_dict()
|
40
40
|
},
|
41
41
|
'10_330PM': {
|
42
42
|
'type': 'VisualizationMetaData',
|
43
|
-
'data_type': GenericType('
|
43
|
+
'data_type': GenericType('23 de outubro 15:30h', '').to_dict(),
|
44
44
|
'unit': '',
|
45
45
|
'legend_parameters': illuminance_levels_lpar.to_dict()
|
46
46
|
}
|
{honeybee-radiance-postprocess-0.4.388 → honeybee-radiance-postprocess-0.4.390}/CODE_OF_CONDUCT.md
RENAMED
File without changes
|
{honeybee-radiance-postprocess-0.4.388 → honeybee-radiance-postprocess-0.4.390}/CONTRIBUTING.md
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{honeybee-radiance-postprocess-0.4.388 → honeybee-radiance-postprocess-0.4.390}/dev-requirements.txt
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|