honeybee-radiance-postprocess 0.4.337__tar.gz → 0.4.338__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 (43) hide show
  1. {honeybee-radiance-postprocess-0.4.337 → honeybee-radiance-postprocess-0.4.338}/PKG-INFO +1 -1
  2. {honeybee-radiance-postprocess-0.4.337 → honeybee-radiance-postprocess-0.4.338}/honeybee_radiance_postprocess/cli/grid.py +44 -4
  3. {honeybee-radiance-postprocess-0.4.337 → honeybee-radiance-postprocess-0.4.338}/honeybee_radiance_postprocess/cli/postprocess.py +2 -2
  4. {honeybee-radiance-postprocess-0.4.337 → honeybee-radiance-postprocess-0.4.338}/honeybee_radiance_postprocess.egg-info/PKG-INFO +1 -1
  5. {honeybee-radiance-postprocess-0.4.337 → honeybee-radiance-postprocess-0.4.338}/CODE_OF_CONDUCT.md +0 -0
  6. {honeybee-radiance-postprocess-0.4.337 → honeybee-radiance-postprocess-0.4.338}/CONTRIBUTING.md +0 -0
  7. {honeybee-radiance-postprocess-0.4.337 → honeybee-radiance-postprocess-0.4.338}/LICENSE +0 -0
  8. {honeybee-radiance-postprocess-0.4.337 → honeybee-radiance-postprocess-0.4.338}/MANIFEST.in +0 -0
  9. {honeybee-radiance-postprocess-0.4.337 → honeybee-radiance-postprocess-0.4.338}/README.md +0 -0
  10. {honeybee-radiance-postprocess-0.4.337 → honeybee-radiance-postprocess-0.4.338}/dev-requirements.txt +0 -0
  11. {honeybee-radiance-postprocess-0.4.337 → honeybee-radiance-postprocess-0.4.338}/honeybee_radiance_postprocess/__init__.py +0 -0
  12. {honeybee-radiance-postprocess-0.4.337 → honeybee-radiance-postprocess-0.4.338}/honeybee_radiance_postprocess/__main__.py +0 -0
  13. {honeybee-radiance-postprocess-0.4.337 → honeybee-radiance-postprocess-0.4.338}/honeybee_radiance_postprocess/annual.py +0 -0
  14. {honeybee-radiance-postprocess-0.4.337 → honeybee-radiance-postprocess-0.4.338}/honeybee_radiance_postprocess/annualdaylight.py +0 -0
  15. {honeybee-radiance-postprocess-0.4.337 → honeybee-radiance-postprocess-0.4.338}/honeybee_radiance_postprocess/annualirradiance.py +0 -0
  16. {honeybee-radiance-postprocess-0.4.337 → honeybee-radiance-postprocess-0.4.338}/honeybee_radiance_postprocess/cli/__init__.py +0 -0
  17. {honeybee-radiance-postprocess-0.4.337 → honeybee-radiance-postprocess-0.4.338}/honeybee_radiance_postprocess/cli/leed.py +0 -0
  18. {honeybee-radiance-postprocess-0.4.337 → honeybee-radiance-postprocess-0.4.338}/honeybee_radiance_postprocess/cli/mtxop.py +0 -0
  19. {honeybee-radiance-postprocess-0.4.337 → honeybee-radiance-postprocess-0.4.338}/honeybee_radiance_postprocess/cli/schedule.py +0 -0
  20. {honeybee-radiance-postprocess-0.4.337 → honeybee-radiance-postprocess-0.4.338}/honeybee_radiance_postprocess/cli/translate.py +0 -0
  21. {honeybee-radiance-postprocess-0.4.337 → honeybee-radiance-postprocess-0.4.338}/honeybee_radiance_postprocess/cli/two_phase.py +0 -0
  22. {honeybee-radiance-postprocess-0.4.337 → honeybee-radiance-postprocess-0.4.338}/honeybee_radiance_postprocess/cli/util.py +0 -0
  23. {honeybee-radiance-postprocess-0.4.337 → honeybee-radiance-postprocess-0.4.338}/honeybee_radiance_postprocess/dynamic.py +0 -0
  24. {honeybee-radiance-postprocess-0.4.337 → honeybee-radiance-postprocess-0.4.338}/honeybee_radiance_postprocess/electriclight.py +0 -0
  25. {honeybee-radiance-postprocess-0.4.337 → honeybee-radiance-postprocess-0.4.338}/honeybee_radiance_postprocess/en17037.py +0 -0
  26. {honeybee-radiance-postprocess-0.4.337 → honeybee-radiance-postprocess-0.4.338}/honeybee_radiance_postprocess/helper.py +0 -0
  27. {honeybee-radiance-postprocess-0.4.337 → honeybee-radiance-postprocess-0.4.338}/honeybee_radiance_postprocess/leed.py +0 -0
  28. {honeybee-radiance-postprocess-0.4.337 → honeybee-radiance-postprocess-0.4.338}/honeybee_radiance_postprocess/metrics.py +0 -0
  29. {honeybee-radiance-postprocess-0.4.337 → honeybee-radiance-postprocess-0.4.338}/honeybee_radiance_postprocess/reader.py +0 -0
  30. {honeybee-radiance-postprocess-0.4.337 → honeybee-radiance-postprocess-0.4.338}/honeybee_radiance_postprocess/results/__init__.py +0 -0
  31. {honeybee-radiance-postprocess-0.4.337 → honeybee-radiance-postprocess-0.4.338}/honeybee_radiance_postprocess/results/annual_daylight.py +0 -0
  32. {honeybee-radiance-postprocess-0.4.337 → honeybee-radiance-postprocess-0.4.338}/honeybee_radiance_postprocess/results/annual_irradiance.py +0 -0
  33. {honeybee-radiance-postprocess-0.4.337 → honeybee-radiance-postprocess-0.4.338}/honeybee_radiance_postprocess/results/results.py +0 -0
  34. {honeybee-radiance-postprocess-0.4.337 → honeybee-radiance-postprocess-0.4.338}/honeybee_radiance_postprocess/type_hints.py +0 -0
  35. {honeybee-radiance-postprocess-0.4.337 → honeybee-radiance-postprocess-0.4.338}/honeybee_radiance_postprocess/util.py +0 -0
  36. {honeybee-radiance-postprocess-0.4.337 → honeybee-radiance-postprocess-0.4.338}/honeybee_radiance_postprocess.egg-info/SOURCES.txt +0 -0
  37. {honeybee-radiance-postprocess-0.4.337 → honeybee-radiance-postprocess-0.4.338}/honeybee_radiance_postprocess.egg-info/dependency_links.txt +0 -0
  38. {honeybee-radiance-postprocess-0.4.337 → honeybee-radiance-postprocess-0.4.338}/honeybee_radiance_postprocess.egg-info/entry_points.txt +0 -0
  39. {honeybee-radiance-postprocess-0.4.337 → honeybee-radiance-postprocess-0.4.338}/honeybee_radiance_postprocess.egg-info/requires.txt +0 -0
  40. {honeybee-radiance-postprocess-0.4.337 → honeybee-radiance-postprocess-0.4.338}/honeybee_radiance_postprocess.egg-info/top_level.txt +0 -0
  41. {honeybee-radiance-postprocess-0.4.337 → honeybee-radiance-postprocess-0.4.338}/requirements.txt +0 -0
  42. {honeybee-radiance-postprocess-0.4.337 → honeybee-radiance-postprocess-0.4.338}/setup.cfg +0 -0
  43. {honeybee-radiance-postprocess-0.4.337 → honeybee-radiance-postprocess-0.4.338}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: honeybee-radiance-postprocess
3
- Version: 0.4.337
3
+ Version: 0.4.338
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
@@ -31,7 +31,28 @@ def grid():
31
31
  '. Alternatively, the command will look for a _redist_info.json file inside the '
32
32
  'folder.', type=click.Path(file_okay=True, dir_okay=False, resolve_path=True)
33
33
  )
34
- def merge_grid_folder(input_folder, output_folder, extension, dist_info):
34
+ @click.option(
35
+ '--output-extension', '-oe',
36
+ help='Output file extension. This is only used if as_text is set to True. '
37
+ 'Otherwise the output extension will be npy.', default='ill', type=click.STRING
38
+ )
39
+ @click.option(
40
+ '--as-text', '-at',
41
+ help='Set to True if the output files should be saved as text instead of '
42
+ 'NumPy files.', default=False, type=click.BOOL
43
+ )
44
+ @click.option(
45
+ '--fmt',
46
+ help='Format for the output files when saved as text.', default='%.2f',
47
+ type=click.STRING
48
+ )
49
+ @click.option(
50
+ '--delimiter',
51
+ help='Delimiter for the output files when saved as text.',
52
+ type=click.Choice(['space', 'tab']), default='tab'
53
+ )
54
+ def merge_grid_folder(input_folder, output_folder, extension, dist_info,
55
+ output_extension, as_text, fmt, delimiter):
35
56
  """Restructure files in a distributed folder.
36
57
 
37
58
  \b
@@ -46,7 +67,9 @@ def merge_grid_folder(input_folder, output_folder, extension, dist_info):
46
67
  # handle optional case for Functions input
47
68
  if dist_info and not Path(dist_info).is_file():
48
69
  dist_info = None
49
- restore_original_distribution(input_folder, output_folder, extension, dist_info)
70
+ restore_original_distribution(
71
+ input_folder, output_folder, extension, dist_info, output_extension,
72
+ as_text, fmt, delimiter)
50
73
  except Exception:
51
74
  _logger.exception('Failed to restructure data from folder.')
52
75
  sys.exit(1)
@@ -122,7 +145,8 @@ def merge_metrics_folder(input_folder, output_folder, dist_info, grids_info):
122
145
 
123
146
 
124
147
  def restore_original_distribution(
125
- input_folder, output_folder, extension='npy', dist_info=None):
148
+ input_folder, output_folder, extension='npy', dist_info=None,
149
+ output_extension='ill', as_text=False, fmt='%.2f', delimiter='tab'):
126
150
  """Restructure files to the original distribution based on the distribution info.
127
151
 
128
152
  It will assume that the files in the input folder are NumPy files. However,
@@ -137,6 +161,12 @@ def restore_original_distribution(
137
161
  studies.
138
162
  dist_info: Path to dist_info.json file. If None, the function will try to load
139
163
  ``_redist_info.json`` file from inside the input_folder. (Default: None).
164
+ output_extension: Output file extension. This is only used if as_text
165
+ is set to True. Otherwise the output extension will be ```npy``.
166
+ as_text: Set to True if the output files should be saved as text instead
167
+ of NumPy files.
168
+ fmt: Format for the output files when saved as text.
169
+ delimiter: Delimiter for the output files when saved as text.
140
170
  """
141
171
  if not dist_info:
142
172
  _redist_info_file = Path(input_folder, '_redist_info.json')
@@ -178,7 +208,17 @@ def restore_original_distribution(
178
208
 
179
209
  out_array = np.concatenate(out_arrays)
180
210
  # save numpy array, .npy extension is added automatically
181
- np.save(output_file, out_array)
211
+ if not as_text:
212
+ np.save(output_file, out_array)
213
+ else:
214
+ if output_extension.startswith('.'):
215
+ output_extension = output_extension[1:]
216
+ if delimiter == 'tab':
217
+ delimiter = '\t'
218
+ elif delimiter == 'space':
219
+ delimiter = ' '
220
+ np.savetxt(output_file.with_suffix(f'.{output_extension}'),
221
+ out_array, fmt=fmt, delimiter=delimiter)
182
222
 
183
223
 
184
224
  def restore_original_distribution_metrics(
@@ -1065,9 +1065,9 @@ def direct_sun_hours(
1065
1065
  direct_sun_hours_file.parent.mkdir(parents=True, exist_ok=True)
1066
1066
  np.save(direct_sun_hours_file, direct_sun_hours_array)
1067
1067
 
1068
- cumulative_file = Path(output_folder, 'cumulative')
1068
+ cumulative_file = Path(output_folder, 'cumulative.res')
1069
1069
  cumulative_file.parent.mkdir(parents=True, exist_ok=True)
1070
- np.save(cumulative_file, cumulative_array)
1070
+ np.savetxt(cumulative_file, cumulative_array, fmt='%.2f')
1071
1071
  except Exception:
1072
1072
  _logger.exception('Failed to convert the input file to direct sun hours.')
1073
1073
  sys.exit(1)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: honeybee-radiance-postprocess
3
- Version: 0.4.337
3
+ Version: 0.4.338
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