Skip to content

Ticket8780 alarms config#4

Open
Chsudeepta wants to merge 17 commits into
mainfrom
Ticket8780_Alarms_Config
Open

Ticket8780 alarms config#4
Chsudeepta wants to merge 17 commits into
mainfrom
Ticket8780_Alarms_Config

Conversation

@Chsudeepta

@Chsudeepta Chsudeepta commented Sep 15, 2025

Copy link
Copy Markdown
Contributor

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

Comment thread src/server_common/utilities.py Outdated
from server_common.common_exceptions import MaxAttemptsExceededException
from server_common.loggers.logger import Logger

# ruff: noqa: ANN001, ANN201, ANN002, ANN003, ANN202, E721

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possible to fix these Ruff errors rather than ignoring them?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/server_common/utilities.py Outdated
str : A decompressed and unhexed version of the input string
"""

return zlib.decompress(binascii.unhexlify(value)).decode("utf-8")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@Chsudeepta Chsudeepta Jul 20, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original method fails because of the type check -- Argument was type str, the method only expects bytes. Type hint removed.

Comment thread src/server_common/utilities.py Fixed


def dehex_and_decompress_waveform_value(value: str) -> str:
"""Decompresses the inputted waveform, assuming it is available as string.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants