honeybee-radiance-postprocess 0.4.469__py2.py3-none-any.whl → 0.4.471__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.
@@ -477,6 +477,7 @@ def leed_option_one(
477
477
  array of hours above 1000 lux.
478
478
  - states_schedule: A dictionary of annual shading schedules for each
479
479
  aperture group.
480
+ - fail_to_comply: A dictionary with the hoys where the 2% rule failed.
480
481
  - grids_info: Grid information.
481
482
  """
482
483
  # use default leed occupancy schedule
@@ -165,42 +165,30 @@ def _well_summary(
165
165
 
166
166
  def well_annual_daylight(
167
167
  results: Union[str, AnnualDaylight], grids_filter: str = '*',
168
- states_schedule: dict = None, threshold: float = 300, target_time: float = 50,
169
- sub_folder: str = None):
168
+ states_schedule: dict = None, sub_folder: str = None):
170
169
  """Calculate credits for WELL L06.
171
170
 
172
171
  Args:
173
172
  results: Path to results folder or a Results class object.
174
173
  grids_filter: The name of a grid or a pattern to filter the grids.
175
174
  Defaults to '*'.
176
- shade_transmittance: A value to use as a multiplier in place of solar
177
- shading. This input can be either a single value that will be used
178
- for all aperture groups, or a dictionary where aperture groups are
179
- keys, and the value for each key is the shade transmittance. Values
180
- for shade transmittance must be 1 > value > 0.
181
- Defaults to 0.05.
182
- use_states: A boolean to note whether to use the simulated states. Set
183
- to True to use the simulated states. The default is False which will
184
- use the shade transmittance instead.
185
175
  states_schedule: A custom dictionary of shading states. In case this is
186
176
  left empty, the function will calculate a shading schedule by using
187
177
  the shade_transmittance input. If a states schedule is provided it
188
178
  will check that it is complying with the 2% rule. Defaults to None.
189
- threshold: Threshold value for daylight autonomy. Default: 300.
190
- target_time: A minimum threshold of occupied time (eg. 50% of the
191
- time), above which a given sensor passes and contributes to the
192
- spatial daylight autonomy. Defaults to 50.
193
179
  sub_folder: Relative path for a subfolder to write the output. If None,
194
180
  the files will not be written. Defaults to None.
195
181
 
196
182
  Returns:
197
183
  Tuple:
198
- - summary: Summary of all grids combined.
199
- - summary_grid: Summary of each grid individually.
184
+ - well_summary: Summary of WELL analysis.
185
+ - ies_lm_summary: Summary of IES LM analysis.
186
+ - ies_lm_summary_grid: Summary of IES LM analysis for each grid.
200
187
  - da_grids: List of daylight autonomy values for each grid. Each item
201
188
  in the list is a NumPy array of DA values.
202
189
  - states_schedule: A dictionary of annual shading schedules for each
203
190
  aperture group.
191
+ - fail_to_comply: A dictionary with the hoys where the 2% rule failed.
204
192
  - grids_info: Grid information.
205
193
  """
206
194
  schedule = occupancy_schedule_8_to_6(as_list=True)
@@ -241,10 +229,14 @@ def well_annual_daylight(
241
229
  grid_areas = [None] * len(grids_info)
242
230
 
243
231
  # spatial daylight autonomy
244
- da_grids = []
245
- pass_sda_grids = []
246
- pass_sda_blinds_up_grids = []
247
- pass_sda_blinds_down_grids = []
232
+ l06_da_grids = []
233
+ l06_pass_sda_grids = []
234
+ l06_pass_sda_blinds_up_grids = []
235
+ l06_pass_sda_blinds_down_grids = []
236
+ l01_da_grids = []
237
+ l01_pass_sda_grids = []
238
+ l01_pass_sda_blinds_up_grids = []
239
+ l01_pass_sda_blinds_down_grids = []
248
240
  for grid_info in grids_info:
249
241
  light_paths = [lp[0] for lp in grid_info['light_path']]
250
242
  base_zero_array = np.apply_along_axis(filter_array, 1, np.zeros(
@@ -279,56 +271,93 @@ def well_annual_daylight(
279
271
  array_blinds_up = sum(arrays_blinds_up)
280
272
  array_blinds_down = sum(arrays_blinds_down)
281
273
  # calculate da per grid
282
- da_grid = da_array2d(array, total_occ=total_occ, threshold=threshold)
274
+ da_grid = da_array2d(array, total_occ=total_occ, threshold=300)
283
275
 
284
- da_grids.append(da_grid)
276
+ l06_da_grids.append(da_grid)
285
277
  da_blinds_up_grid = da_array2d(
286
- array_blinds_up, total_occ=total_occ, threshold=threshold)
278
+ array_blinds_up, total_occ=total_occ, threshold=300)
287
279
  da_blinds_down_grid = da_array2d(
288
- array_blinds_down, total_occ=total_occ, threshold=threshold)
280
+ array_blinds_down, total_occ=total_occ, threshold=300)
289
281
  # calculate sda per grid
290
- pass_sda_grids.append(da_grid >= target_time)
291
- pass_sda_blinds_up_grids.append(da_blinds_up_grid >= target_time)
292
- pass_sda_blinds_down_grids.append(da_blinds_down_grid >= target_time)
282
+ l06_pass_sda_grids.append(da_grid >= 50)
283
+ l06_pass_sda_blinds_up_grids.append(da_blinds_up_grid >= 50)
284
+ l06_pass_sda_blinds_down_grids.append(da_blinds_down_grid >= 50)
293
285
 
294
- # create summaries for all grids and each grid individually
295
- ies_lm_summary, ies_lm_summary_grid = _well_summary(
296
- pass_sda_grids, grids_info, grid_areas,
297
- pass_sda_blinds_up_grids, pass_sda_blinds_down_grids)
286
+ array_blinds_up = sum(arrays_blinds_up)
287
+ array_blinds_down = sum(arrays_blinds_down)
288
+ # calculate da per grid
289
+ da_grid = da_array2d(array, total_occ=total_occ, threshold=200)
298
290
 
299
- well_summary = {}
291
+ l01_da_grids.append(da_grid)
292
+ da_blinds_up_grid = da_array2d(
293
+ array_blinds_up, total_occ=total_occ, threshold=200)
294
+ da_blinds_down_grid = da_array2d(
295
+ array_blinds_down, total_occ=total_occ, threshold=200)
296
+ # calculate sda per grid
297
+ l01_pass_sda_grids.append(da_grid >= 40)
298
+ l01_pass_sda_blinds_up_grids.append(da_blinds_up_grid >= 40)
299
+ l01_pass_sda_blinds_down_grids.append(da_blinds_down_grid >= 40)
300
+
301
+ # create summaries for all grids and each grid individually
302
+ l06_ies_lm_summary, l06_ies_lm_summary_grid = _well_summary(
303
+ l06_pass_sda_grids, grids_info, grid_areas,
304
+ l06_pass_sda_blinds_up_grids, l06_pass_sda_blinds_down_grids)
305
+ l01_ies_lm_summary, l01_ies_lm_summary_grid = _well_summary(
306
+ l01_pass_sda_grids, grids_info, grid_areas,
307
+ l01_pass_sda_blinds_up_grids, l01_pass_sda_blinds_down_grids)
308
+
309
+ l06_well_summary = {}
310
+ l01_well_summary = {}
311
+ l06_well_summary['method'] = 'IES LM-83-12'
312
+ l01_well_summary['method'] = 'IES LM-83-12'
300
313
 
301
314
  # credits
302
315
  if not fail_to_comply:
303
- if ies_lm_summary['sda'] >= 75:
304
- ies_lm_summary['credits'] = 3
305
- well_summary['credits'] = 2
306
- elif ies_lm_summary['sda'] >= 55:
307
- ies_lm_summary['credits'] = 2
308
- well_summary['credits'] = 1
309
- elif ies_lm_summary['sda'] >= 40:
310
- ies_lm_summary['credits'] = 1
311
- well_summary['credits'] = 0
316
+ if l06_ies_lm_summary['sda'] >= 75:
317
+ l06_ies_lm_summary['credits'] = 3
318
+ l06_well_summary['credits'] = 2
319
+ elif l06_ies_lm_summary['sda'] >= 55:
320
+ l06_ies_lm_summary['credits'] = 2
321
+ l06_well_summary['credits'] = 1
322
+ elif l06_ies_lm_summary['sda'] >= 40:
323
+ l06_ies_lm_summary['credits'] = 1
324
+ l06_well_summary['credits'] = 0
312
325
  else:
313
- ies_lm_summary['credits'] = 0
314
- well_summary['credits'] = 0
326
+ l06_ies_lm_summary['credits'] = 0
327
+ l06_well_summary['credits'] = 0
315
328
 
316
- if all(grid_summary['sda'] >= 55 for grid_summary in ies_lm_summary_grid.values()):
317
- if ies_lm_summary['credits'] <= 2:
318
- ies_lm_summary['credits'] += 1
329
+ if all(grid_summary['sda'] >= 55 for grid_summary in l06_ies_lm_summary_grid.values()):
330
+ if l06_ies_lm_summary['credits'] <= 2:
331
+ l06_ies_lm_summary['credits'] += 1
319
332
  else:
320
- ies_lm_summary['credits'] = 'Exemplary performance'
333
+ l06_ies_lm_summary['credits'] = 'Exemplary performance'
334
+
335
+ if l01_ies_lm_summary['sda'] >= 30:
336
+ l01_ies_lm_summary['comply'] = True
337
+ l01_well_summary['comply'] = True
338
+ else:
339
+ l01_ies_lm_summary['comply'] = False
340
+ l01_well_summary['comply'] = False
341
+
342
+ l06_well_summary['sda'] = l06_ies_lm_summary['sda']
343
+ l01_well_summary['sda'] = l01_ies_lm_summary['sda']
321
344
  else:
322
- ies_lm_summary['credits'] = 0
345
+ l06_ies_lm_summary['credits'] = 0
323
346
  fail_to_comply_rooms = ', '.join(list(fail_to_comply.keys()))
324
347
  note = (
325
348
  '0 credits have been awarded. The following sensor grids have at '
326
349
  'least one hour where 2% of the floor area receives direct '
327
350
  f'illuminance of 1000 lux or more: {fail_to_comply_rooms}.'
328
351
  )
329
- ies_lm_summary['note'] = note
352
+ l06_ies_lm_summary['note'] = note
353
+ l06_well_summary['credits'] = 0
354
+
355
+ l01_ies_lm_summary['comply'] = False
356
+ l01_ies_lm_summary['note'] = note
357
+ l01_well_summary['comply'] = False
330
358
 
331
- well_summary['total_floor_area'] = sum(np.sum(arr) for arr in grid_areas)
359
+ l06_well_summary['total_floor_area'] = sum(np.sum(arr) for arr in grid_areas)
360
+ l01_well_summary['total_floor_area'] = sum(np.sum(arr) for arr in grid_areas)
332
361
 
333
362
  # convert to datacollection
334
363
  def to_datacollection(aperture_group: str, values: np.ndarray):
@@ -344,34 +373,63 @@ def well_annual_daylight(
344
373
  folder = Path(sub_folder)
345
374
  folder.mkdir(parents=True, exist_ok=True)
346
375
 
347
- ies_lm_folder = folder.joinpath('ies_lm_summary')
348
- ies_lm_folder.mkdir(parents=True, exist_ok=True)
349
- ies_lm_summary_file = ies_lm_folder.joinpath('ies_lm_summary.json')
350
- ies_lm_summary_file.write_text(json.dumps(ies_lm_summary, indent=2))
351
- ies_lm_summary_grid_file = ies_lm_folder.joinpath('ies_lm_summary_grid.json')
352
- ies_lm_summary_grid_file.write_text(json.dumps(ies_lm_summary_grid, indent=2))
353
- states_schedule_file = ies_lm_folder.joinpath('states_schedule.json')
376
+ l06_ies_lm_folder = folder.joinpath('l06_ies_lm_summary')
377
+ l01_ies_lm_folder = folder.joinpath('l01_ies_lm_summary')
378
+
379
+ l06_ies_lm_folder.mkdir(parents=True, exist_ok=True)
380
+ l01_ies_lm_folder.mkdir(parents=True, exist_ok=True)
381
+
382
+ ies_lm_summary_file = l06_ies_lm_folder.joinpath('ies_lm_summary.json')
383
+ ies_lm_summary_file.write_text(json.dumps(l06_ies_lm_summary, indent=2))
384
+ ies_lm_summary_file = l01_ies_lm_folder.joinpath('ies_lm_summary.json')
385
+ ies_lm_summary_file.write_text(json.dumps(l01_ies_lm_summary, indent=2))
386
+
387
+ ies_lm_summary_grid_file = l06_ies_lm_folder.joinpath('ies_lm_summary_grid.json')
388
+ ies_lm_summary_grid_file.write_text(json.dumps(l06_ies_lm_summary_grid, indent=2))
389
+ ies_lm_summary_grid_file = l01_ies_lm_folder.joinpath('ies_lm_summary_grid.json')
390
+ ies_lm_summary_grid_file.write_text(json.dumps(l01_ies_lm_summary_grid, indent=2))
391
+
392
+ states_schedule_file = l06_ies_lm_folder.joinpath('states_schedule.json')
393
+ states_schedule_file.write_text(json.dumps(states_schedule))
394
+ states_schedule_file = l01_ies_lm_folder.joinpath('states_schedule.json')
354
395
  states_schedule_file.write_text(json.dumps(states_schedule))
355
- grids_info_file = ies_lm_folder.joinpath('grids_info.json')
396
+
397
+ grids_info_file = l06_ies_lm_folder.joinpath('grids_info.json')
398
+ grids_info_file.write_text(json.dumps(grids_info, indent=2))
399
+ grids_info_file = l01_ies_lm_folder.joinpath('grids_info.json')
356
400
  grids_info_file.write_text(json.dumps(grids_info, indent=2))
357
401
 
358
402
  for (da, grid_info) in \
359
- zip(da_grids, grids_info):
403
+ zip(l06_da_grids, grids_info):
404
+ grid_id = grid_info['full_id']
405
+ da_file = l06_ies_lm_folder.joinpath('results', 'da', f'{grid_id}.da')
406
+ da_file.parent.mkdir(parents=True, exist_ok=True)
407
+ np.savetxt(da_file, da, fmt='%.2f')
408
+ for (da, grid_info) in \
409
+ zip(l01_da_grids, grids_info):
360
410
  grid_id = grid_info['full_id']
361
- da_file = ies_lm_folder.joinpath('results', 'da', f'{grid_id}.da')
411
+ da_file = l01_ies_lm_folder.joinpath('results', 'da', f'{grid_id}.da')
362
412
  da_file.parent.mkdir(parents=True, exist_ok=True)
363
413
  np.savetxt(da_file, da, fmt='%.2f')
364
414
 
365
- da_grids_info_file = ies_lm_folder.joinpath(
415
+ da_grids_info_file = l06_ies_lm_folder.joinpath(
416
+ 'results', 'da', 'grids_info.json')
417
+ da_grids_info_file.write_text(json.dumps(grids_info, indent=2))
418
+ da_grids_info_file = l01_ies_lm_folder.joinpath(
366
419
  'results', 'da', 'grids_info.json')
367
420
  da_grids_info_file.write_text(json.dumps(grids_info, indent=2))
368
421
 
369
422
  states_schedule_err_file = \
370
- ies_lm_folder.joinpath('states_schedule_err.json')
423
+ l06_ies_lm_folder.joinpath('states_schedule_err.json')
424
+ states_schedule_err_file.write_text(json.dumps(fail_to_comply))
425
+ states_schedule_err_file = \
426
+ l01_ies_lm_folder.joinpath('states_schedule_err.json')
371
427
  states_schedule_err_file.write_text(json.dumps(fail_to_comply))
372
428
 
373
- well_summary_file = folder.joinpath('well_summary.json')
374
- well_summary_file.write_text(json.dumps(well_summary, indent=2))
429
+ well_summary_file = folder.joinpath('l06_well_summary.json')
430
+ well_summary_file.write_text(json.dumps(l06_well_summary, indent=2))
431
+ well_summary_file = folder.joinpath('l01_well_summary.json')
432
+ well_summary_file.write_text(json.dumps(l01_well_summary, indent=2))
375
433
 
376
- return (well_summary, ies_lm_summary, ies_lm_summary_grid, da_grids, states_schedule,
434
+ return (l06_well_summary, l06_ies_lm_summary, l06_ies_lm_summary_grid, l06_da_grids, states_schedule,
377
435
  fail_to_comply, grids_info)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: honeybee-radiance-postprocess
3
- Version: 0.4.469
3
+ Version: 0.4.471
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
@@ -34,17 +34,17 @@ honeybee_radiance_postprocess/ies/__init__.py,sha256=kQXElEqFnLGNnrMSpA51XDHoqBu
34
34
  honeybee_radiance_postprocess/ies/lm.py,sha256=kHvwd2uT8Y-c2TjpvQzjLrWzwgayWjpzpbwS2S6cEvo,9570
35
35
  honeybee_radiance_postprocess/ies/lm_schedule.py,sha256=ci58GXq2PntJ4yNUdI_x4UCRmq6KrLes-u7GeboX058,9954
36
36
  honeybee_radiance_postprocess/leed/__init__.py,sha256=kQXElEqFnLGNnrMSpA51XDHoqBup849FHeAqWASIy6w,45
37
- honeybee_radiance_postprocess/leed/leed.py,sha256=ft3shVI9X0FH3n_jkb5Qe-s1Q4BezkEjCvlr7SdhdhM,33364
37
+ honeybee_radiance_postprocess/leed/leed.py,sha256=pZyVmHEL_T3MG5Mu7CQh9Y0Ku2wOJsv6UpNAn5J15uU,33457
38
38
  honeybee_radiance_postprocess/leed/leed_schedule.py,sha256=s3by1sv1DtOlCawvaMvnIDvEo5D8ATEJvWQ_rEeJIHg,9956
39
39
  honeybee_radiance_postprocess/results/__init__.py,sha256=1agBQbfT4Tf8KqSZzlfKYX8MeZryY4jJ1KB4HWqaDDk,182
40
40
  honeybee_radiance_postprocess/results/annual_daylight.py,sha256=11d4J1iIuITKuoWyWa-2_2WdrHYBULC0YP-mWBWi4JQ,34724
41
41
  honeybee_radiance_postprocess/results/annual_irradiance.py,sha256=5zwrr4MNeHUebbSRpSBbscPOZUs2AHmYCQfIIbdYImY,8298
42
42
  honeybee_radiance_postprocess/results/results.py,sha256=ABb_S8kDPruhGkDsfREXMg6K0p8FRhAZ3QIRUZCQPAI,54888
43
43
  honeybee_radiance_postprocess/well/__init__.py,sha256=kQXElEqFnLGNnrMSpA51XDHoqBup849FHeAqWASIy6w,45
44
- honeybee_radiance_postprocess/well/well.py,sha256=rnRqxC8sQk_p8QL4-Kq0iFso1H_VcZCNcQ6TnpAn5T0,16370
45
- honeybee_radiance_postprocess-0.4.469.dist-info/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
46
- honeybee_radiance_postprocess-0.4.469.dist-info/METADATA,sha256=Tf9Je_ayTOwqv8R-qnBPZQRmR4Fn2xDbvcKe8dAD5m8,2240
47
- honeybee_radiance_postprocess-0.4.469.dist-info/WHEEL,sha256=AHX6tWk3qWuce7vKLrj7lnulVHEdWoltgauo8bgCXgU,109
48
- honeybee_radiance_postprocess-0.4.469.dist-info/entry_points.txt,sha256=gFtVPx6UItXt27GfEZZO00eOZChJJEL6JwGSAB_O3rs,96
49
- honeybee_radiance_postprocess-0.4.469.dist-info/top_level.txt,sha256=4-sFbzy7ewP2EDqJV3jeFlAFx7SuxtoBBELWaKAnLdA,30
50
- honeybee_radiance_postprocess-0.4.469.dist-info/RECORD,,
44
+ honeybee_radiance_postprocess/well/well.py,sha256=C80NGCKWAXkz0LfBTux5db8SVnH0z8WSNmDyq8dMvuo,19050
45
+ honeybee_radiance_postprocess-0.4.471.dist-info/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
46
+ honeybee_radiance_postprocess-0.4.471.dist-info/METADATA,sha256=iSudWCAZQShbrqkkt4uIhpSH1kv2vmIcH2cwZ4Mx1us,2240
47
+ honeybee_radiance_postprocess-0.4.471.dist-info/WHEEL,sha256=AHX6tWk3qWuce7vKLrj7lnulVHEdWoltgauo8bgCXgU,109
48
+ honeybee_radiance_postprocess-0.4.471.dist-info/entry_points.txt,sha256=gFtVPx6UItXt27GfEZZO00eOZChJJEL6JwGSAB_O3rs,96
49
+ honeybee_radiance_postprocess-0.4.471.dist-info/top_level.txt,sha256=4-sFbzy7ewP2EDqJV3jeFlAFx7SuxtoBBELWaKAnLdA,30
50
+ honeybee_radiance_postprocess-0.4.471.dist-info/RECORD,,