Skip to content
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

Fix severity #18

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion correlator_pcaspy.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@
@param src (str): The source of the error
"""
self.update_pv_and_write_to_device(Records.ERRORMSG.name, error)
print_and_log(error, severity.value, src)
print_and_log(error, str(severity), src)

def set_disconnected_alarms(self, in_alarm: bool):

Check failure on line 123 in correlator_pcaspy.py

View workflow job for this annotation

GitHub Actions / call-workflow / ruff

Ruff (ANN201)

correlator_pcaspy.py:123:9: ANN201 Missing return type annotation for public function `set_disconnected_alarms`
"""
Sets disconnected alarms if in_alarm is True
@param in_alarm (bool): Whether to set the disconnected alarms or
Expand All @@ -139,7 +139,7 @@
for record in Records:
self.setParamStatus(record.name, status, severity)

def get_converted_pv_value(self, reason: str) -> Any:

Check failure on line 142 in correlator_pcaspy.py

View workflow job for this annotation

GitHub Actions / call-workflow / ruff

Ruff (ANN401)

correlator_pcaspy.py:142:54: ANN401 Dynamically typed expressions (typing.Any) are disallowed in `get_converted_pv_value`
"""
If the supplied reason has a defining record, applies the convert_from_pv
transformation to current pv value else returns current pv value.
Expand All @@ -155,7 +155,7 @@
sanitised_value = pv_value
return sanitised_value

def update_param_and_fields(self, reason: str, value: Any) -> None:

Check failure on line 158 in correlator_pcaspy.py

View workflow job for this annotation

GitHub Actions / call-workflow / ruff

Ruff (ANN401)

correlator_pcaspy.py:158:59: ANN401 Dynamically typed expressions (typing.Any) are disallowed in `value`
"""
Updates given param, VAL field, and alarm status/severity in PCASpy driver
@param reason (str): The name of the PV to get the value of (without the prefix)
Expand All @@ -171,7 +171,7 @@

@_error_handler
def update_pv_and_write_to_device(
self, reason: str, value: Any, update_setpoint: bool = False

Check failure on line 174 in correlator_pcaspy.py

View workflow job for this annotation

GitHub Actions / call-workflow / ruff

Ruff (ANN401)

correlator_pcaspy.py:174:35: ANN401 Dynamically typed expressions (typing.Any) are disallowed in `value`
) -> None: # pylint: disable=line-too-long
"""
Helper function to update the value of a PV held in this driver and sets the value
Expand Down Expand Up @@ -207,7 +207,7 @@
# Update PVs after any write
self.updatePVs()

def set_array_pv_value(self, reason: str, value: Any) -> None:

Check failure on line 210 in correlator_pcaspy.py

View workflow job for this annotation

GitHub Actions / call-workflow / ruff

Ruff (ANN401)

correlator_pcaspy.py:210:54: ANN401 Dynamically typed expressions (typing.Any) are disallowed in `value`
"""
Helper function to update the value of an array PV and the array PV fields (NORD)
@param reason (str): The name of the PV to set
Expand All @@ -218,7 +218,7 @@
self.setParam(f"{reason}.NORD", len(value))

@_error_handler
def write(self, reason: str, value: Any) -> None:

Check failure on line 221 in correlator_pcaspy.py

View workflow job for this annotation

GitHub Actions / call-workflow / ruff

Ruff (ANN401)

correlator_pcaspy.py:221:41: ANN401 Dynamically typed expressions (typing.Any) are disallowed in `value`
"""
Handle write to PV
@param reason (str): The name of the PV to set
Expand All @@ -240,7 +240,7 @@
THREADPOOL.submit(self.update_pv_and_write_to_device, reason, value)

@_error_handler
def read(self, reason: str) -> Any:

Check failure on line 243 in correlator_pcaspy.py

View workflow job for this annotation

GitHub Actions / call-workflow / ruff

Ruff (ANN401)

correlator_pcaspy.py:243:36: ANN401 Dynamically typed expressions (typing.Any) are disallowed in `read`
"""
Handle read of PV
@param reason (str): The name of the PV to get the value of (without the prefix)
Expand All @@ -254,7 +254,7 @@
pv_value = self.getParam(reason)
return pv_value

def wait(self, wait_in_seconds) -> None:

Check failure on line 257 in correlator_pcaspy.py

View workflow job for this annotation

GitHub Actions / call-workflow / ruff

Ruff (ANN001)

correlator_pcaspy.py:257:20: ANN001 Missing type annotation for function argument `wait_in_seconds`
"""
Wait for a specified number of seconds
@param wait_in_seconds (float): The number of seconds to wait
Expand Down Expand Up @@ -428,7 +428,7 @@
raise


def main():

Check failure on line 431 in correlator_pcaspy.py

View workflow job for this annotation

GitHub Actions / call-workflow / ruff

Ruff (ANN201)

correlator_pcaspy.py:431:5: ANN201 Missing return type annotation for public function `main`
"""
Parse the command line arguments and run the remote IOC server.
"""
Expand Down
Loading