honeybee-radiance-postprocess 0.4.581__py3-none-any.whl → 0.4.584__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.
@@ -14,8 +14,7 @@ except ImportError:
14
14
 
15
15
  from ladybug.location import Location
16
16
  from ladybug.wea import Wea
17
- from honeybee_radiance_postprocess.results.annual_daylight import AnnualDaylight
18
- from honeybee_radiance_postprocess.results.annual_irradiance import AnnualIrradiance
17
+ from honeybee_radiance_postprocess.results import AnnualDaylight, AnnualIrradiance
19
18
  from honeybee_radiance_postprocess.metrics import da_array2d, cda_array2d, \
20
19
  udi_array2d, udi_lower_array2d, udi_upper_array2d
21
20
  from honeybee_radiance_postprocess.reader import binary_to_array
@@ -505,7 +504,7 @@ def annual_to_data(
505
504
  sys.exit(0)
506
505
 
507
506
 
508
- @post_process.command('annual-summary')
507
+ @post_process.command('annual-statistics')
509
508
  @click.argument(
510
509
  'folder',
511
510
  type=click.Path(exists=True, file_okay=False, dir_okay=True, resolve_path=True)
@@ -536,12 +535,12 @@ def annual_to_data(
536
535
 
537
536
  @click.option(
538
537
  '--sub-folder', '-sf', help='Optional relative path for subfolder to write output '
539
- 'metric files.', default='metrics'
538
+ 'statistics files.', default='statistics'
540
539
  )
541
- def annual_summary(
540
+ def annual_statistics(
542
541
  folder, hoys_file, states, grids_filter, total, sensor, sub_folder
543
542
  ):
544
- """Get annual summary statistics (average, median, minimum, maximum, cumulative).
543
+ """Get annual statistics (average, median, minimum, maximum, cumulative).
545
544
 
546
545
  \b
547
546
  Args:
@@ -564,12 +563,25 @@ def annual_summary(
564
563
 
565
564
  axis = 1 if sensor is True else 0
566
565
 
567
- results = AnnualDaylight(folder)
568
- results.annual_summary_to_folder(
566
+ study_info_file = Path(folder).joinpath('study_info.json')
567
+ if study_info_file.exists():
568
+ with open(study_info_file) as file:
569
+ study_info = json.load(file)
570
+ study_type = study_info.get('study_type', 'annual-daylight')
571
+ else:
572
+ study_type = 'annual-daylight'
573
+
574
+ if study_type == 'annual-daylight':
575
+ results = AnnualDaylight(folder)
576
+ elif study_type == 'annual-irradiance':
577
+ results = AnnualIrradiance(folder)
578
+ else:
579
+ raise ValueError(f'Unknown study type: {study_type}.')
580
+ results.annual_statistics_to_folder(
569
581
  sub_folder, hoys=hoys, states=states, grids_filter=grids_filter,
570
582
  res_type=res_type, axis=axis)
571
583
  except Exception:
572
- _logger.exception('Failed to calculate annual summary.')
584
+ _logger.exception('Failed to calculate annual statistics.')
573
585
  sys.exit(1)
574
586
  else:
575
587
  sys.exit(0)
@@ -797,10 +797,10 @@ class Results(_ResultsFolder):
797
797
  info_file = metric_folder.joinpath('grids_info.json')
798
798
  info_file.write_text(json.dumps(grids_info))
799
799
 
800
- def annual_summary(
800
+ def annual_statistics(
801
801
  self, hoys: list = None, states: DynamicSchedule = None, grids_filter: str = '*',
802
802
  res_type: str = 'total', axis: int = 1):
803
- """Compute annual summary statistics (average, median, minimum, maximum,
803
+ """Compute annual statistics (average, median, minimum, maximum,
804
804
  cumulative) for each sensor or timestep.
805
805
 
806
806
  If hoys is left as None, the average will be computed for all study hours,
@@ -926,10 +926,10 @@ class Results(_ResultsFolder):
926
926
  return (average_values, median_values, minimum_values, maximum_values,
927
927
  cumulative_values, grids_info)
928
928
 
929
- def annual_summary_to_folder(
929
+ def annual_statistics_to_folder(
930
930
  self, target_folder: str, hoys: list = None, states: DynamicSchedule = None,
931
931
  grids_filter: str = '*', res_type: str = 'total', axis: int = 1):
932
- """Compute annual summary statistics (average, median, minimum, maximum,
932
+ """Compute summary statistics (average, median, minimum, maximum,
933
933
  cumulative) for each sensor or timestep and write the values to a folder.
934
934
 
935
935
  If hoys is left as None, the average will be computed for all study hours,
@@ -962,7 +962,7 @@ class Results(_ResultsFolder):
962
962
  maximum_values,
963
963
  cumulative_values,
964
964
  grids_info
965
- ) = self.annual_summary(
965
+ ) = self.annual_statistics(
966
966
  hoys=hoys, states=states, grids_filter=grids_filter,
967
967
  res_type=res_type, axis=axis
968
968
  )
@@ -86,14 +86,10 @@ def filter_array2d(array: np.ndarray, mask: np.ndarray) -> np.ndarray:
86
86
  Returns:
87
87
  A filtered NumPy array.
88
88
  """
89
- if is_cpu:
90
- array_filter = np.apply_along_axis(
91
- filter_array, 1, array, mask=mask)
92
- else:
89
+ if mask is not None:
93
90
  mask = np.asarray(mask).astype(bool)
94
- array_filter = array[:, mask]
95
-
96
- return array_filter
91
+ array = array[:, mask]
92
+ return array
97
93
 
98
94
 
99
95
  def filter_array(array: np.ndarray, mask: np.ndarray) -> np.ndarray:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: honeybee-radiance-postprocess
3
- Version: 0.4.581
3
+ Version: 0.4.584
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
@@ -16,7 +16,7 @@ Classifier: Programming Language :: Python :: Implementation :: CPython
16
16
  Classifier: Operating System :: OS Independent
17
17
  Description-Content-Type: text/markdown
18
18
  License-File: LICENSE
19
- Requires-Dist: honeybee-radiance==1.66.214
19
+ Requires-Dist: honeybee-radiance==1.66.215
20
20
  Requires-Dist: numpy<2.0.0
21
21
  Dynamic: author
22
22
  Dynamic: author-email
@@ -11,7 +11,7 @@ honeybee_radiance_postprocess/helper.py,sha256=NzGWfEmYlSzg4CpTuB9PMRSpKCIbN7gsD
11
11
  honeybee_radiance_postprocess/metrics.py,sha256=XvRDcAu9-5UHzJvafvegbtwab8-oPchu_lw03UgjylE,15303
12
12
  honeybee_radiance_postprocess/reader.py,sha256=fEuqU-87vloLofwMxdCLKV4ZXoW1eMOXydsTgUwMCFk,2762
13
13
  honeybee_radiance_postprocess/type_hints.py,sha256=39kLNk9FxcQVGdL6bkP49jIFsf_1brP6r6w3khl9hqc,1212
14
- honeybee_radiance_postprocess/util.py,sha256=h7fipG9it_cfIk-kFP3X_IassVmfmphPiLxpydW43R4,6295
14
+ honeybee_radiance_postprocess/util.py,sha256=DSWO6WsOG2z7CGk-sJpXybRx87u4Y7uiitrCIelPWFI,6189
15
15
  honeybee_radiance_postprocess/vis_metadata.py,sha256=7ywIgdiuNKcctxifhpy7-Q2oaSX2ngQBeA0Kh7q1Gg0,1780
16
16
  honeybee_radiance_postprocess/breeam/__init__.py,sha256=kQXElEqFnLGNnrMSpA51XDHoqBup849FHeAqWASIy6w,45
17
17
  honeybee_radiance_postprocess/breeam/breeam.py,sha256=cSco6g0Qyv1XgfyY18Z9rabQfWPLGRBcYQumdMv5Y4k,20672
@@ -23,7 +23,7 @@ honeybee_radiance_postprocess/cli/grid.py,sha256=IMjfyw-XPaoSu550T_BuulRSawla8kY
23
23
  honeybee_radiance_postprocess/cli/leed.py,sha256=vup_tVcSnSO5R7U_WPVDAhtSSRrPzTUgV4j9lyxvxEk,5546
24
24
  honeybee_radiance_postprocess/cli/merge.py,sha256=NgQ5RM1-GrJQs_25IPzBvQ5PAn6oTKiB_N9SeHBxgCA,5840
25
25
  honeybee_radiance_postprocess/cli/mtxop.py,sha256=pbQsc4EnzsRStBX1-KcgIKmuTlVYiG1IyNjiqbwS2V0,5103
26
- honeybee_radiance_postprocess/cli/postprocess.py,sha256=nR0Mk7f_WCmYjpqkcxKs9tN7EWj6moFsYKnj6vUlGS0,41890
26
+ honeybee_radiance_postprocess/cli/postprocess.py,sha256=OqOmmagOOxWQ7Vf9VBYoweCupdGbfyjiY6ig9duKPTU,42370
27
27
  honeybee_radiance_postprocess/cli/schedule.py,sha256=6uIy98Co4zm-ZRcELo4Lfx_aN3lNiqPe-BSimXwt1F8,3877
28
28
  honeybee_radiance_postprocess/cli/translate.py,sha256=W3G5aBN7pGx5sX3VoV1xZM6HL06Fw95iJb7vV-r6u7w,7396
29
29
  honeybee_radiance_postprocess/cli/two_phase.py,sha256=njkWBRxOqdRSp0JxLloWTGWmKruyONetgnIbjXhrrXw,8393
@@ -39,12 +39,12 @@ honeybee_radiance_postprocess/leed/leed_schedule.py,sha256=8NUISE6RbENK1IgMA5cC2
39
39
  honeybee_radiance_postprocess/results/__init__.py,sha256=1agBQbfT4Tf8KqSZzlfKYX8MeZryY4jJ1KB4HWqaDDk,182
40
40
  honeybee_radiance_postprocess/results/annual_daylight.py,sha256=ulv8kZvS6UkhCjaXSJKXQeVhUReRdx4M0tGvy7rA8CI,34586
41
41
  honeybee_radiance_postprocess/results/annual_irradiance.py,sha256=nA1VubesNDtRxgXpHSZxFMV67XxUntIHIu5H9qtDBSk,8483
42
- honeybee_radiance_postprocess/results/results.py,sha256=9A_4i6Vl5R4ZBeCFsJZz9D_y_t2_XW3cWeMdShVIXVo,66852
42
+ honeybee_radiance_postprocess/results/results.py,sha256=CZZeyBTLVQt69qGdiePQsBIi1ppwIpqkp9lUpXv9orM,66846
43
43
  honeybee_radiance_postprocess/well/__init__.py,sha256=kQXElEqFnLGNnrMSpA51XDHoqBup849FHeAqWASIy6w,45
44
44
  honeybee_radiance_postprocess/well/well.py,sha256=FzxaLo3IdlvFZZ1UtblBk9zsKl_EfsCKIcAgfucq-nE,24762
45
- honeybee_radiance_postprocess-0.4.581.dist-info/licenses/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
46
- honeybee_radiance_postprocess-0.4.581.dist-info/METADATA,sha256=VuGW8rd_g2nVrQ2nNaA9ZWsQmx_zfVdHaOhD5zbU2Jc,2575
47
- honeybee_radiance_postprocess-0.4.581.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
48
- honeybee_radiance_postprocess-0.4.581.dist-info/entry_points.txt,sha256=gFtVPx6UItXt27GfEZZO00eOZChJJEL6JwGSAB_O3rs,96
49
- honeybee_radiance_postprocess-0.4.581.dist-info/top_level.txt,sha256=4-sFbzy7ewP2EDqJV3jeFlAFx7SuxtoBBELWaKAnLdA,30
50
- honeybee_radiance_postprocess-0.4.581.dist-info/RECORD,,
45
+ honeybee_radiance_postprocess-0.4.584.dist-info/licenses/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
46
+ honeybee_radiance_postprocess-0.4.584.dist-info/METADATA,sha256=rrfb55zO-UeTxzyUZfXNCnoQWszSZKljWlIRd3aWqA0,2575
47
+ honeybee_radiance_postprocess-0.4.584.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
48
+ honeybee_radiance_postprocess-0.4.584.dist-info/entry_points.txt,sha256=gFtVPx6UItXt27GfEZZO00eOZChJJEL6JwGSAB_O3rs,96
49
+ honeybee_radiance_postprocess-0.4.584.dist-info/top_level.txt,sha256=4-sFbzy7ewP2EDqJV3jeFlAFx7SuxtoBBELWaKAnLdA,30
50
+ honeybee_radiance_postprocess-0.4.584.dist-info/RECORD,,