Ticket8780 alarms config#4
Conversation
| from server_common.common_exceptions import MaxAttemptsExceededException | ||
| from server_common.loggers.logger import Logger | ||
|
|
||
| # ruff: noqa: ANN001, ANN201, ANN002, ANN003, ANN202, E721 |
There was a problem hiding this comment.
Possible to fix these Ruff errors rather than ignoring them?
There was a problem hiding this comment.
There are no ruff challenges with the piece of code I have changed. However it asks for file reformat, and when I reformat, it changes a lot of places and then fails with all these errors. So either I have to keep these or go with the reformat error from ruff.
| str : A decompressed and unhexed version of the input string | ||
| """ | ||
|
|
||
| return zlib.decompress(binascii.unhexlify(value)).decode("utf-8") |
There was a problem hiding this comment.
If you really need this function, could you call the original dehex&decompress, then decode the result?
Please move type hints to function signature from docstring.
There was a problem hiding this comment.
The original method fails because of the type check -- Argument was type str, the method only expects bytes. Type hint removed.
|
|
||
|
|
||
| def dehex_and_decompress_waveform_value(value: str) -> str: | ||
| """Decompresses the inputted waveform, assuming it is available as string. |
Added xsd changes to block to support alarm config.
To see the changes work, change the line git+https://github.com/ISISComputingGroup/server_common ; platform_system=="Windows"
by
git+https://github.com/ISISComputingGroup/server_common@Ticket8780_Alarms_Config ; platform_system=="Windows"
in \Instrument\Apps\Python3\package_builder and pip install.
You would then see the new xsd in \Instrument\Apps\Python3\Lib\site-packages\server_common\schema