Skip to content

Commit

Permalink
pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
joshc-slac committed Nov 27, 2024
1 parent 55e7c13 commit f6e0bb6
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 14 deletions.
2 changes: 1 addition & 1 deletion beams/tests/artifacts/egg_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@

from beams.tree_config.action import IncPVActionItem, SetPVActionItem
from beams.tree_config.base import BehaviorTreeItem
from beams.tree_config.value import EPICSValue, FixedValue
from beams.tree_config.composite import SequenceItem
from beams.tree_config.condition import (BinaryConditionItem,
BoundedConditionItem,
ConditionOperator)
from beams.tree_config.idiom import CheckAndDoItem
from beams.tree_config.py_trees import (RunningItem, StatusQueueItem,
SuccessItem)
from beams.tree_config.value import EPICSValue, FixedValue


# egg 1
Expand Down
2 changes: 1 addition & 1 deletion beams/tests/test_bin.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
from beams.bin.main import main
from beams.tests.conftest import cli_args, restore_logging
from beams.tree_config import save_tree_item_to_path
from beams.tree_config.value import EPICSValue
from beams.tree_config.composite import SequenceItem
from beams.tree_config.condition import BinaryConditionItem
from beams.tree_config.value import EPICSValue

logger = logging.getLogger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion beams/tests/test_serialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

from beams.tree_config.action import IncPVActionItem, SetPVActionItem
from beams.tree_config.base import BehaviorTreeItem
from beams.tree_config.value import EPICSValue, FixedValue
from beams.tree_config.composite import SequenceItem
from beams.tree_config.condition import BinaryConditionItem, ConditionOperator
from beams.tree_config.idiom import CheckAndDoItem
from beams.tree_config.value import EPICSValue, FixedValue


def test_serialize_check_and_do():
Expand Down
3 changes: 1 addition & 2 deletions beams/tests/test_utility_trees.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import time
from pathlib import Path

import py_trees
from caproto.tests.conftest import run_example_ioc
Expand All @@ -18,7 +17,7 @@ def test_sys_reset(request, bt_cleaner):
"beams.tests.mock_iocs.SysResetIOC",
request=request,
pv_to_check="SysResetTest:HEARTBEAT",
)
)

reset_ioc_tree.setup_with_descendants()
while reset_ioc_tree.status not in (
Expand Down
12 changes: 5 additions & 7 deletions beams/tree_config/utility_trees/reset_ioc.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@
from dataclasses import dataclass

import py_trees
from py_trees.composites import Sequence

from epics import caget
from py_trees.composites import Sequence

from beams.behavior_tree.action_node import ActionNode, wrapped_action_work

from beams.tree_config.base import BaseItem
from beams.tree_config.value import BlackBoardValue, EPICSValue
from beams.tree_config.action import SetPVActionItem
from beams.tree_config.base import BaseItem
from beams.tree_config.condition import BinaryConditionItem, ConditionOperator
from beams.tree_config.value import BlackBoardValue, EPICSValue

logger = logging.getLogger(__name__)

Expand All @@ -27,7 +25,7 @@ class ResetIOCItem(BaseItem):
def __post_init__(self):
# non dataclass PVss
self.hbeat_val = BlackBoardValue(bb_name=f"{self.ioc_prefix}_reset",
key_name=self.HEARTBEAT_KEY_NAME)
key_name=self.HEARTBEAT_KEY_NAME)
self.name = f"{self.ioc_prefix}_reset_tree"

def get_tree(self) -> Sequence:
Expand Down Expand Up @@ -59,7 +57,7 @@ def cache_hbeat_wfunc():
send_reset = SetPVActionItem(name=f"reset_{self.ioc_prefix}",
pv=f"{self.ioc_prefix}:SysReset",
value=1,
loop_period_sec=3.0, # this is greater than work_timeout period, should only happen once.
loop_period_sec=3.0, # this is greater than work_timeout period, should only happen once.
termination_check=reset_success_termination_condiiton)

root = Sequence(name=self.name,
Expand Down
3 changes: 2 additions & 1 deletion beams/tree_config/value.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import logging
from typing import Any
from dataclasses import dataclass
from typing import Any

import py_trees
from epics import caget

from beams.serialization import as_tagged_union

logger = logging.getLogger(__name__)
Expand Down
2 changes: 1 addition & 1 deletion examples/mfx_dg1/mfx_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

from beams.tree_config import save_tree_item_to_path
from beams.tree_config.action import SetPVActionItem
from beams.tree_config.value import EPICSValue, FixedValue
from beams.tree_config.composite import (SelectorItem, SequenceConditionItem,
SequenceItem)
from beams.tree_config.condition import (BinaryConditionItem,
BoundedConditionItem,
ConditionOperator)
from beams.tree_config.idiom import CheckAndDoItem
from beams.tree_config.value import EPICSValue, FixedValue

# DG2 Stopper: remove
check_dg2_stp_not_open = BinaryConditionItem(
Expand Down

0 comments on commit f6e0bb6

Please sign in to comment.