Skip to content

Conversation

@mathleur
Copy link
Member

@mathleur mathleur commented Sep 29, 2025

Description

Contributor Declaration

By opening this pull request, I affirm the following:

  • All authors agree to the Contributor License Agreement.
  • The code follows the project's coding standards.
  • I have performed self-review and added comments where needed.
  • I have added or updated tests to verify that my changes are effective and functional.
  • I have run all existing tests and confirmed they pass.

🌈🌦️📖🚧 Documentation 🚧📖🌦️🌈
https://sites.ecmwf.int/docs/dev-section/qubed/pull-requests/PR-28

Copy link
Collaborator

@peshence peshence left a comment

Choose a reason for hiding this comment

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

Cool, would it make sense to just generalise this to all operations?

return hash_node(self)

def remove_branch(self, b: Qube) -> Qube:
b_key = b.children[0].key
Copy link
Collaborator

Choose a reason for hiding this comment

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

should we enforce that b only has 1 child?


return hash_node(self)

def remove_branch(self, b: Qube) -> Qube:
Copy link
Collaborator

Choose a reason for hiding this comment

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

a docstring would be helpful here I think, e.g.

Suggested change
def remove_branch(self, b: Qube) -> Qube:
def remove_branch(self, b: Qube) -> Qube:
"""
Navigates down self until it finds a key that matches the top key of b, then subtracts b from the subtree.
b can only have 1 child
"""

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.

3 participants