Skip to content

Commit

Permalink
do not reduce values dimension of size 1 to 0 -> this leads to unpred…
Browse files Browse the repository at this point in the history
…ictable behaviour when number of agents change
  • Loading branch information
jensdebruijn committed Oct 15, 2024
1 parent 0efddb9 commit d5a04e0
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions honeybees/reporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,18 +219,6 @@ def report_value(
value: The array itself.
conf: Configuration for saving the file. Contains options such a file format, and whether to export the data or save the data in the model.
"""
# check if value is of numpy type and check if size is 1. If so, convert to native python type.
if isinstance(
value,
(
(np.ndarray, np.generic, cp.ndarray, cp.generic)
if "cupy" in sys.modules
else (np.ndarray, np.generic)
),
):
if value.size == 1:
value = value.item()
self.check_value(value)
if isinstance(value, list):
value = [v.item() for v in value]
for v in value:
Expand Down

0 comments on commit d5a04e0

Please sign in to comment.