honeybee-radiance-postprocess 0.4.555__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.
Files changed (50) hide show
  1. honeybee_radiance_postprocess/__init__.py +1 -0
  2. honeybee_radiance_postprocess/__main__.py +4 -0
  3. honeybee_radiance_postprocess/annual.py +73 -0
  4. honeybee_radiance_postprocess/annualdaylight.py +289 -0
  5. honeybee_radiance_postprocess/annualirradiance.py +35 -0
  6. honeybee_radiance_postprocess/breeam/__init__.py +1 -0
  7. honeybee_radiance_postprocess/breeam/breeam.py +552 -0
  8. honeybee_radiance_postprocess/cli/__init__.py +33 -0
  9. honeybee_radiance_postprocess/cli/abnt.py +392 -0
  10. honeybee_radiance_postprocess/cli/breeam.py +96 -0
  11. honeybee_radiance_postprocess/cli/datacollection.py +133 -0
  12. honeybee_radiance_postprocess/cli/grid.py +295 -0
  13. honeybee_radiance_postprocess/cli/leed.py +143 -0
  14. honeybee_radiance_postprocess/cli/merge.py +161 -0
  15. honeybee_radiance_postprocess/cli/mtxop.py +161 -0
  16. honeybee_radiance_postprocess/cli/postprocess.py +1092 -0
  17. honeybee_radiance_postprocess/cli/schedule.py +103 -0
  18. honeybee_radiance_postprocess/cli/translate.py +216 -0
  19. honeybee_radiance_postprocess/cli/two_phase.py +252 -0
  20. honeybee_radiance_postprocess/cli/util.py +121 -0
  21. honeybee_radiance_postprocess/cli/viewfactor.py +157 -0
  22. honeybee_radiance_postprocess/cli/well.py +110 -0
  23. honeybee_radiance_postprocess/data_type.py +102 -0
  24. honeybee_radiance_postprocess/dynamic.py +273 -0
  25. honeybee_radiance_postprocess/electriclight.py +24 -0
  26. honeybee_radiance_postprocess/en17037.py +304 -0
  27. honeybee_radiance_postprocess/helper.py +266 -0
  28. honeybee_radiance_postprocess/ies/__init__.py +1 -0
  29. honeybee_radiance_postprocess/ies/lm.py +224 -0
  30. honeybee_radiance_postprocess/ies/lm_schedule.py +248 -0
  31. honeybee_radiance_postprocess/leed/__init__.py +1 -0
  32. honeybee_radiance_postprocess/leed/leed.py +801 -0
  33. honeybee_radiance_postprocess/leed/leed_schedule.py +256 -0
  34. honeybee_radiance_postprocess/metrics.py +439 -0
  35. honeybee_radiance_postprocess/reader.py +80 -0
  36. honeybee_radiance_postprocess/results/__init__.py +4 -0
  37. honeybee_radiance_postprocess/results/annual_daylight.py +752 -0
  38. honeybee_radiance_postprocess/results/annual_irradiance.py +196 -0
  39. honeybee_radiance_postprocess/results/results.py +1416 -0
  40. honeybee_radiance_postprocess/type_hints.py +38 -0
  41. honeybee_radiance_postprocess/util.py +211 -0
  42. honeybee_radiance_postprocess/vis_metadata.py +49 -0
  43. honeybee_radiance_postprocess/well/__init__.py +1 -0
  44. honeybee_radiance_postprocess/well/well.py +509 -0
  45. honeybee_radiance_postprocess-0.4.555.dist-info/METADATA +79 -0
  46. honeybee_radiance_postprocess-0.4.555.dist-info/RECORD +50 -0
  47. honeybee_radiance_postprocess-0.4.555.dist-info/WHEEL +5 -0
  48. honeybee_radiance_postprocess-0.4.555.dist-info/entry_points.txt +2 -0
  49. honeybee_radiance_postprocess-0.4.555.dist-info/licenses/LICENSE +661 -0
  50. honeybee_radiance_postprocess-0.4.555.dist-info/top_level.txt +1 -0
@@ -0,0 +1,80 @@
1
+ """Post-processing reader functions."""
2
+ try:
3
+ import cupy as np
4
+ is_gpu = True
5
+ except ImportError:
6
+ is_gpu = False
7
+ import numpy as np
8
+
9
+ from .util import binary_mtx_dimension
10
+
11
+
12
+ def binary_to_array(
13
+ binary_file: str, nrows: int = None, ncols: int = None,
14
+ ncomp: int = None, fmt=None, line_count: int = 0) -> np.ndarray:
15
+ """Read a Radiance binary file as a NumPy array.
16
+
17
+ Args:
18
+ binary_file: Path to binary Radiance file.
19
+ nrows: Number of rows in the Radiance file.
20
+ ncols: Number of columns in the Radiance file.
21
+ ncomp: Number of components of each element in the Radiance file.
22
+ fmt: Format of the Radiance file. Can be either "ascii", "float", or "double.
23
+ line_count: Number of lines to skip in the input file. Usually used to
24
+ skip the header.
25
+
26
+ Returns:
27
+ A NumPy array.
28
+ """
29
+ if (nrows or ncols or ncomp or fmt) is None:
30
+ # get nrows, ncols and header line count
31
+ nrows, ncols, ncomp, line_count, fmt = binary_mtx_dimension(binary_file)
32
+ with open(binary_file, 'rb') as reader:
33
+ # skip first n lines from reader
34
+ for i in range(line_count):
35
+ reader.readline()
36
+
37
+ if fmt == 'ascii':
38
+ array = np.loadtxt(reader, dtype=np.float32)
39
+ elif fmt == 'float':
40
+ array = np.fromfile(reader, dtype=np.float32)
41
+ elif fmt == 'double':
42
+ array = np.fromfile(reader, dtype=np.float64)
43
+
44
+ if ncomp != 1:
45
+ array = array.reshape(nrows, ncols, ncomp)
46
+ else:
47
+ array = array.reshape(nrows, ncols)
48
+
49
+ return array
50
+
51
+
52
+ def ascii_to_array(
53
+ ascii_file: str, nrows: int = None, ncols: int = None,
54
+ ncomp: int = None, line_count: int = 0) -> np.ndarray:
55
+ """Read a Radiance ascii file as a NumPy array.
56
+
57
+ Args:
58
+ ascii_file: Path to ascii Radiance file.
59
+ nrows: Number of rows in the Radiance file.
60
+ ncols: Number of columns in the Radiance file.
61
+ ncomp: Number of components of each element in the Radiance file.
62
+ line_count: Number of lines to skip in the input file. Usually used to
63
+ skip the header.
64
+
65
+ Returns:
66
+ A NumPy array.
67
+ """
68
+ with open(ascii_file, 'r') as reader:
69
+ if (nrows or ncols or ncomp) is None:
70
+ # get nrows, ncols and header line count
71
+ # we can reuse binary_mtx_dimension though the input file is ascii
72
+ nrows, ncols, ncomp, line_count, fmt = binary_mtx_dimension(ascii_file)
73
+
74
+ array = np.loadtxt(reader, dtype=np.float32, skiprows=line_count)
75
+ if ncomp != 1:
76
+ array = array.reshape(nrows, ncols, ncomp)
77
+ else:
78
+ array = array.reshape(nrows, ncols)
79
+
80
+ return array
@@ -0,0 +1,4 @@
1
+ """honeybee-radiance-postprocess library."""
2
+ from .results import _ResultsFolder, Results
3
+ from .annual_daylight import AnnualDaylight
4
+ from .annual_irradiance import AnnualIrradiance