dbbs-lab / bsb-core

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

Cannot `redo` scaffold #752

Closed francesshei closed 1 year ago

francesshei commented 1 year ago

The CLI command bsb compile --redo --only [my_connection_strategy] leads to an AttributeError:

Traceback (most recent call last):
  File "/Users/francescosheiban/.pyenv/versions/neuralenv/bin/bsb", line 8, in <module>
    sys.exit(handle_cli())
  File "/Users/francescosheiban/neuralenv/bsb/bsb/cli/__init__.py", line 10, in handle_cli
    handle_command(sys.argv[1:], exit=True)
  File "/Users/francescosheiban/neuralenv/bsb/bsb/cli/__init__.py", line 30, in handle_command
    namespace.handler(namespace, dryrun=dryrun)
  File "/Users/francescosheiban/neuralenv/bsb/bsb/cli/commands/__init__.py", line 97, in execute_handler
    self.handler(context)
  File "/Users/francescosheiban/neuralenv/bsb/bsb/cli/commands/_commands.py", line 137, in handler
    network.compile(
  File "/Users/francescosheiban/neuralenv/bsb/bsb/profiling.py", line 157, in decorated
    return f(*args, **kwargs)
  File "/Users/francescosheiban/neuralenv/bsb/bsb/core.py", line 368, in compile
    p_strats, c_strats = self._redo_chain(p_strats, c_strats, skip, force)
  File "/Users/francescosheiban/neuralenv/bsb/bsb/core.py", line 740, in _redo_chain
    ct.clear_connections()
  File "/Users/francescosheiban/neuralenv/bsb/bsb/cell_types.py", line 126, in clear_connections
    if self is conn_set.presynaptic or self is conn_set.postsynaptic:
AttributeError: 'ConnectivitySet' object has no attribute 'presynaptic'
Helveg commented 1 year ago

Aha, oversight with refactoring untested code ;) Praise be that the next half year we'll focus on QA :D

Update: I reproduced the issue in a test and will work on a fix today