honeybee-radiance 1.66.190__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.

Potentially problematic release.


This version of honeybee-radiance might be problematic. Click here for more details.

Files changed (152) hide show
  1. honeybee_radiance/__init__.py +11 -0
  2. honeybee_radiance/__main__.py +4 -0
  3. honeybee_radiance/_extend_honeybee.py +93 -0
  4. honeybee_radiance/cli/__init__.py +88 -0
  5. honeybee_radiance/cli/dc.py +400 -0
  6. honeybee_radiance/cli/edit.py +529 -0
  7. honeybee_radiance/cli/glare.py +118 -0
  8. honeybee_radiance/cli/grid.py +859 -0
  9. honeybee_radiance/cli/lib.py +458 -0
  10. honeybee_radiance/cli/modifier.py +133 -0
  11. honeybee_radiance/cli/mtx.py +226 -0
  12. honeybee_radiance/cli/multiphase.py +1034 -0
  13. honeybee_radiance/cli/octree.py +640 -0
  14. honeybee_radiance/cli/postprocess.py +1186 -0
  15. honeybee_radiance/cli/raytrace.py +219 -0
  16. honeybee_radiance/cli/rpict.py +125 -0
  17. honeybee_radiance/cli/schedule.py +56 -0
  18. honeybee_radiance/cli/setconfig.py +63 -0
  19. honeybee_radiance/cli/sky.py +545 -0
  20. honeybee_radiance/cli/study.py +66 -0
  21. honeybee_radiance/cli/sunpath.py +331 -0
  22. honeybee_radiance/cli/threephase.py +255 -0
  23. honeybee_radiance/cli/translate.py +400 -0
  24. honeybee_radiance/cli/util.py +121 -0
  25. honeybee_radiance/cli/view.py +261 -0
  26. honeybee_radiance/cli/viewfactor.py +347 -0
  27. honeybee_radiance/config.json +6 -0
  28. honeybee_radiance/config.py +427 -0
  29. honeybee_radiance/dictutil.py +50 -0
  30. honeybee_radiance/dynamic/__init__.py +5 -0
  31. honeybee_radiance/dynamic/group.py +479 -0
  32. honeybee_radiance/dynamic/multiphase.py +557 -0
  33. honeybee_radiance/dynamic/state.py +718 -0
  34. honeybee_radiance/dynamic/stategeo.py +352 -0
  35. honeybee_radiance/geometry/__init__.py +13 -0
  36. honeybee_radiance/geometry/bubble.py +42 -0
  37. honeybee_radiance/geometry/cone.py +215 -0
  38. honeybee_radiance/geometry/cup.py +54 -0
  39. honeybee_radiance/geometry/cylinder.py +197 -0
  40. honeybee_radiance/geometry/geometrybase.py +37 -0
  41. honeybee_radiance/geometry/instance.py +40 -0
  42. honeybee_radiance/geometry/mesh.py +38 -0
  43. honeybee_radiance/geometry/polygon.py +174 -0
  44. honeybee_radiance/geometry/ring.py +214 -0
  45. honeybee_radiance/geometry/source.py +182 -0
  46. honeybee_radiance/geometry/sphere.py +178 -0
  47. honeybee_radiance/geometry/tube.py +46 -0
  48. honeybee_radiance/lib/__init__.py +1 -0
  49. honeybee_radiance/lib/_loadmodifiers.py +72 -0
  50. honeybee_radiance/lib/_loadmodifiersets.py +69 -0
  51. honeybee_radiance/lib/modifiers.py +58 -0
  52. honeybee_radiance/lib/modifiersets.py +63 -0
  53. honeybee_radiance/lightpath.py +204 -0
  54. honeybee_radiance/lightsource/__init__.py +1 -0
  55. honeybee_radiance/lightsource/_gendaylit.py +479 -0
  56. honeybee_radiance/lightsource/dictutil.py +49 -0
  57. honeybee_radiance/lightsource/ground.py +160 -0
  58. honeybee_radiance/lightsource/sky/__init__.py +7 -0
  59. honeybee_radiance/lightsource/sky/_skybase.py +177 -0
  60. honeybee_radiance/lightsource/sky/certainirradiance.py +232 -0
  61. honeybee_radiance/lightsource/sky/cie.py +378 -0
  62. honeybee_radiance/lightsource/sky/climatebased.py +501 -0
  63. honeybee_radiance/lightsource/sky/hemisphere.py +160 -0
  64. honeybee_radiance/lightsource/sky/skydome.py +113 -0
  65. honeybee_radiance/lightsource/sky/skymatrix.py +163 -0
  66. honeybee_radiance/lightsource/sky/strutil.py +34 -0
  67. honeybee_radiance/lightsource/sky/sunmatrix.py +212 -0
  68. honeybee_radiance/lightsource/sunpath.py +247 -0
  69. honeybee_radiance/modifier/__init__.py +3 -0
  70. honeybee_radiance/modifier/material/__init__.py +30 -0
  71. honeybee_radiance/modifier/material/absdf.py +477 -0
  72. honeybee_radiance/modifier/material/antimatter.py +54 -0
  73. honeybee_radiance/modifier/material/ashik2.py +51 -0
  74. honeybee_radiance/modifier/material/brtdfunc.py +81 -0
  75. honeybee_radiance/modifier/material/bsdf.py +292 -0
  76. honeybee_radiance/modifier/material/dielectric.py +53 -0
  77. honeybee_radiance/modifier/material/glass.py +431 -0
  78. honeybee_radiance/modifier/material/glow.py +246 -0
  79. honeybee_radiance/modifier/material/illum.py +51 -0
  80. honeybee_radiance/modifier/material/interface.py +49 -0
  81. honeybee_radiance/modifier/material/light.py +206 -0
  82. honeybee_radiance/modifier/material/materialbase.py +36 -0
  83. honeybee_radiance/modifier/material/metal.py +167 -0
  84. honeybee_radiance/modifier/material/metal2.py +41 -0
  85. honeybee_radiance/modifier/material/metdata.py +41 -0
  86. honeybee_radiance/modifier/material/metfunc.py +41 -0
  87. honeybee_radiance/modifier/material/mirror.py +340 -0
  88. honeybee_radiance/modifier/material/mist.py +86 -0
  89. honeybee_radiance/modifier/material/plasdata.py +58 -0
  90. honeybee_radiance/modifier/material/plasfunc.py +59 -0
  91. honeybee_radiance/modifier/material/plastic.py +354 -0
  92. honeybee_radiance/modifier/material/plastic2.py +58 -0
  93. honeybee_radiance/modifier/material/prism1.py +57 -0
  94. honeybee_radiance/modifier/material/prism2.py +48 -0
  95. honeybee_radiance/modifier/material/spotlight.py +50 -0
  96. honeybee_radiance/modifier/material/trans.py +518 -0
  97. honeybee_radiance/modifier/material/trans2.py +49 -0
  98. honeybee_radiance/modifier/material/transdata.py +50 -0
  99. honeybee_radiance/modifier/material/transfunc.py +53 -0
  100. honeybee_radiance/modifier/mixture/__init__.py +6 -0
  101. honeybee_radiance/modifier/mixture/mixdata.py +49 -0
  102. honeybee_radiance/modifier/mixture/mixfunc.py +54 -0
  103. honeybee_radiance/modifier/mixture/mixpict.py +52 -0
  104. honeybee_radiance/modifier/mixture/mixtext.py +66 -0
  105. honeybee_radiance/modifier/mixture/mixturebase.py +28 -0
  106. honeybee_radiance/modifier/modifierbase.py +40 -0
  107. honeybee_radiance/modifier/pattern/__init__.py +9 -0
  108. honeybee_radiance/modifier/pattern/brightdata.py +49 -0
  109. honeybee_radiance/modifier/pattern/brightfunc.py +47 -0
  110. honeybee_radiance/modifier/pattern/brighttext.py +81 -0
  111. honeybee_radiance/modifier/pattern/colordata.py +56 -0
  112. honeybee_radiance/modifier/pattern/colorfunc.py +47 -0
  113. honeybee_radiance/modifier/pattern/colorpict.py +54 -0
  114. honeybee_radiance/modifier/pattern/colortext.py +73 -0
  115. honeybee_radiance/modifier/pattern/patternbase.py +34 -0
  116. honeybee_radiance/modifier/texture/__init__.py +4 -0
  117. honeybee_radiance/modifier/texture/texdata.py +29 -0
  118. honeybee_radiance/modifier/texture/texfunc.py +26 -0
  119. honeybee_radiance/modifier/texture/texturebase.py +27 -0
  120. honeybee_radiance/modifierset.py +1091 -0
  121. honeybee_radiance/mutil.py +60 -0
  122. honeybee_radiance/postprocess/__init__.py +1 -0
  123. honeybee_radiance/postprocess/annual.py +108 -0
  124. honeybee_radiance/postprocess/annualdaylight.py +425 -0
  125. honeybee_radiance/postprocess/annualglare.py +201 -0
  126. honeybee_radiance/postprocess/annualirradiance.py +187 -0
  127. honeybee_radiance/postprocess/electriclight.py +119 -0
  128. honeybee_radiance/postprocess/en17037.py +261 -0
  129. honeybee_radiance/postprocess/leed.py +304 -0
  130. honeybee_radiance/postprocess/solartracking.py +90 -0
  131. honeybee_radiance/primitive.py +554 -0
  132. honeybee_radiance/properties/__init__.py +1 -0
  133. honeybee_radiance/properties/_base.py +390 -0
  134. honeybee_radiance/properties/aperture.py +197 -0
  135. honeybee_radiance/properties/door.py +198 -0
  136. honeybee_radiance/properties/face.py +123 -0
  137. honeybee_radiance/properties/model.py +1291 -0
  138. honeybee_radiance/properties/room.py +490 -0
  139. honeybee_radiance/properties/shade.py +186 -0
  140. honeybee_radiance/properties/shademesh.py +116 -0
  141. honeybee_radiance/putil.py +44 -0
  142. honeybee_radiance/reader.py +214 -0
  143. honeybee_radiance/sensor.py +166 -0
  144. honeybee_radiance/sensorgrid.py +1008 -0
  145. honeybee_radiance/view.py +1101 -0
  146. honeybee_radiance/writer.py +951 -0
  147. honeybee_radiance-1.66.190.dist-info/METADATA +89 -0
  148. honeybee_radiance-1.66.190.dist-info/RECORD +152 -0
  149. honeybee_radiance-1.66.190.dist-info/WHEEL +5 -0
  150. honeybee_radiance-1.66.190.dist-info/entry_points.txt +2 -0
  151. honeybee_radiance-1.66.190.dist-info/licenses/LICENSE +661 -0
  152. honeybee_radiance-1.66.190.dist-info/top_level.txt +1 -0
@@ -0,0 +1,226 @@
1
+ """Commands to work with Radiance matrix using rmtxopt and rcollate."""
2
+ import click
3
+ import sys
4
+ import os
5
+ import logging
6
+
7
+ from honeybee_radiance.config import folders
8
+ from honeybee_radiance_command._command_util import run_command
9
+
10
+ from .util import handle_operator
11
+
12
+
13
+ _logger = logging.getLogger(__name__)
14
+
15
+
16
+ @click.group(help='Commands to work with Radiance matrix using rmtxop.')
17
+ def mtxop():
18
+ pass
19
+
20
+
21
+ @mtxop.command('operate-two')
22
+ @click.argument(
23
+ 'first-mtx', type=click.Path(exists=True, dir_okay=False, resolve_path=True)
24
+ )
25
+ @click.argument(
26
+ 'second-mtx', type=click.Path(exists=True, dir_okay=False, resolve_path=True)
27
+ )
28
+ @click.option(
29
+ '--operator', type=click.Choice(['+', '-', '/', '*']), default='+',
30
+ help='operation between the two matrices.'
31
+ )
32
+ @click.option(
33
+ '--keep-header/--remove-header', is_flag=True, default=True,
34
+ help='A flag to keep or remove the header from the output file.'
35
+ )
36
+ @click.option(
37
+ '--conversion', help='conversion as a string which will be passed to rmtxop -c. '
38
+ 'This option is useful to post-process the results from 3 RGB components into one '
39
+ 'as part of this command.'
40
+ )
41
+ @click.option(
42
+ '--output-mtx',
43
+ type=click.Path(
44
+ exists=False, file_okay=True, dir_okay=False, resolve_path=True
45
+ ),
46
+ help='Output matrix.'
47
+ )
48
+ @click.option(
49
+ '--output-format', help='Output format for output matrix. Valid inputs are a, f, d '
50
+ 'and c for ASCII, float, double or RGBE colors. If conversion is not provided you '
51
+ 'can change the output type using rad-params options.',
52
+ type=click.Choice(['a', 'f', 'd', 'c']), default='a', show_default=True,
53
+ show_choices=True
54
+ )
55
+ @click.option(
56
+ '--dry-run', is_flag=True, default=False, show_default=True,
57
+ help='A flag to show the command without running it.'
58
+ )
59
+ def two_matrix_operations(
60
+ first_mtx, second_mtx, operator, keep_header, conversion, output_mtx,
61
+ output_format, dry_run
62
+ ):
63
+ """Operations between two Radiance matrices.
64
+
65
+ \b
66
+ Args:
67
+ first-mtx: Path to first matrix.
68
+ second-mtx: Path to second matrix.
69
+ """
70
+ try:
71
+ # first check to be sure there are sun-up hours; if so, write a blank file
72
+ if os.path.getsize(first_mtx) == 0 or os.path.getsize(second_mtx) == 0:
73
+ if output_mtx is not None:
74
+ with open(output_mtx, 'w') as wf:
75
+ wf.write('')
76
+ return
77
+
78
+ cmd = 'rmtxop -f{output_format} "{first_mtx}" {operator} "{second_mtx}"'.format(
79
+ output_format=output_format, first_mtx=first_mtx,
80
+ operator=handle_operator(operator), second_mtx=second_mtx
81
+ )
82
+
83
+ if conversion and conversion.strip():
84
+ cmd = cmd + ' -c {conversion}'.format(conversion=conversion)
85
+
86
+ if not keep_header:
87
+ cmd = cmd + ' | getinfo - '
88
+ if output_mtx:
89
+ cmd = cmd + ' > "%s"' % output_mtx
90
+ if dry_run:
91
+ click.echo(cmd)
92
+ sys.exit(0)
93
+
94
+ run_command(cmd, env=folders.env)
95
+ except Exception:
96
+ _logger.exception('Operation on two Radiance matrix failed.')
97
+ sys.exit(1)
98
+ else:
99
+ sys.exit(0)
100
+
101
+
102
+ @mtxop.command('operate-three')
103
+ @click.argument(
104
+ 'first-mtx', type=click.Path(exists=True, dir_okay=False, resolve_path=True)
105
+ )
106
+ @click.argument(
107
+ 'second-mtx', type=click.Path(exists=True, dir_okay=False, resolve_path=True)
108
+ )
109
+ @click.argument(
110
+ 'third-mtx', type=click.Path(exists=True, dir_okay=False, resolve_path=True)
111
+ )
112
+ @click.option(
113
+ '--operator-one', type=click.Choice(['+', '-', '/', '*']), default='+',
114
+ help='operation between the two matrices.'
115
+ )
116
+ @click.option(
117
+ '--operator-two', type=click.Choice(['+', '-', '/', '*']), default='+',
118
+ help='operation between the two matrices.'
119
+ )
120
+ @click.option(
121
+ '--keep-header/--remove-header', is_flag=True, default=True,
122
+ help='A flag to keep or remove the header from the output file.'
123
+ )
124
+ @click.option(
125
+ '--conversion', help='conversion as a string which will be passed to rmtxop -c. '
126
+ 'This option is useful to post-process the results from 3 RGB components into one '
127
+ 'as part of this command.'
128
+ )
129
+ @click.option(
130
+ '--output-mtx',
131
+ type=click.Path(
132
+ exists=False, file_okay=True, dir_okay=False, resolve_path=True
133
+ ),
134
+ help='Output matrix.'
135
+ )
136
+ @click.option(
137
+ '--output-format', help='Output format for output matrix. Valid inputs are a, f, d '
138
+ 'and c for ASCII, float, double or RGBE colors. If conversion is not provided you '
139
+ 'can change the output type using rad-params options.',
140
+ type=click.Choice(['a', 'f', 'd', 'c']), default='a', show_default=True,
141
+ show_choices=True
142
+ )
143
+ @click.option(
144
+ '--dry-run', is_flag=True, default=False, show_default=True,
145
+ help='A flag to show the command without running it.'
146
+ )
147
+ def three_matrix_operations(
148
+ first_mtx, second_mtx, third_mtx, operator_one, operator_two, keep_header,
149
+ conversion, output_mtx, output_format, dry_run
150
+ ):
151
+ """Operations between three Radiance matrices.
152
+
153
+ \b
154
+ Args:
155
+ first-mtx: Path to fist matrix.
156
+ second-mtx: Path to second matrix.
157
+ third-mtx: Path to third matrix.
158
+ """
159
+ try:
160
+ # first check to be sure there are sun-up hours; if so, write a blank file
161
+ if os.path.getsize(first_mtx) == 0 or os.path.getsize(second_mtx) == 0 \
162
+ or os.path.getsize(third_mtx) == 0:
163
+ if output_mtx is not None:
164
+ with open(output_mtx, 'w') as wf:
165
+ wf.write('')
166
+ return
167
+
168
+ cmd = 'rmtxop -f{output_format} "{first_mtx}" {operator_one} "{second_mtx}" ' \
169
+ ' {operator_two} "{third_mtx}"'.format(
170
+ output_format=output_format, first_mtx=first_mtx,
171
+ operator_one=handle_operator(operator_one), second_mtx=second_mtx,
172
+ operator_two=handle_operator(operator_two), third_mtx=third_mtx
173
+ )
174
+
175
+ if conversion and conversion.strip():
176
+ cmd = cmd + ' -c {conversion}'.format(conversion=conversion)
177
+
178
+ if not keep_header:
179
+ cmd = cmd + ' | getinfo - '
180
+
181
+ if output_mtx:
182
+ cmd = cmd + ' > "%s"' % output_mtx
183
+
184
+ if dry_run:
185
+ click.echo(cmd)
186
+ sys.exit(0)
187
+
188
+ run_command(cmd, env=folders.env)
189
+ except Exception:
190
+ _logger.exception('Operation on three Radiance matrix failed.')
191
+ sys.exit(1)
192
+ else:
193
+ sys.exit(0)
194
+
195
+
196
+ @mtxop.command('transpose')
197
+ @click.argument(
198
+ 'input-mtx', type=click.Path(exists=True, dir_okay=False, resolve_path=True)
199
+ )
200
+ @click.option('--output-mtx', type=click.Path(
201
+ exists=False, file_okay=True, dir_okay=False, resolve_path=True
202
+ ), help='Output matrix.')
203
+ @click.option(
204
+ '--dry-run', is_flag=True, default=False, show_default=True,
205
+ help='A flag to show the command without running it.'
206
+ )
207
+ def transpose_mtx(input_mtx, output_mtx, dry_run):
208
+ """Transpose a Radiance matrix.
209
+
210
+ \b
211
+ Args:
212
+ input_mtx: Path to input matrix file.
213
+ """
214
+ try:
215
+ cmd = 'rcollate -t "%s" ' % input_mtx
216
+ if output_mtx:
217
+ cmd = cmd + ' > "%s"' % output_mtx
218
+ if dry_run:
219
+ click.echo(cmd)
220
+ sys.exit(0)
221
+ run_command(cmd, env=folders.env)
222
+ except Exception:
223
+ _logger.exception('Matrix transpose command failed.')
224
+ sys.exit(1)
225
+ else:
226
+ sys.exit(0)