dbbs-lab / bsb-core

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

Node name not working in `RequirementError` during `Configuration.default` #826

Open Helveg opened 8 months ago

Helveg commented 8 months ago
>>> Configuration.default(connectivity=dict(x=dict(strategy="bsb.connectivity.VoxelIntersection", presynaptic=dict(cell_types="A"))))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/mnt/d/GIT/bsb/bsb/config/_config.py", line 157, in default
    conf = cls(default_args)
  File "/mnt/d/GIT/bsb/bsb/config/_make.py", line 72, in __call__
    instance = meta_subject.__new__(
  File "/mnt/d/GIT/bsb/bsb/config/_make.py", line 225, in __new__
    instance.__post_new__(**kwargs)
  File "/mnt/d/GIT/bsb/bsb/config/_make.py", line 333, in __post_new__
    _bubble_up_exc(e, self._meta)
  File "/mnt/d/GIT/bsb/bsb/config/_make.py", line 352, in _bubble_up_exc
    errr.wrap(type(exc), exc, append=node + attr)
  File "/home/robin/.pyenv/versions/bsb/lib/python3.9/site-packages/errr/__init__.py", line 7, in wrap
    return err_type.wrap(*args, **kwargs)
  File "/home/robin/.pyenv/versions/bsb/lib/python3.9/site-packages/errr/exception.py", line 132, in wrap
    raise err from None
  File "/mnt/d/GIT/bsb/bsb/config/_make.py", line 331, in __post_new__
    post_new(self, *args, _parent=None, _key=None, **kwargs)
  File "/mnt/d/GIT/bsb/bsb/config/_make.py", line 297, in __post_new__
    setattr(self, name, value)
  File "/mnt/d/GIT/bsb/bsb/config/_attrs.py", line 827, in __set__
    self.fill(value, _parent=instance, _key=_key or self.attr_name),
  File "/mnt/d/GIT/bsb/bsb/config/_attrs.py", line 836, in fill
    _cfgdict.update(value or builtins.dict())
  File "/mnt/d/GIT/bsb/bsb/config/_attrs.py", line 777, in update
    self[ckey] = value
  File "/mnt/d/GIT/bsb/bsb/config/_attrs.py", line 721, in __setitem__
    value = self._elem_type(value, _parent=self, _key=key)
  File "/mnt/d/GIT/bsb/bsb/config/_make.py", line 72, in __call__
    instance = meta_subject.__new__(
  File "/mnt/d/GIT/bsb/bsb/config/_make.py", line 225, in __new__
    instance.__post_new__(**kwargs)
  File "/mnt/d/GIT/bsb/bsb/config/_make.py", line 279, in __post_new__
    raise RequirementError(f"Missing required attribute '{name}'")
bsb.exceptions.RequirementError: Missing required attribute 'postsynaptic' in {standalone}.x

The node name should be {root}.connectivity.x