Skip to content

Commit aa45220

Browse files
committed
make set_pv_value() do nothing if None is given as value
1 parent a7dd06c commit aa45220

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

ruff.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ ignore = [
2323
"D406", # Section name should end with a newline ("{name}")
2424
"D407", # Missing dashed underline after section ("{name}")
2525
"N999", # Ignore this because the repo itself would need to be renamed
26-
"ANN101", # ignore this until its removed in future versions
27-
"ANN102", # ignore this until its removed in future versions
2826
"ANN401", # explicit ANY type is allowed
2927
]
3028
[lint.per-file-ignores]

src/genie_python/genie_epics_api.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,12 +323,18 @@ def set_pv_value(
323323
324324
Args:
325325
name: the PV name
326-
value: the value to set
326+
value: the value to set. If this is None, do nothing.
327327
wait: wait for the value to be set before returning
328328
is_local (bool, optional): whether to automatically prepend the
329329
local inst prefix to the PV name
330330
attempts: number of attempts to try to set the pv value
331331
"""
332+
if value is None:
333+
self.logger.log_info_msg(
334+
f"set_pv_value called with name={name} value={value} wait={wait}"
335+
f" is_local={is_local} attempts={attempts} ignoring because value is None"
336+
)
337+
return
332338
if is_local:
333339
if not name.startswith(self.inst_prefix):
334340
name = self.prefix_pv_name(name)

0 commit comments

Comments
 (0)