-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Stack regions and Layer partitions #868
Conversation
…if Layers or position in children array
…child in the ordered stack
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I gave notes to change the UX of the Stack
with more feature parity to what stacks were in BSB3, and what I think is a more rich and intuitive user experience.
- Remove stack_index from Layer and related configurations
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just noticed that anchor
refs any partition/region
bsb/topology/region.py
Outdated
""" | ||
|
||
axis: typing.Union[typing.Literal["x"], typing.Literal["y"], typing.Literal["z"]] = ( | ||
config.attr(type=types.in_(["x", "y", "z"]), default="z") | ||
) | ||
stack_order: list[typing.Union["Region", "Partition"]] = config.reflist( | ||
refs.regional_ref, backref="region" | ||
) | ||
anchor: typing.Union["Region", "Partition"] = config.ref( | ||
refs.regional_ref, backref="region" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Atm the ref can be any partition/region, even non-children. This can either be:
- allowed and your intention: this would allow "out of stack anchors", but then we need to drop the
backref="region"
(backref would set the target'sregion
to this region, effectively transferring/stealing it from its parent) - not your intention: swap to a new ref function to strictly one of the
children
(not sure if a ref to a ref works, probably untested)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Never thought of making a ref to a ref 😮 but I managed to make it work with just a ref. The function _resolve_anchor_offset
should check if the ref belongs to the children. I can also add a test for that.
@Helveg what is the purpose of |
It was a feature to scale the dimensions of one layer according to the volume of another layer, so that you could have e.g. 20^mm3 of IO per 200^mm3 of cerebellar cortex, see #191 We can remove it until it is reimplemented :) |
I am not sure how you wanted to implement it. At the moment, |
I would not advise you to implement If there were only 2 floats, perhaps the third value was always ommited andassumed to be the axial dimension, and was always 1 as a reference point? I don't know, but that's what I remember of the feature. I think this feature was used by @AliceGem to scale the IO layer. I'm not sure who works on cereb-IO models now, and whether they require this feature? If anyone working on that model wants to move to BSB4, and requires this feature, we can reimplement it from the git history. |
Small pass on core.py documentation
Needs dbbs-lab/bsb-arbor#3 to be merged. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #868 +/- ##
==========================================
+ Coverage 87.89% 88.85% +0.95%
==========================================
Files 103 110 +7
Lines 13771 15088 +1317
==========================================
+ Hits 12104 13406 +1302
- Misses 1667 1682 +15 ☔ View full report in Codecov by Sentry. |
Co-authored-by: Robin De Schepper <[email protected]>
Describe the work done
Stack
will now use its children'sstack_index
attribute to order them in the stack before repositioning them.In practice, a
Layer
of aStack
can "decide" of its position within it.List which issues this resolves:
Closes #867
Tasks
📚 Documentation preview 📚: https://bsb--868.org.readthedocs.build/en/868/