honeybee-radiance-postprocess 0.4.227__tar.gz → 0.4.228__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 (39) hide show
  1. {honeybee-radiance-postprocess-0.4.227 → honeybee-radiance-postprocess-0.4.228}/PKG-INFO +1 -1
  2. {honeybee-radiance-postprocess-0.4.227 → honeybee-radiance-postprocess-0.4.228}/honeybee_radiance_postprocess/cli/translate.py +70 -1
  3. {honeybee-radiance-postprocess-0.4.227 → honeybee-radiance-postprocess-0.4.228}/honeybee_radiance_postprocess.egg-info/PKG-INFO +1 -1
  4. {honeybee-radiance-postprocess-0.4.227 → honeybee-radiance-postprocess-0.4.228}/CODE_OF_CONDUCT.md +0 -0
  5. {honeybee-radiance-postprocess-0.4.227 → honeybee-radiance-postprocess-0.4.228}/CONTRIBUTING.md +0 -0
  6. {honeybee-radiance-postprocess-0.4.227 → honeybee-radiance-postprocess-0.4.228}/LICENSE +0 -0
  7. {honeybee-radiance-postprocess-0.4.227 → honeybee-radiance-postprocess-0.4.228}/MANIFEST.in +0 -0
  8. {honeybee-radiance-postprocess-0.4.227 → honeybee-radiance-postprocess-0.4.228}/README.md +0 -0
  9. {honeybee-radiance-postprocess-0.4.227 → honeybee-radiance-postprocess-0.4.228}/dev-requirements.txt +0 -0
  10. {honeybee-radiance-postprocess-0.4.227 → honeybee-radiance-postprocess-0.4.228}/honeybee_radiance_postprocess/__init__.py +0 -0
  11. {honeybee-radiance-postprocess-0.4.227 → honeybee-radiance-postprocess-0.4.228}/honeybee_radiance_postprocess/__main__.py +0 -0
  12. {honeybee-radiance-postprocess-0.4.227 → honeybee-radiance-postprocess-0.4.228}/honeybee_radiance_postprocess/annual.py +0 -0
  13. {honeybee-radiance-postprocess-0.4.227 → honeybee-radiance-postprocess-0.4.228}/honeybee_radiance_postprocess/annualdaylight.py +0 -0
  14. {honeybee-radiance-postprocess-0.4.227 → honeybee-radiance-postprocess-0.4.228}/honeybee_radiance_postprocess/cli/__init__.py +0 -0
  15. {honeybee-radiance-postprocess-0.4.227 → honeybee-radiance-postprocess-0.4.228}/honeybee_radiance_postprocess/cli/grid.py +0 -0
  16. {honeybee-radiance-postprocess-0.4.227 → honeybee-radiance-postprocess-0.4.228}/honeybee_radiance_postprocess/cli/leed.py +0 -0
  17. {honeybee-radiance-postprocess-0.4.227 → honeybee-radiance-postprocess-0.4.228}/honeybee_radiance_postprocess/cli/mtxop.py +0 -0
  18. {honeybee-radiance-postprocess-0.4.227 → honeybee-radiance-postprocess-0.4.228}/honeybee_radiance_postprocess/cli/postprocess.py +0 -0
  19. {honeybee-radiance-postprocess-0.4.227 → honeybee-radiance-postprocess-0.4.228}/honeybee_radiance_postprocess/cli/schedule.py +0 -0
  20. {honeybee-radiance-postprocess-0.4.227 → honeybee-radiance-postprocess-0.4.228}/honeybee_radiance_postprocess/cli/two_phase.py +0 -0
  21. {honeybee-radiance-postprocess-0.4.227 → honeybee-radiance-postprocess-0.4.228}/honeybee_radiance_postprocess/cli/util.py +0 -0
  22. {honeybee-radiance-postprocess-0.4.227 → honeybee-radiance-postprocess-0.4.228}/honeybee_radiance_postprocess/dynamic.py +0 -0
  23. {honeybee-radiance-postprocess-0.4.227 → honeybee-radiance-postprocess-0.4.228}/honeybee_radiance_postprocess/electriclight.py +0 -0
  24. {honeybee-radiance-postprocess-0.4.227 → honeybee-radiance-postprocess-0.4.228}/honeybee_radiance_postprocess/en17037.py +0 -0
  25. {honeybee-radiance-postprocess-0.4.227 → honeybee-radiance-postprocess-0.4.228}/honeybee_radiance_postprocess/helper.py +0 -0
  26. {honeybee-radiance-postprocess-0.4.227 → honeybee-radiance-postprocess-0.4.228}/honeybee_radiance_postprocess/leed.py +0 -0
  27. {honeybee-radiance-postprocess-0.4.227 → honeybee-radiance-postprocess-0.4.228}/honeybee_radiance_postprocess/metrics.py +0 -0
  28. {honeybee-radiance-postprocess-0.4.227 → honeybee-radiance-postprocess-0.4.228}/honeybee_radiance_postprocess/reader.py +0 -0
  29. {honeybee-radiance-postprocess-0.4.227 → honeybee-radiance-postprocess-0.4.228}/honeybee_radiance_postprocess/results.py +0 -0
  30. {honeybee-radiance-postprocess-0.4.227 → honeybee-radiance-postprocess-0.4.228}/honeybee_radiance_postprocess/type_hints.py +0 -0
  31. {honeybee-radiance-postprocess-0.4.227 → honeybee-radiance-postprocess-0.4.228}/honeybee_radiance_postprocess/util.py +0 -0
  32. {honeybee-radiance-postprocess-0.4.227 → honeybee-radiance-postprocess-0.4.228}/honeybee_radiance_postprocess.egg-info/SOURCES.txt +0 -0
  33. {honeybee-radiance-postprocess-0.4.227 → honeybee-radiance-postprocess-0.4.228}/honeybee_radiance_postprocess.egg-info/dependency_links.txt +0 -0
  34. {honeybee-radiance-postprocess-0.4.227 → honeybee-radiance-postprocess-0.4.228}/honeybee_radiance_postprocess.egg-info/entry_points.txt +0 -0
  35. {honeybee-radiance-postprocess-0.4.227 → honeybee-radiance-postprocess-0.4.228}/honeybee_radiance_postprocess.egg-info/requires.txt +0 -0
  36. {honeybee-radiance-postprocess-0.4.227 → honeybee-radiance-postprocess-0.4.228}/honeybee_radiance_postprocess.egg-info/top_level.txt +0 -0
  37. {honeybee-radiance-postprocess-0.4.227 → honeybee-radiance-postprocess-0.4.228}/requirements.txt +0 -0
  38. {honeybee-radiance-postprocess-0.4.227 → honeybee-radiance-postprocess-0.4.228}/setup.cfg +0 -0
  39. {honeybee-radiance-postprocess-0.4.227 → honeybee-radiance-postprocess-0.4.228}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: honeybee-radiance-postprocess
3
- Version: 0.4.227
3
+ Version: 0.4.228
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,9 +1,11 @@
1
1
  """Commands to translate objects."""
2
2
  import sys
3
3
  import logging
4
+ from pathlib import Path
5
+ import shutil
4
6
  import numpy as np
5
7
  import click
6
- from pathlib import Path
8
+ import json
7
9
 
8
10
  from ..reader import binary_to_array
9
11
 
@@ -129,3 +131,70 @@ def binary_to_npy(mtx_file, conversion, name, output_folder):
129
131
  sys.exit(1)
130
132
  else:
131
133
  sys.exit(0)
134
+
135
+
136
+ @translate.command('annual-daylight-npy-to-ill')
137
+ @click.argument(
138
+ 'folder',
139
+ type=click.Path(exists=True, file_okay=False, dir_okay=True, resolve_path=True)
140
+ )
141
+ @click.option(
142
+ '--output-folder', '-of', help='Output folder. If not provided the output '
143
+ 'folder will be created in the same directory as the results folder. The '
144
+ 'new folder will be called results_ill.', default=None,
145
+ type=click.Path(exists=False, file_okay=False, dir_okay=True, resolve_path=True)
146
+ )
147
+ def annual_daylight_npy_to_ill(folder, output_folder):
148
+ """Convert an annual daylight results folder to older version.
149
+
150
+ This command reads an annual daylight results folder with results saved as
151
+ npy files (NumPy), and converts the npy files to text files in the old
152
+ results folder format.
153
+
154
+ \b
155
+ Args:
156
+ folder: Results folder. This folder is an output folder of annual
157
+ daylight recipe. Folder should include grids_info.json and
158
+ sun-up-hours.txt.
159
+ """
160
+ try:
161
+ folder = Path(folder)
162
+ static_ill_folder = folder.joinpath('__static_apertures__/default/total')
163
+ if not static_ill_folder.exists():
164
+ raise FileNotFoundError(
165
+ 'No results were found for static apertures in the results '
166
+ 'folder.')
167
+ grids_info_file = folder.joinpath('grids_info.json')
168
+ if not grids_info_file.exists():
169
+ raise FileNotFoundError(
170
+ 'The file grids_info.json was not found in the results folder.')
171
+ sun_up_hours_file = folder.joinpath('sun-up-hours.txt')
172
+ if not sun_up_hours_file.exists():
173
+ raise FileNotFoundError(
174
+ 'The file sun-up-hours.txt was not found in the results folder.')
175
+
176
+ if output_folder is None:
177
+ output_folder = folder.parent.joinpath('results_ill')
178
+ else:
179
+ output_folder = Path(output_folder)
180
+ output_folder.mkdir(parents=True, exist_ok=True)
181
+
182
+ with open(grids_info_file) as json_file:
183
+ grids_info = json.load(json_file)
184
+
185
+ for grid_info in grids_info:
186
+ full_id = grid_info['full_id']
187
+ npy_file = static_ill_folder.joinpath(f'{full_id}.npy')
188
+
189
+ array = np.load(npy_file)
190
+ output = Path(output_folder, full_id + '.ill')
191
+ np.savetxt(output, array, fmt='%.7e', delimiter='\t')
192
+
193
+ # copy grids_info and sun-up-hours
194
+ shutil.copy(grids_info_file, output_folder.joinpath('grids_info.json'))
195
+ shutil.copy(sun_up_hours_file, output_folder.joinpath('sun-up-hours.txt'))
196
+ except Exception:
197
+ _logger.exception('Converting annual daylight results folder failed.')
198
+ sys.exit(1)
199
+ else:
200
+ sys.exit(0)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: honeybee-radiance-postprocess
3
- Version: 0.4.227
3
+ Version: 0.4.228
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