dbbs-lab / bsb-core

The Brain Scaffold Builder
https://bsb.readthedocs.io
GNU General Public License v3.0
21 stars 16 forks source link

`FixedPositions` with 0 positions errors #802

Closed filimarc closed 6 months ago

filimarc commented 7 months ago
FixedPositions(..., positions=[])
Traceback (most recent call last):
  File "/opt/pycharm-2023.3.3/plugins/python/helpers/pydev/_pydevd_bundle/pydevd_vars.py", line 315, in resolve_compound_variable_fields
    return _typeName, _resolve_default_variable_fields(var, resolver, offset)
  File "/opt/pycharm-2023.3.3/plugins/python/helpers/pydev/_pydevd_bundle/pydevd_vars.py", line 265, in _resolve_default_variable_fields
    return resolver.get_dictionary(VariableWithOffset(var, offset) if offset else var)
  File "/opt/pycharm-2023.3.3/plugins/python/helpers/pydev/pydevd_plugins/extensions/types/pydevd_plugin_numpy_types.py", line 95, in get_dictionary
    ret['min'] = obj.min()
  File "/home/filippo/git/bsb-core/venv/lib/python3.10/site-packages/numpy/core/_methods.py", line 45, in _amin
    return umr_minimum(a, axis, None, out, keepdims, initial, where)
ValueError: zero-size array to reduction operation minimum which has no identity

Error
Traceback (most recent call last):
  File "/home/filippo/git/bsb-core/tests/test_jobs.py", line 383, in test_ps_node_submission
    ps.queue(pool, [100, 100, 100])
  File "/home/filippo/git/bsb-core/bsb/placement/strategy.py", line 194, in queue
    for chunk in VoxelSet.fill(self.positions, chunk_size):
  File "/home/filippo/git/bsb-core/bsb/voxels.py", line 499, in fill
    return cls(positions, 0, irregular=True).snap_to_grid(voxel_size, unique=unique)
  File "/home/filippo/git/bsb-core/bsb/voxels.py", line 113, in __init__
    if not len(voxel_size):
TypeError: len() of unsized object