Skip to content
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

Add helper functions for users #57

Open
VEZY opened this issue Feb 26, 2024 · 1 comment
Open

Add helper functions for users #57

VEZY opened this issue Feb 26, 2024 · 1 comment

Comments

@VEZY
Copy link
Owner

VEZY commented Feb 26, 2024

Some traversals are quite complicated to reason about. For example, users often want to traverse the nodes along an axis without visiting the branching positions. This is especially difficult when we have several scales along the axis. For example, we can visit them as follows:

descendants(axis_node, link = ["/", "<"], all = false)

What's important here is to understand what the all argument does, and not many people go read the documentation. They would rather use a function that does that instead, or at least a filter function that already exists:

descendants(axis_node, filter_fun = node -> along_axis(node, axis = "A", target = "N"))

The axis argument is used to identify the name of the nodes that are an axis, and the target argument for getting the name of the nodes we want (could be "GU" for growth units or "N" for nodes).

@VEZY
Copy link
Owner Author

VEZY commented Feb 26, 2024

Another example is when we want to visit the nodes along an axis (sequentially, without visiting the GU) but in a basitonic way (from tip to base). At the moment, we have to write dedicated functions, but that's a little bit difficult for entry-level users.

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

No branches or pull requests

1 participant