Skip to content

Copy child/parent semantics for split_edges and decapitate #2347

@jeromekelleher

Description

@jeromekelleher

In #2334 we simplified the semantics of the population argument in split_edges and decapitate to default to -1 rather than inherit from the child node. It will probably be useful at some point (and would be straightforward to implement) to specify that inserted nodes should inherit these values from the parent or child of the edge as discussed here #2331 (comment)

The proposal is to have an API that looks something like this:

def decapitate, time, *, flags=None, population=None, metadata=None, copy_parent=False, copy_child=False):
    """
    If flags, population or metadata are not specified and copy_parent is True, copy the value from the edge's 
    parent node (likewise for copy_child). If values are explicitly provided for any of the node fields, the field 
    in question will **not** be copied from the child/parent.
    """

Metadata

Metadata

Assignees

No one assigned

    Labels

    Python APIIssue is about the Python APIenhancementNew feature or requestfutureIssues that are closed as they are not planned in the medium-term, but which are still desirable.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions