-
Notifications
You must be signed in to change notification settings - Fork 2
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
ENH: include save_tree_to_path from #54 #58
Conversation
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.
The only thing here to nitpick is the lack of parameter types and explanations in the docstring (As per numpy docstring conventions). I imagine the function parameters are pretty self explanatory here, but you never know. (maybe also for future auto-generated docs)
The docstrings etc here need a lot more work before we get there anyway.
|
||
These files are ready to be consumed by get_tree_from_path. | ||
""" | ||
ser = serialize(BehaviorTreeItem(root=root)) |
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 usually invoke serialize
the same way I do deserialize
, to be explicit. I think apischema does this conversion for you if you don't provide it, but I have trust issues:
ser = serialize(BehaviourTreeItem, tree_item)
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'm not sure I quickly understand what tree_item
is in this case.
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.
Very valuable. We can cut issue to capture notion of extending this to perform a "snapshot" ability - serialize the tree at a given state, with Status's of given nodes captured as well. This will deliver that ability
Description
Include
save_tree_item_to_path
, a companion toget_tree_from_path
that takes a fully constructed behavior tree item and saves it to a json file. It is intended that any tree serialized this way will be usable byget_tree_from_path
.Motivation and Context
I had to google
apischema
's API to serialize my behavior tree and I thought I shouldn't have to do that.How Has This Been Tested?
Interactively and added a unit test.
Where Has This Been Documented?
I added a pre-release documentation entry.
Pre-merge checklist
docs/pre-release-notes.sh
and created a pre-release documentation page