Skip to content

Commit

Permalink
MNT: rename loop_freq -> loop_period_sec for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
tangkong committed Aug 8, 2024
1 parent de5f99e commit cd8bb71
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion beams/tests/artifacts/eggs.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"IncPVActionItem": {
"name": "",
"description": "",
"loop_freq": 1.0,
"loop_period_sec": 1.0,
"pv": "PERC:COMP",
"increment": 10,
"termination_check": {
Expand Down
4 changes: 2 additions & 2 deletions beams/tests/artifacts/eggs2.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"SetPVActionItem": {
"name": "",
"description": "",
"loop_freq": 1.0,
"loop_period_sec": 1.0,
"pv": "RET:FOUND",
"value": 1,
"termination_check": {
Expand Down Expand Up @@ -49,7 +49,7 @@
"SetPVActionItem": {
"name": "",
"description": "",
"loop_freq": 1.0,
"loop_period_sec": 1.0,
"pv": "RET:INSERT",
"value": 1,
"termination_check": {
Expand Down
6 changes: 3 additions & 3 deletions beams/tree_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def cond_func():
@as_tagged_union
@dataclass
class ActionItem(BaseItem):
loop_freq: float = 1.0
loop_period_sec: float = 1.0


@dataclass
Expand Down Expand Up @@ -201,7 +201,7 @@ def work_func(comp_condition, volatile_status):

# specific caput logic to SetPVActionItem
caput(self.pv, self.value)
time.sleep(self.loop_freq)
time.sleep(self.loop_period_sec)

# one last check
if comp_condition():
Expand Down Expand Up @@ -259,7 +259,7 @@ def work_func(comp_condition, volatile_status):

# specific caput logic to IncPVActionItem
caput(self.pv, value + self.increment)
time.sleep(self.loop_freq)
time.sleep(self.loop_period_sec)

# one last check
if comp_condition():
Expand Down

0 comments on commit cd8bb71

Please sign in to comment.