Skip to content

Fixing tree slicing bug and adding attribute argument to constant process - #13

Merged
wsdewitt merged 4 commits into
mainfrom
slice-attr-bugs
Oct 21, 2025
Merged

Fixing tree slicing bug and adding attribute argument to constant process#13
wsdewitt merged 4 commits into
mainfrom
slice-attr-bugs

Conversation

@magdalenarussell

Copy link
Copy Markdown
Contributor

This PR resolves #11 by removing the assertion error from the tree-slicing method. It also adds an optional attribute argument to the ConstantProcess subclass, making it compatible with mutator classes that operate based on non-default node attributes.

@magdalenarussell
magdalenarussell marked this pull request as draft October 20, 2025 23:07
@magdalenarussell
magdalenarussell marked this pull request as ready for review October 21, 2025 19:01
@magdalenarussell

Copy link
Copy Markdown
Contributor Author

To pass the type checker, it seemed necessary to have node.up is not None instead of not node.is_root()...

CC @wsdewitt

@wsdewitt wsdewitt left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! I made a minor suggestion to make the time interval check slightly simpler.

Comment thread bdms/tree.py Outdated
@wsdewitt
wsdewitt merged commit 2f14913 into main Oct 21, 2025
2 checks passed
@wsdewitt
wsdewitt deleted the slice-attr-bugs branch October 21, 2025 22:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tree.slice(t) raises AssertionError at root

2 participants