honeybee-radiance-postprocess 0.4.516__py2.py3-none-any.whl → 0.4.518__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.
@@ -354,6 +354,7 @@ def breeam_daylight_assessment_4b(
354
354
  if not grid_areas:
355
355
  grid_areas = {grid_info['full_id']: None for grid_info in grids_info}
356
356
 
357
+ grid_summary = {}
357
358
  type_summary = {}
358
359
  for grid_info in grids_info:
359
360
  program_type = grid_program_types.get(grid_info['full_id'], None)
@@ -406,15 +407,23 @@ def breeam_daylight_assessment_4b(
406
407
 
407
408
  type_summary[program_type][grid_info['full_id']].append(metrics_summary)
408
409
 
410
+ grid_summary[grid_info['full_id']] = {
411
+ 'type': metrics['type'],
412
+ 'program-type': program_type,
413
+ 'display-name': grid_info['name'],
414
+ 'average-illuminance-hours': hrs_abv_avg.item(),
415
+ 'minimum-illuminance-hours': hrs_abv_min.item()
416
+ }
417
+
409
418
  program_summary = []
410
- for program_type, grid_summary in type_summary.items():
419
+ for program_type, _grid_summary in type_summary.items():
411
420
  program_type_summary = {}
412
421
  program_type_summary['program_type'] = program_type
413
422
  program_type_summary['credits'] = 0 # set 0 by default
414
423
  program_type_summary['comply'] = False # set False by default
415
424
 
416
425
  metrics_summary = {}
417
- for grid_id, metrics_list in grid_summary.items():
426
+ for grid_id, metrics_list in _grid_summary.items():
418
427
  for metric in metrics_list:
419
428
  if metric['credits'] not in metrics_summary:
420
429
  metrics_summary[metric['credits']] = {}
@@ -452,7 +461,7 @@ def breeam_daylight_assessment_4b(
452
461
  program_type_summary['type'] = metric_summary['type']
453
462
 
454
463
  avg_hrs, min_hrs, areas = [], [], []
455
- for grid_id, metrics_list in grid_summary.items():
464
+ for grid_id, metrics_list in _grid_summary.items():
456
465
  for metric in metrics_list:
457
466
  areas.append(metric['area'])
458
467
  avg_hrs.append(metric['average-illuminance-hours'])
@@ -499,6 +508,8 @@ def breeam_daylight_assessment_4b(
499
508
  credit_summary_file.write_text(json.dumps(credit_summary, indent=2))
500
509
  program_summary_file = sub_folder.joinpath('program_summary.json')
501
510
  program_summary_file.write_text(json.dumps(program_summary, indent=2))
511
+ grid_summary_file = sub_folder.joinpath('grid_summary.json')
512
+ grid_summary_file.write_text(json.dumps(grid_summary, indent=2))
502
513
 
503
514
  pf_folder = sub_folder.joinpath('pass_fail')
504
515
  pf_folder.mkdir(parents=True, exist_ok=True)
@@ -243,6 +243,7 @@ def _ase_hourly_percentage(
243
243
 
244
244
  return data_collection
245
245
 
246
+
246
247
  def shade_transmittance_per_light_path(
247
248
  light_paths: list, shade_transmittance: Union[float, dict],
248
249
  shd_trans_dict: dict) -> dict:
@@ -501,7 +502,7 @@ def leed_option_one(
501
502
  schedule = occupancy_schedule_8_to_6(as_list=True)
502
503
 
503
504
  if not isinstance(results, AnnualDaylight):
504
- results = AnnualDaylight(results, schedule=schedule)
505
+ results = AnnualDaylight(results, schedule=schedule, cache_arrays=False)
505
506
  else:
506
507
  # set schedule to default leed schedule
507
508
  results.schedule = schedule
@@ -44,10 +44,12 @@ class AnnualDaylight(Results):
44
44
  * valid_states
45
45
  * datatype
46
46
  """
47
- def __init__(self, folder, schedule: list = None, load_arrays: bool = False):
47
+ def __init__(self, folder, schedule: list = None, load_arrays: bool = False,
48
+ cache_arrays: bool = False):
48
49
  """Initialize Results."""
49
50
  Results.__init__(self, folder, datatype=Illuminance('Illuminance'),
50
- schedule=schedule, unit='lux', load_arrays=load_arrays)
51
+ schedule=schedule, unit='lux', load_arrays=load_arrays,
52
+ cache_arrays=cache_arrays)
51
53
 
52
54
  def daylight_autonomy(
53
55
  self, threshold: float = 300, states: DynamicSchedule = None,
@@ -35,10 +35,12 @@ class AnnualIrradiance(Results):
35
35
  * valid_states
36
36
  * datatype
37
37
  """
38
- def __init__(self, folder, schedule: list = None, load_arrays: bool = False):
38
+ def __init__(self, folder, schedule: list = None, load_arrays: bool = False,
39
+ cache_arrays: bool = False):
39
40
  """Initialize Results."""
40
41
  Results.__init__(self, folder, datatype=EnergyFlux('Irradiance'),
41
- schedule=schedule, unit='W/m2', load_arrays=load_arrays)
42
+ schedule=schedule, unit='W/m2', load_arrays=load_arrays,
43
+ cache_arrays=cache_arrays)
42
44
 
43
45
  def cumulative_values(
44
46
  self, hoys: list = [], states: DynamicSchedule = None,
@@ -276,13 +276,15 @@ class Results(_ResultsFolder):
276
276
  * valid_states
277
277
  * datatype
278
278
  * unit
279
+ * cache_arrays
279
280
  """
280
281
  __slots__ = ('_schedule', '_occ_pattern', '_total_occ', '_sun_down_occ_hours',
281
- '_occ_mask', '_arrays', '_valid_states', '_datatype', '_unit')
282
+ '_occ_mask', '_arrays', '_valid_states', '_datatype', '_unit',
283
+ '_cache_arrays')
282
284
 
283
285
  def __init__(self, folder, datatype: DataTypeBase = None,
284
286
  schedule: list = None, unit: str = None,
285
- load_arrays: bool = False):
287
+ load_arrays: bool = False, cache_arrays: bool = True):
286
288
  """Initialize Results."""
287
289
  _ResultsFolder.__init__(self, folder)
288
290
  self.schedule = schedule
@@ -290,6 +292,7 @@ class Results(_ResultsFolder):
290
292
  self._valid_states = self._get_valid_states()
291
293
  self.datatype = datatype
292
294
  self.unit = unit
295
+ self.cache_arrays = cache_arrays
293
296
 
294
297
  @property
295
298
  def schedule(self):
@@ -364,6 +367,15 @@ class Results(_ResultsFolder):
364
367
  def unit(self, value):
365
368
  self._unit = value
366
369
 
370
+ @property
371
+ def cache_arrays(self):
372
+ """Return a boolean to indicate whether arrays are cached."""
373
+ return self._cache_arrays
374
+
375
+ @cache_arrays.setter
376
+ def cache_arrays(self, value):
377
+ self._cache_arrays = value
378
+
367
379
  def total(
368
380
  self, hoys: list = [], states: DynamicSchedule = None,
369
381
  grids_filter: str = '*', res_type: str = 'total'
@@ -1054,12 +1066,19 @@ class Results(_ResultsFolder):
1054
1066
  extension=extension)
1055
1067
  array = np.load(file)
1056
1068
 
1057
- array_dict = {grid_id: {light_path: {state_identifier: {res_type: array}}}}
1058
- arrays = merge_dicts(array_dict, self.arrays)
1059
- self.arrays = arrays
1069
+ if self.cache_arrays:
1070
+ array_dict = {grid_id: {light_path: {state_identifier: {res_type: array}}}}
1071
+ arrays = merge_dicts(array_dict, self.arrays)
1072
+ self.arrays = arrays
1060
1073
 
1061
1074
  return array
1062
1075
 
1076
+ def _clear_cached_arrays(self):
1077
+ """Clear the cached arrays.
1078
+
1079
+ This method will simply set the arrays property to an empty dictionary."""
1080
+ self.arrays = {}
1081
+
1063
1082
  def _state_identifier(
1064
1083
  self, grid_id: str, light_path: str, state: int = 0) -> Union[str, None]:
1065
1084
  """Get the state identifier from a light path and state integer.
@@ -193,7 +193,7 @@ def well_annual_daylight(
193
193
  schedule = occupancy_schedule_8_to_6(as_list=True)
194
194
 
195
195
  if not isinstance(results, AnnualDaylight):
196
- results = AnnualDaylight(results, schedule=schedule)
196
+ results = AnnualDaylight(results, schedule=schedule, cache_arrays=False)
197
197
  else:
198
198
  # set schedule to default leed schedule
199
199
  results.schedule = schedule
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: honeybee-radiance-postprocess
3
- Version: 0.4.516
3
+ Version: 0.4.518
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
@@ -13,7 +13,7 @@ Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
13
13
  Classifier: Operating System :: OS Independent
14
14
  Description-Content-Type: text/markdown
15
15
  License-File: LICENSE
16
- Requires-Dist: honeybee-radiance==1.66.160
16
+ Requires-Dist: honeybee-radiance==1.66.161
17
17
  Requires-Dist: numpy<2.0.0
18
18
 
19
19
  [![Build Status](https://github.com/ladybug-tools/honeybee-radiance-postprocess/actions/workflows/ci.yaml/badge.svg)](https://github.com/ladybug-tools/honeybee-radiance-postprocess/actions)
@@ -14,7 +14,7 @@ honeybee_radiance_postprocess/type_hints.py,sha256=4R0kZgacQrqzoh8Tq7f8MVzUDzynV
14
14
  honeybee_radiance_postprocess/util.py,sha256=uxqop4TsUMp8l8iLQf784NJINprHCgj00GZHvTth1C0,5603
15
15
  honeybee_radiance_postprocess/vis_metadata.py,sha256=7ywIgdiuNKcctxifhpy7-Q2oaSX2ngQBeA0Kh7q1Gg0,1780
16
16
  honeybee_radiance_postprocess/breeam/__init__.py,sha256=kQXElEqFnLGNnrMSpA51XDHoqBup849FHeAqWASIy6w,45
17
- honeybee_radiance_postprocess/breeam/breeam.py,sha256=Na0zthVdka2j5_NiIdl0aqlB4866sOgoePWIhKCdm5s,19364
17
+ honeybee_radiance_postprocess/breeam/breeam.py,sha256=tPaiPvg1Kpjoy5dFGemkaw-lUJxmeIBRyEMi31qLSiU,19836
18
18
  honeybee_radiance_postprocess/cli/__init__.py,sha256=_mYHnIOpH0qJ4QK56SB3qUT2Duuts2GR2U_0t_uE-2s,958
19
19
  honeybee_radiance_postprocess/cli/abnt.py,sha256=RmEjhxdEK6Uks3S10rQs6n8cup9qv036qRwh_wj1taA,15705
20
20
  honeybee_radiance_postprocess/cli/breeam.py,sha256=-0VUnuCDxDrBnxDZ6BZjv_D635U1kb2C1-cwiR3lTNg,3330
@@ -34,17 +34,17 @@ honeybee_radiance_postprocess/ies/__init__.py,sha256=kQXElEqFnLGNnrMSpA51XDHoqBu
34
34
  honeybee_radiance_postprocess/ies/lm.py,sha256=9o1j78FpXHxEEy0GN8vG6lecx_VQCudKwhtJx0x1BQI,9658
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=SGUhdAXAKCCGQhjJBVtHUHmx5R9DwSsU4KNxI9laTX8,35671
37
+ honeybee_radiance_postprocess/leed/leed.py,sha256=xauRYf_-9N4L1s6CqXUdoIu303xUk9WMCyPMDURDSnE,35692
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
- honeybee_radiance_postprocess/results/annual_daylight.py,sha256=11d4J1iIuITKuoWyWa-2_2WdrHYBULC0YP-mWBWi4JQ,34724
41
- honeybee_radiance_postprocess/results/annual_irradiance.py,sha256=5zwrr4MNeHUebbSRpSBbscPOZUs2AHmYCQfIIbdYImY,8298
42
- honeybee_radiance_postprocess/results/results.py,sha256=8wpxu6HBnrJXRoTkI7ucNuzhVmNKw1Z2zPP6wzk7ULQ,55236
40
+ honeybee_radiance_postprocess/results/annual_daylight.py,sha256=2-udjr0pD5HFP_ro08mnFWYik_YsbQEM46FURmhOUOs,34821
41
+ honeybee_radiance_postprocess/results/annual_irradiance.py,sha256=nDkz8VFiiC8Vbw-ZRoaKSfW1WZ9EdE125iUWcAxjhJk,8395
42
+ honeybee_radiance_postprocess/results/results.py,sha256=1pIzVXBs-T97bEYZqj9PLKb2uWdgLKYciU12uhfGyMg,55836
43
43
  honeybee_radiance_postprocess/well/__init__.py,sha256=kQXElEqFnLGNnrMSpA51XDHoqBup849FHeAqWASIy6w,45
44
- honeybee_radiance_postprocess/well/well.py,sha256=zd_fyTfF6gBOwCMkP2-ZHyjWhDz21s1VV1a1i7CbwdY,22578
45
- honeybee_radiance_postprocess-0.4.516.dist-info/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
46
- honeybee_radiance_postprocess-0.4.516.dist-info/METADATA,sha256=eILMAG1qnt60s36lTxBliFcsbLIVHceIpG6qa4P3aK0,2238
47
- honeybee_radiance_postprocess-0.4.516.dist-info/WHEEL,sha256=AHX6tWk3qWuce7vKLrj7lnulVHEdWoltgauo8bgCXgU,109
48
- honeybee_radiance_postprocess-0.4.516.dist-info/entry_points.txt,sha256=gFtVPx6UItXt27GfEZZO00eOZChJJEL6JwGSAB_O3rs,96
49
- honeybee_radiance_postprocess-0.4.516.dist-info/top_level.txt,sha256=4-sFbzy7ewP2EDqJV3jeFlAFx7SuxtoBBELWaKAnLdA,30
50
- honeybee_radiance_postprocess-0.4.516.dist-info/RECORD,,
44
+ honeybee_radiance_postprocess/well/well.py,sha256=KO0BOs4-P_PnsGFfasoz1xgaNac4zqOQ9JqTjmMapuU,22598
45
+ honeybee_radiance_postprocess-0.4.518.dist-info/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
46
+ honeybee_radiance_postprocess-0.4.518.dist-info/METADATA,sha256=Uc0TpKVy5CQifmQ2b8K_q4s3zKAnEMaafHHXIwSKcRA,2238
47
+ honeybee_radiance_postprocess-0.4.518.dist-info/WHEEL,sha256=AHX6tWk3qWuce7vKLrj7lnulVHEdWoltgauo8bgCXgU,109
48
+ honeybee_radiance_postprocess-0.4.518.dist-info/entry_points.txt,sha256=gFtVPx6UItXt27GfEZZO00eOZChJJEL6JwGSAB_O3rs,96
49
+ honeybee_radiance_postprocess-0.4.518.dist-info/top_level.txt,sha256=4-sFbzy7ewP2EDqJV3jeFlAFx7SuxtoBBELWaKAnLdA,30
50
+ honeybee_radiance_postprocess-0.4.518.dist-info/RECORD,,