honeybee-radiance-postprocess 0.4.496__tar.gz → 0.4.497__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.
Files changed (61) hide show
  1. {honeybee_radiance_postprocess-0.4.496 → honeybee_radiance_postprocess-0.4.497}/PKG-INFO +1 -1
  2. {honeybee_radiance_postprocess-0.4.496 → honeybee_radiance_postprocess-0.4.497}/honeybee_radiance_postprocess/breeam/breeam.py +27 -4
  3. honeybee_radiance_postprocess-0.4.497/honeybee_radiance_postprocess/cli/breeam.py +91 -0
  4. {honeybee_radiance_postprocess-0.4.496 → honeybee_radiance_postprocess-0.4.497}/honeybee_radiance_postprocess.egg-info/PKG-INFO +1 -1
  5. honeybee_radiance_postprocess-0.4.496/honeybee_radiance_postprocess/cli/breeam.py +0 -47
  6. {honeybee_radiance_postprocess-0.4.496 → honeybee_radiance_postprocess-0.4.497}/CODE_OF_CONDUCT.md +0 -0
  7. {honeybee_radiance_postprocess-0.4.496 → honeybee_radiance_postprocess-0.4.497}/CONTRIBUTING.md +0 -0
  8. {honeybee_radiance_postprocess-0.4.496 → honeybee_radiance_postprocess-0.4.497}/LICENSE +0 -0
  9. {honeybee_radiance_postprocess-0.4.496 → honeybee_radiance_postprocess-0.4.497}/MANIFEST.in +0 -0
  10. {honeybee_radiance_postprocess-0.4.496 → honeybee_radiance_postprocess-0.4.497}/README.md +0 -0
  11. {honeybee_radiance_postprocess-0.4.496 → honeybee_radiance_postprocess-0.4.497}/dev-requirements.txt +0 -0
  12. {honeybee_radiance_postprocess-0.4.496 → honeybee_radiance_postprocess-0.4.497}/honeybee_radiance_postprocess/__init__.py +0 -0
  13. {honeybee_radiance_postprocess-0.4.496 → honeybee_radiance_postprocess-0.4.497}/honeybee_radiance_postprocess/__main__.py +0 -0
  14. {honeybee_radiance_postprocess-0.4.496 → honeybee_radiance_postprocess-0.4.497}/honeybee_radiance_postprocess/annual.py +0 -0
  15. {honeybee_radiance_postprocess-0.4.496 → honeybee_radiance_postprocess-0.4.497}/honeybee_radiance_postprocess/annualdaylight.py +0 -0
  16. {honeybee_radiance_postprocess-0.4.496 → honeybee_radiance_postprocess-0.4.497}/honeybee_radiance_postprocess/annualirradiance.py +0 -0
  17. {honeybee_radiance_postprocess-0.4.496 → honeybee_radiance_postprocess-0.4.497}/honeybee_radiance_postprocess/breeam/__init__.py +0 -0
  18. {honeybee_radiance_postprocess-0.4.496 → honeybee_radiance_postprocess-0.4.497}/honeybee_radiance_postprocess/cli/__init__.py +0 -0
  19. {honeybee_radiance_postprocess-0.4.496 → honeybee_radiance_postprocess-0.4.497}/honeybee_radiance_postprocess/cli/abnt.py +0 -0
  20. {honeybee_radiance_postprocess-0.4.496 → honeybee_radiance_postprocess-0.4.497}/honeybee_radiance_postprocess/cli/datacollection.py +0 -0
  21. {honeybee_radiance_postprocess-0.4.496 → honeybee_radiance_postprocess-0.4.497}/honeybee_radiance_postprocess/cli/grid.py +0 -0
  22. {honeybee_radiance_postprocess-0.4.496 → honeybee_radiance_postprocess-0.4.497}/honeybee_radiance_postprocess/cli/leed.py +0 -0
  23. {honeybee_radiance_postprocess-0.4.496 → honeybee_radiance_postprocess-0.4.497}/honeybee_radiance_postprocess/cli/merge.py +0 -0
  24. {honeybee_radiance_postprocess-0.4.496 → honeybee_radiance_postprocess-0.4.497}/honeybee_radiance_postprocess/cli/mtxop.py +0 -0
  25. {honeybee_radiance_postprocess-0.4.496 → honeybee_radiance_postprocess-0.4.497}/honeybee_radiance_postprocess/cli/postprocess.py +0 -0
  26. {honeybee_radiance_postprocess-0.4.496 → honeybee_radiance_postprocess-0.4.497}/honeybee_radiance_postprocess/cli/schedule.py +0 -0
  27. {honeybee_radiance_postprocess-0.4.496 → honeybee_radiance_postprocess-0.4.497}/honeybee_radiance_postprocess/cli/translate.py +0 -0
  28. {honeybee_radiance_postprocess-0.4.496 → honeybee_radiance_postprocess-0.4.497}/honeybee_radiance_postprocess/cli/two_phase.py +0 -0
  29. {honeybee_radiance_postprocess-0.4.496 → honeybee_radiance_postprocess-0.4.497}/honeybee_radiance_postprocess/cli/util.py +0 -0
  30. {honeybee_radiance_postprocess-0.4.496 → honeybee_radiance_postprocess-0.4.497}/honeybee_radiance_postprocess/cli/viewfactor.py +0 -0
  31. {honeybee_radiance_postprocess-0.4.496 → honeybee_radiance_postprocess-0.4.497}/honeybee_radiance_postprocess/cli/well.py +1 -1
  32. {honeybee_radiance_postprocess-0.4.496 → honeybee_radiance_postprocess-0.4.497}/honeybee_radiance_postprocess/data_type.py +0 -0
  33. {honeybee_radiance_postprocess-0.4.496 → honeybee_radiance_postprocess-0.4.497}/honeybee_radiance_postprocess/dynamic.py +0 -0
  34. {honeybee_radiance_postprocess-0.4.496 → honeybee_radiance_postprocess-0.4.497}/honeybee_radiance_postprocess/electriclight.py +0 -0
  35. {honeybee_radiance_postprocess-0.4.496 → honeybee_radiance_postprocess-0.4.497}/honeybee_radiance_postprocess/en17037.py +0 -0
  36. {honeybee_radiance_postprocess-0.4.496 → honeybee_radiance_postprocess-0.4.497}/honeybee_radiance_postprocess/helper.py +0 -0
  37. {honeybee_radiance_postprocess-0.4.496 → honeybee_radiance_postprocess-0.4.497}/honeybee_radiance_postprocess/ies/__init__.py +0 -0
  38. {honeybee_radiance_postprocess-0.4.496 → honeybee_radiance_postprocess-0.4.497}/honeybee_radiance_postprocess/ies/lm.py +0 -0
  39. {honeybee_radiance_postprocess-0.4.496 → honeybee_radiance_postprocess-0.4.497}/honeybee_radiance_postprocess/ies/lm_schedule.py +0 -0
  40. {honeybee_radiance_postprocess-0.4.496 → honeybee_radiance_postprocess-0.4.497}/honeybee_radiance_postprocess/leed/__init__.py +0 -0
  41. {honeybee_radiance_postprocess-0.4.496 → honeybee_radiance_postprocess-0.4.497}/honeybee_radiance_postprocess/leed/leed.py +0 -0
  42. {honeybee_radiance_postprocess-0.4.496 → honeybee_radiance_postprocess-0.4.497}/honeybee_radiance_postprocess/leed/leed_schedule.py +0 -0
  43. {honeybee_radiance_postprocess-0.4.496 → honeybee_radiance_postprocess-0.4.497}/honeybee_radiance_postprocess/metrics.py +0 -0
  44. {honeybee_radiance_postprocess-0.4.496 → honeybee_radiance_postprocess-0.4.497}/honeybee_radiance_postprocess/reader.py +0 -0
  45. {honeybee_radiance_postprocess-0.4.496 → honeybee_radiance_postprocess-0.4.497}/honeybee_radiance_postprocess/results/__init__.py +0 -0
  46. {honeybee_radiance_postprocess-0.4.496 → honeybee_radiance_postprocess-0.4.497}/honeybee_radiance_postprocess/results/annual_daylight.py +0 -0
  47. {honeybee_radiance_postprocess-0.4.496 → honeybee_radiance_postprocess-0.4.497}/honeybee_radiance_postprocess/results/annual_irradiance.py +0 -0
  48. {honeybee_radiance_postprocess-0.4.496 → honeybee_radiance_postprocess-0.4.497}/honeybee_radiance_postprocess/results/results.py +0 -0
  49. {honeybee_radiance_postprocess-0.4.496 → honeybee_radiance_postprocess-0.4.497}/honeybee_radiance_postprocess/type_hints.py +0 -0
  50. {honeybee_radiance_postprocess-0.4.496 → honeybee_radiance_postprocess-0.4.497}/honeybee_radiance_postprocess/util.py +0 -0
  51. {honeybee_radiance_postprocess-0.4.496 → honeybee_radiance_postprocess-0.4.497}/honeybee_radiance_postprocess/vis_metadata.py +0 -0
  52. {honeybee_radiance_postprocess-0.4.496 → honeybee_radiance_postprocess-0.4.497}/honeybee_radiance_postprocess/well/__init__.py +0 -0
  53. {honeybee_radiance_postprocess-0.4.496 → honeybee_radiance_postprocess-0.4.497}/honeybee_radiance_postprocess/well/well.py +0 -0
  54. {honeybee_radiance_postprocess-0.4.496 → honeybee_radiance_postprocess-0.4.497}/honeybee_radiance_postprocess.egg-info/SOURCES.txt +0 -0
  55. {honeybee_radiance_postprocess-0.4.496 → honeybee_radiance_postprocess-0.4.497}/honeybee_radiance_postprocess.egg-info/dependency_links.txt +0 -0
  56. {honeybee_radiance_postprocess-0.4.496 → honeybee_radiance_postprocess-0.4.497}/honeybee_radiance_postprocess.egg-info/entry_points.txt +0 -0
  57. {honeybee_radiance_postprocess-0.4.496 → honeybee_radiance_postprocess-0.4.497}/honeybee_radiance_postprocess.egg-info/requires.txt +0 -0
  58. {honeybee_radiance_postprocess-0.4.496 → honeybee_radiance_postprocess-0.4.497}/honeybee_radiance_postprocess.egg-info/top_level.txt +0 -0
  59. {honeybee_radiance_postprocess-0.4.496 → honeybee_radiance_postprocess-0.4.497}/requirements.txt +0 -0
  60. {honeybee_radiance_postprocess-0.4.496 → honeybee_radiance_postprocess-0.4.497}/setup.cfg +0 -0
  61. {honeybee_radiance_postprocess-0.4.496 → honeybee_radiance_postprocess-0.4.497}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: honeybee-radiance-postprocess
3
- Version: 0.4.496
3
+ Version: 0.4.497
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
@@ -396,6 +396,10 @@ def breeam_daylight_assessment_4b(
396
396
  metrics_summary['comply'] = True
397
397
  else:
398
398
  metrics_summary['comply'] = False
399
+ metrics_summary['average-comply'] = True if avg_comply else False
400
+ metrics_summary['minimum-comply'] = True if minimum_comply else False
401
+
402
+ metrics_summary['count'] = grid_info['count']
399
403
 
400
404
  type_summary[program_type][grid_info['full_id']].append(metrics_summary)
401
405
 
@@ -467,12 +471,31 @@ def breeam_daylight_assessment_4b(
467
471
  credit_summary.append(_building_type_summary)
468
472
 
469
473
  if sub_folder:
470
- folder = Path(sub_folder)
471
- folder.mkdir(parents=True, exist_ok=True)
474
+ sub_folder = Path(sub_folder)
475
+ sub_folder.mkdir(parents=True, exist_ok=True)
472
476
 
473
- credit_summary_file = folder.joinpath('summary.json')
477
+ credit_summary_file = sub_folder.joinpath('summary.json')
474
478
  credit_summary_file.write_text(json.dumps(credit_summary, indent=2))
475
- program_summary_file = folder.joinpath('program_summary.json')
479
+ program_summary_file = sub_folder.joinpath('program_summary.json')
476
480
  program_summary_file.write_text(json.dumps(program_summary, indent=2))
477
481
 
482
+ pf_folder = sub_folder.joinpath('pass_fail')
483
+ pf_folder.mkdir(parents=True, exist_ok=True)
484
+ grids_info_file = pf_folder.joinpath('grids_info.json')
485
+ grids_info_file.write_text(json.dumps(grids_info, indent=2))
486
+ for program_type, grid_summary in type_summary.items():
487
+ for grid_id, metrics_list in grid_summary.items():
488
+ fill_value = 0
489
+ for metric in metrics_list:
490
+ if metric['comply']:
491
+ fill_value = 3
492
+ break
493
+ elif metric['average-comply']:
494
+ fill_value = 2
495
+ elif metric['minimum-comply']:
496
+ fill_value = 1
497
+ pf_file = pf_folder.joinpath(f'{grid_id}.pf')
498
+ pf_array = np.full(metric['count'], fill_value)
499
+ np.savetxt(pf_file, pf_array, fmt='%d')
500
+
478
501
  return credit_summary, program_summary
@@ -0,0 +1,91 @@
1
+ """Commands for BREEAM post-processing."""
2
+ import sys
3
+ import logging
4
+ from pathlib import Path
5
+ import os
6
+ import json
7
+ import click
8
+
9
+ from ladybug.color import Color
10
+ from ladybug.datatype.generic import GenericType
11
+ from ladybug.legend import LegendParameters
12
+
13
+ from honeybee_radiance_postprocess.breeam.breeam import breeam_daylight_assessment_4b
14
+
15
+ _logger = logging.getLogger(__name__)
16
+
17
+
18
+ @click.group(help='Commands for BREEAM post-processing of Radiance results.')
19
+ def breeam():
20
+ pass
21
+
22
+
23
+ @breeam.command('breeam-4b')
24
+ @click.argument(
25
+ 'folder',
26
+ type=click.Path(exists=True, file_okay=False, dir_okay=True, resolve_path=True)
27
+ )
28
+ @click.option('--model-file', '-m', help='A Honeybee Model file that was used '
29
+ 'in the simulation.', type=click.Path(
30
+ exists=False, file_okay=True, dir_okay=False, resolve_path=True))
31
+ @click.option(
32
+ '--sub-folder', '-sf', help='Relative path for subfolder to write output '
33
+ 'files.', default='breeam_summary', type=click.Path(
34
+ exists=False, file_okay=False, dir_okay=True, resolve_path=True, path_type=Path)
35
+ )
36
+ def breeam_4b(
37
+ folder, model_file, sub_folder
38
+ ):
39
+ """Calculate metrics for BREEAM.
40
+
41
+ \b
42
+ Args:
43
+ folder: Results folder. This folder is an output folder of annual daylight
44
+ recipe.
45
+ model-file: A Honeybee Model file that was used in the simulation.
46
+ """
47
+ try:
48
+ breeam_daylight_assessment_4b(folder, model=model_file, sub_folder=sub_folder)
49
+ except Exception:
50
+ _logger.exception('Failed to calculate BREEAM metrics.')
51
+ sys.exit(1)
52
+ else:
53
+ sys.exit(0)
54
+
55
+
56
+ @breeam.command('breeam-4b-vis-metadata')
57
+ @click.option(
58
+ '--output-folder', '-o', help='Output folder for vis metadata files.',
59
+ type=click.Path(exists=False, file_okay=False, dir_okay=True, resolve_path=True),
60
+ default='visualization', show_default=True
61
+ )
62
+ def breeam_4b_vis(output_folder):
63
+ """Write visualization metadata files for BREEAM 4b."""
64
+ colors = [Color(220, 0, 0), Color(240, 170, 130), Color(250, 200, 170), Color(0, 220, 0)]
65
+ pass_fail_lpar = \
66
+ LegendParameters(min=0, max=3, colors=colors, segment_count=4, title='Pass/Fail')
67
+ pass_fail_lpar.ordinal_dictionary = {
68
+ 0: 'Fail', 1: 'Min. illuminance only', 2: 'Avg. illuminance only', 3: 'Pass'}
69
+
70
+ metric_info_dict = {
71
+ 'pass_fail': {
72
+ 'type': 'VisualizationMetaData',
73
+ 'data_type': GenericType('Pass/Fail', '').to_dict(),
74
+ 'unit': '',
75
+ 'legend_parameters': pass_fail_lpar.to_dict()
76
+ }
77
+ }
78
+ try:
79
+ if not os.path.exists(output_folder):
80
+ os.mkdir(output_folder)
81
+ for metric, data in metric_info_dict.items():
82
+ if not os.path.exists(os.path.join(output_folder, metric)):
83
+ os.mkdir(os.path.join(output_folder, metric))
84
+ file_path = os.path.join(output_folder, metric, 'vis_metadata.json')
85
+ with open(file_path, 'w') as fp:
86
+ json.dump(data, fp, indent=4)
87
+ except Exception:
88
+ _logger.exception('Failed to write the visualization metadata files.')
89
+ sys.exit(1)
90
+ else:
91
+ sys.exit(0)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: honeybee-radiance-postprocess
3
- Version: 0.4.496
3
+ Version: 0.4.497
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
@@ -1,47 +0,0 @@
1
- """Commands for BREEAM post-processing."""
2
- import sys
3
- import logging
4
- from pathlib import Path
5
- import click
6
-
7
- from honeybee_radiance_postprocess.breeam.breeam import breeam_daylight_assessment_4b
8
-
9
- _logger = logging.getLogger(__name__)
10
-
11
-
12
- @click.group(help='Commands for BREEAM post-processing of Radiance results.')
13
- def breeam():
14
- pass
15
-
16
-
17
- @breeam.command('breeam-4b')
18
- @click.argument(
19
- 'folder',
20
- type=click.Path(exists=True, file_okay=False, dir_okay=True, resolve_path=True)
21
- )
22
- @click.option('--model-file', '-m', help='A Honeybee Model file that was used '
23
- 'in the simulation.', type=click.Path(
24
- exists=False, file_okay=True, dir_okay=False, resolve_path=True))
25
- @click.option(
26
- '--sub-folder', '-sf', help='Relative path for subfolder to write output '
27
- 'files.', default='breeam_summary', type=click.Path(
28
- exists=False, file_okay=False, dir_okay=True, resolve_path=True, path_type=Path)
29
- )
30
- def breeam_4b(
31
- folder, model_file, sub_folder
32
- ):
33
- """Calculate metrics for BREEAM.
34
-
35
- \b
36
- Args:
37
- folder: Results folder. This folder is an output folder of annual daylight
38
- recipe.
39
- model-file: A Honeybee Model file that was used in the simulation.
40
- """
41
- try:
42
- breeam_daylight_assessment_4b(folder, model=model_file, sub_folder=sub_folder)
43
- except Exception:
44
- _logger.exception('Failed to calculate BREEAM metrics.')
45
- sys.exit(1)
46
- else:
47
- sys.exit(0)
@@ -1,9 +1,9 @@
1
1
  """honeybee-radiance-postprocess WELL commands."""
2
2
  import sys
3
3
  import logging
4
- import click
5
4
  import json
6
5
  import os
6
+ import click
7
7
 
8
8
  from ladybug.color import Color
9
9
  from ladybug.datatype.generic import GenericType