-
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
WIP: mfx tree scratchpad #54
Conversation
Some follow-up tasks for me here:
|
Attaching SVG render of the tree courtesy of
|
@@ -35,6 +36,15 @@ def get_tree_from_path(path: Path) -> py_trees.trees.BehaviourTree: | |||
return tree_item.get_tree() | |||
|
|||
|
|||
def save_tree_to_path(path: Union[Path, str], root: BaseItem): |
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.
keep
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.
keep, consider separating to own tool, consider extending to read control system and spoof pvs exactly
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.
Split off to #57
@@ -155,24 +169,96 @@ def cond_func(): | |||
return cond_func | |||
|
|||
|
|||
@dataclass | |||
class SequenceConditionItem(BaseItem): |
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.
keep, might need changes with other pr
|
||
|
||
@dataclass | ||
class RangeConditionItem(BaseItem): |
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.
Add, consider alternate implementations (operator or functional on top of ConditionItem) and review
@@ -236,18 +322,38 @@ def work_func(comp_condition: Callable[[], bool]) -> py_trees.common.Status: | |||
|
|||
@dataclass | |||
class CheckAndDoItem(BaseItem): |
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.
Submit as own PR, discuss later
AnyConditionItem = Union[ConditionItem, SequenceConditionItem, RangeConditionItem, UseCheckConditionItem] | ||
AnySequenceItem = Union[SequenceItem, SequenceConditionItem] |
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.
Keep, document interface
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.
start examples folder???
ENH: add test ioc generator from #54
ENH: include save_tree_to_path from #54
ENH: implement SequenceConditionItem from #54
All composite PRs from this one are merged I think I'll also wait on a potential impending comparisons rework to handle the range and/or isclose case |
It is now time to make the mfx tree examples PR! |
Closing now that #68 exists |
Description
This is a draft PR intended for discussion rather than for merging.
As per #21 and https://jira.slac.stanford.edu/browse/BEAMS-6, this includes a realistic tree example that I used to get a feel for how much the existing structures were usable in a mid-sized close-to-real-world example.
This tree is intended to be part of a larger tree that would help MFX scientists set up their beamline. It would do the menial tasks like set slits to known values, put various devices in or out, and generally get the beamline ready to manually center the beam on the DG1 yag.
In the process, I made some prospective additions and changes to the tree_config submodule. These are all up for discussion and could be kept or discarded as appropriate: for example, perhaps it is more useful to adjust the existing resources rather than add these new resources?
Motivation and Context
We need to try this out on a sizeable real system and this gets us closer.
How Has This Been Tested?
Not at all, I was planning to make a caproto IOC or do some blackboard monkeypatching to play around with the logic in debug.
If any of the additions to tree_config are kept I can add the respective test cases.
Where Has This Been Documented?
Only here and in the jira ticket.
Pre-merge checklist
docs/pre-release-notes.sh
and created a pre-release documentation page